How in code bellow convert string A to command M.texmap_diffuse ? I need in strings, because want to manipulate with them :
(
local M = meditMaterials[activeMeditSlot]
if classof M == VrayMtl do A = "M.texmap_diffuse"
A
)
Forum topic · General Scripting
convert String To Command
By Yog · 2016-08-05
Comments (4)
Comment policy
Thanks to all! I solved this with execute command:
(
fn fn_A = (
local M = meditMaterials[activeMeditSlot]
local B = "meditMaterials[activeMeditSlot]."
if classof M == VrayMtl do local A = #("texmap_diffuse")
A[1] = execute (B + A[1])
)
D = fn_A()
)
hmmm....
better like this
then like this =
instead"M.texmap_diffuse"it
instead of
it would be better
later you can use it like this
see getProperty and setProperty in max help
also its not good practice using "execute" command in maxscript.....
here is the sample code
I think I found it :D
Hello, I saw your post and started playing around in max and got this bit of code (below) to work, I think it should work for your purpose too (hope it does).
-Maarten
(
str = "select geometry"
execute str
)