Notifications
Clear all

[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

4 Replies

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:

  1. Create two points with the transform of your spline control.

  2. Link one of them to the head, the other one to the character general shape (WORLD).

  3. Put a Position and an Orientation Constraint to your shape, and choose those two points as targets.

  4. 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).

  5. 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.

I see your point Iker, it sounds way better end simpler.

Thank you

 PEN

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.

 PEN

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