Search ProofOfProgress Blog

Sunday, January 22, 2012

Add Max's Custom Attribute Holder AKA empty modifier

I was trying to add an attribute holder to an object via maxscript...
But as we all know, max's listener sometimes isn't helpful.
Turns out "emptyModifier" IS max's inbuilt "attribute holder"
Here is a script that demonstrates how to add an attribute holder to the
selected object.

--Create the defintion for the custom attribute 
def=attributes testAttrib 
--Parameter block to store the tracks of animation 
parameters testP rollout:testR 
--A track of animation 
--Look under scripted plugins for the types that can be used. 
animationTrack type:#float UI:mySpinner 
--The rollout that will show up in the modifier panel. 
rollout testR "test" 
--The spinner that is connected to the animationTrack 
spinner mySpinner "My Spinner" 

addModifier $ eM 
--Add the definition to the emptyModifier 
custAttributes.add eM def;

No comments:

Post a Comment