|
hi when I input a multiple line script into a script controller it only adds the last line. Ive tried many ways to make it return using the ¬ key with no success.
How do I get a multi line script to be accepted ?
thanks joe g
cryshape.rotation.controller.Available.controller = rotation_script ()
cryshape.rotation.controller.rotation_script.controller.script = (
“theZ = normalize (” + num1 as string + “-” + objcen as string + “)”
“theUp = [0,0,1]”
“theX = normalize (cross theUp theZ)”
“theY = normalize (cross theZ theX)”
“theTM = matrix3 theX theY theZ"+ num1 as string
“$"+cryshape.name as string + “.transform = theTM”
)
|
|
|
|
Just build a string variable and assign to the controller’s .script property. Each line in the string should end with a New Line character \n
cryshape.rotation.controller.Available.controller = rotation_script ()
txt = "theZ = normalize (" + num1 as string + "-" + objcen as string + ")\n"
txt += "theUp = [0,0,1]\n"
txt += "theX = normalize (cross theUp theZ) \n"
txt += "theY = normalize (cross theZ theX)\n"
txt += "theTM = matrix3 theX theY theZ"+ num1 as string + "\n"
txt += "$"+cryshape.name as string + ".transform = theTM\n" cryshape.rotation.controller.rotation_script.controller.script = txt
It is a good idea to avoid using $ names in a script controller though (unless you are running an ancient version of Max).
Borislav “Bobo” Petrov
|
|
|