[Closed] MaxScript, float script controllers, and custom attributes
I have an object with an attribute holder containing a custom attribute slider. Pretty standard, but for the sake of clarity:
Nothing tricky so far.
Now, I need a script that will take that slider and use it as an “assign track” variable for a script controller. Basically, taking the following script and figuring out what to put at ???:
p = point size:.05
c = path_Constraint()
p.pos.controller = c
c.path = $theObject
fs = float_Script()
c.percent.controller = fs
fs.addTarget “theSlider” $theObject.modifiers[1].???
Turn on the MacroRecorder in the listener, move the slider and check the listener’s pink pane
Is… that supposed to show something? Or are you pointing out that it shows nothing? 😮 ( 3ds Max 2009×32 )
The way I figure it… the custom attribute parameter doesn’t have a track, so you have to feed the script an object – i.e. controller, which means the custom attribute needs to have a controller first… then add that as a target… and then play with its value?
$.modifiers[1].theSlider.controller = bezier_float()
fs.addTarget "theSlider" $.modifiers[1].theSlider.controller
fs.script = "theSlider.value"
Sorry – in my head I typed “Add a controller and…”
It’s late. I’m tired. And wondering why I’m still getting BOM issues…
Ah, the joys of freelancing and not having a set bedtime!
Byte Order Mark: http://en.wikipedia.org/wiki/Byte-order_mark
My issues: http://forums.cgsociety.org/showthread.php?f=98&t=703376
Ah, my time is mostly synched to PST – it’s only 8.20pm there now (5.20am here)
That BOM looks like fun :\ ‘ll leave it to that other thread before Malkalypse slaps me with a clue-by-four, however
Thanks for the suggestion, Z, worked like a charm.
And don’t worry, I don’t mind a little off topic chatter, as long as it’s educational!