Maya Constraint Issue

Hey All,

I have recently starting working in Maya having come from an XSI background, so if this question is obvious please bare with me!

I am currently running Maya 2012 and have come across an odd behaviour which i wouldnt expect.

If i create a chain of joints, then create a locator. Parent Constrain one of the joints to the locator. Now set the constraint value/blend to zero. You’re free to move the joint and cycle the timeline and all is as expected, however, if you move the locator the joint pings its transform (it doesnt match the locator transform however).

As the blend value is at zero, and i can indeed move the joint freely i wouldnt expect the transform of the locator to have any effect over the joint. Keying the Joint does get around the problem, but it would be good to understand why this is happening.

Any Idea’s?

Mike

While everyone else is asleep, i’ll post my thoughts and then someone who knows what they’re talking about can come correct me :slight_smile:

In maya docs, it says:

Constraint weights are useful only when there are multiple target objects.

When there is only one target object, any weight that is greater than 0 is interpreted as 1. Therefore, the single target is interpreted as having 100% influence over the constrained object.

Kinda horribly worded…but to me, if you set a weight to 0, it doesnt prevent the constraint, but rather “freezes” it at the initial value. If you want to completely prevent the constraint, set its node state to Blocking.

Because (for example) joint1.translateX has an incoming connection from the constraint node (check it out in hypergraph/shade), joint1’s translateX is determined by that node. So at weight = 0, Im guessing that the constraint node STILL assigns it a value based off the parent at the position when they were constrained.

It make sense when you consider mayas dependency graph - you modify the parent, this triggers an update of the parent constraint node, which at weight=0, may ignore the parent’s NEW position, but still has to directly set the joint’s translate value.

I imagine the constrain node maybe doing something like this:

a = parentInitialPos + initialOffset
b = newParentPos
constraintOutput = a + ((b-a) * weight)

where weight is only ever 0 or 1 for a single parent.

But this is all just guesswork!

Because the parent constraint does not work like you are thinking… It just acts more like a combined pos/orient than a Softimage or MotionBuilder parent. You can hack it though and hook an extra node in to the parent constraint offset (connection editor) and animate that, it will act like you are able to animate the joint as a regular child joint instead of having it locked to the locator.

You hitting keyframe creates a new node called a pairblend that will mix the animation of the node with the constraint values letting you blend between them but I don’t think that is what you will want. (this is a setting in the Maya preferences that can be turned off and I recommend turning it off or you can cause some un-intended headaches on a rig.)

You can also create the parent constraint on to an animation layer (check the constraint options) and then you get some more freedom to blend its effect on and off with out the jumping.
or you can just add an animation layer and add the skeleton object to it after you have constrained it and then just offset it as needed.

Or setting it to override will let you animate it and then just bring the layer weight to 0 to have the constraint effect take back over.

A few diffrent ways to work with or think about the problem for you.

Awesome replies, it definitely makes a lot more sense now. Your replies are much appreciated.

Thanks.

Mike.