Notifications
Clear all

[Closed] create a script controller variable via mxs?

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

7 Replies
1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

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…

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"
     

I find the documentation for the “expression” controller works with the MaxScript controllers, but they don’t document that the two are the same.

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

1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

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

Or just download the Max 9 help file from Autodesk 3ds Max – Documentation.

-Eric

This was exactly the information I was looking for today. Thanks a lot to steev for posting the solution.