[Closed] Scripted custom attribute and linking?
Hi everyone,
I’ve been working on a rig here and I have an eye control spline that could either be parented to the world or to the character’s head. I could use a custom rig dialog where a checkbox could be used to control the linking. However, I decided to add a custom Boolean attribute, with Attribute holder, to the eye control spline. I tried using scripted controllers of no avail. I can’t figure out how to make its on/off state control the linking and I’d be grateful if you help me out.
Thank you
I’m not 100% sure, but as far as I know you cannot animate checkboxes in MAX. The way I use to do it is this:
-
Create two points with the transform of your spline control.
-
Link one of them to the head, the other one to the character general shape (WORLD).
-
Put a Position and an Orientation Constraint to your shape, and choose those two points as targets.
-
Use WireParameters/Expressions/etc. to drive the weights of the targets using a CustomAttribute (float; 0.0 = go with head, 1.0 = go with World, for example).
-
You might like something for ‘snapping’ when blending, so there’s no jumps when switching from one to the other in the middle of an animation shot.
The constraint method is what I use the most as well. If you want to have an on off on you can use a checkButton and set the animatable property to true. Once you have set up the solution that IkerCLoN has presented then use a script controller or parameter wire to control the value of the weight using an in statement to out put the correct float value based on the boolean value of the checkButton.
Just so you know checkBoxs can be animated
b=box()
ah=emptyModifier()
addModifier b ah
def=attributes test
(
parameters paramsP rollout:paramsR
(
onOff type:#boolean UI:(onOffCb,onOffCbb) animatable:true
)
rollout paramsR "Params"
(
checkBox onOffCb ":On Off"
checkButton onOffCbb "On Off"
)
)
custAttributes.add ah def
select b
max modify mode