- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone,
I'm a beginner and I'm stuck with the logic of the referencing of a controller in MaxScript.
I'm trying to create a script that requires referencing a controller that has either been created by a script or not. Despite reading the documentation, I'm feeling a bit lost...
Is it possible to give a name to a controller when it's created? (the MaxScript listener remains silent when I rename it manually). I tried to add, without success, the line 'fs.name = "my_controller_name"' just after 'fs = Float_Expression()'.
If not, how can I reference a 'Float Expression' controller since MaxScript doesn't seem to recognize the syntax 'Float Expression.controller' or 'Float_Expression.controller'?
masterRot = $Wheel_00
-- Point gizmo creation
pointObj = Point box:on size:5 pos:selectedObj.pivot
-- Add Float Expression controller to the point object
pointObj.rotation.controller.Z_Rotation.controller = float_list ()
fs = Float_Expression ()
pointObj.rotation.controller.Z_Rotation.controller.Available.controller = fs
-- //!\\ problematic line doing error: trying to do a connection with a controller on an other object
masterRotCtrl = execute (masterRot.name as string +".rotation.controller.Z_Rotation.controller.Float Expression.controller")
-- Filling the expression of the float expression controller
fs.addScalarTarget "Rot" masterRotCtrl
fs.addScalarConstant "n" nT
fs.addScalarConstant "nR" nTR
fs.SetExpression "-Rot/(n/nR)"
Thank you in advance,
Solved! Go to Solution.