PDA

View Full Version : create a script controller variable via mxs?


steev
01-16-2007, 02:56 AM
i can't find any info on this in the mxs help...

i want to create a script controller via mxs like this...
$myobj.pos.controller[1].controller = float_script()

and then, in script, create a variable in that script controller. i can assign the track i need through script to that variable, but i just can't seem to figure out how to create that variable.

thanks!
steev

Bobo
01-16-2007, 03:30 AM
i can't find any info on this in the mxs help...

i want to create a script controller via mxs like this...
$myobj.pos.controller[1].controller = float_script()

and then, in script, create a variable in that script controller. i can assign the track i need through script to that variable, but i just can't seem to figure out how to create that variable.

thanks!
steev

I assume you are using Max 8?
In 9, this was documented correctly. In Max 8, I missed the IScriptCtrl interface, but you can get all methods and properties using:

showInterfaces (float_script())

Sorry for that...

steev
01-16-2007, 05:13 PM
thanks a bunch bobo!

turns out i needed "AddTarget". here's a simple example for anyone searching for the same thing down the road...


--creates a sphere & box
--assigns a script controller to the sphere's x position that
--follows the x position of the box

bx = box()
sp = sphere()
spPos = sp.pos.x_position.controller = float_script()

spPos.AddTarget "boxXpos" bx.pos.controller.x_position.controller
spPos.script = "boxXpos"

mustan9
01-16-2007, 07:03 PM
I find the documentation for the "expression" controller works with the MaxScript controllers, but they don't document that the two are the same.

Aearon
01-17-2007, 06:41 PM
well not they are not the same really, you should do what bobo suggested as some of the methods are different, maybe save the listener output to a file

Bobo
01-17-2007, 10:17 PM
well not they are not the same really, you should do what bobo suggested as some of the methods are different, maybe save the listener output to a file

...or get the MXS 9 Help file from the 30 days demo, it has it fixed.

PiXeL_MoNKeY
01-17-2007, 10:45 PM
Or just download the Max 9 help file from Autodesk 3ds Max - Documentation (http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=5659551).

-Eric

bcloward
07-02-2007, 06:06 PM
This was exactly the information I was looking for today. Thanks a lot to steev for posting the solution.

CGTalk Moderation
07-02-2007, 06:06 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.