(Maya) Animatable Pivot Point Control?

Has anybody ever set up something like this before? I’m trying to make a control that can be positioned to where you want it to pivot from to animate with. but not having much luck.

Right now I’m using two controls. Control A allows you to place your pivot (translate it, rotate it.) and Control B is a child of Control A. Control B allows you to animate from that new pivot. When you move Control A your rig stays in place. When you move Control B your rig moves with it.

So right now I have those two controls and a null that sits under Control A in the hierarchy to get counter animation. Then there is a animation rig that is grouped and that group moves the whole rig.

I’m starting out by parent constraining the rig group Control B. Then I’m taking the Translate and Rotate value of the null and connecting it to target > target[0] > target[0].targetOffestTranslate and target[0].targetOffestRotate. Esentially just live updating the maintain offset.

As far as rotation goes, this set up works just fine. It’s starts to break down with rotation. I can get an initial placement positioning the two controls with Control A not moving the rig. But as soon as Control B is moved I get swimming motion from the rig.

I think I’m not accounting for a level of motion still because the rig seems to be rotating from a relative point but accounting for the rotations of the two controls, as it would with a direct connection more than a constraint.

Anyway, does anybody have a better solution for this? I am not so hot at Matrix math and I’m just taking a stab at this.

As far as actually animating the actual pivot point or not I don’t actually care so long as I have a control that lets me translate and rotate starting from a certain orientation and then go back to the default position without the rig swimming all over the place while going back. In theory Control A just moves a pivot without moving the rig and Control B is the only thing that moves the rig. And Control B is positioned by Control A.

The way I’ve set it up in the past is more of switch, nothing where it’s interpolating the pivot during motion. Without matrix math setups, I’m not sure this is possible.

What I do: Ask the user to choose a new pivot position with a marker and store the world position of the object. Then when the user commits we key the previous frame, change the rotate pivot of the object to the new position and move the obj to its world space position. Lastly we set a key on our new frame.

Really its similar to ik/fk matching work, just with the rotate pivot attribute.

Why would you want to offset the translation pivot? I can’t think of any situation where you would need to do that, however I can see the benefits of offsetting the rotation and scale pivots, you can do this by connecting the translate value of another object to your object’s rotatePivot and scalePivot but you’re quickly going to see some strange behaviour as a few moments testing. Could you additional pivots into the rig like in an IK foot rig?

You could make a snap script which has already been mentioned but you’d have to also build in a way for the “pivot keys” to be easily selectable so they can be moved around or deleted if (=when) there are change requests for the animation.

My suggestion would be to create a nice interface which allows the user to parent constrain to another object and bake the constraint to keyframe, that’s the workflow a lot of animators use already, again you’d probably want to include some keyframe management functionality.

The main reason I want to do it is if the character needs to hop or roll over something. You could then use the surface of that thing as the whole body pivot to roll things.

Also, I’m playing around with this for hand grips where you could position a control for attachment and when you switch what the hand control is following you don’t get that inital pop as it adjusts to the new parent.

Another possibility is to look at it from the tool side: try playing with the ‘manip’ setting on the rotate tool to let you rotate around an arbitrary point without permanently changing the rig. You could hack up a tool that handled the context switch and selection sequence (select moving object, then rotation point) by looking for named or attributed locators in the scene so the animator could just say “I want to rotate around this” without the three steps Maya makes you doo.

[QUOTE=Technically Artistic;30098]The main reason I want to do it is if the character needs to hop or roll over something. You could then use the surface of that thing as the whole body pivot to roll things.

Also, I’m playing around with this for hand grips where you could position a control for attachment and when you switch what the hand control is following you don’t get that inital pop as it adjusts to the new parent.[/QUOTE]

I think the easiest thing to do is build a group directly above any control you want to have this functionality and use that to constrain to objects and bake the constraint to keys. It’s not clever and it’s destructive but it’s very stable and simple to manage and lots of animators are familiar with working this way already.

I realized why I was struggling with this. The swiming I’m getting is because controlA was moving the pivot with the object staying at the origin while control B was moving that pivot with the object relative to it. So when I adjust control A after the mater it results in the object moving its position relative to control B. I actually would need three controls for this, not two (Control A, B, C). I would need control A to move the overall pivot without moving anything but the other two controls, then control B would then move the pivot again without affecting the position of control C. I could then move the home location of control C without affecting the relative distance of the object to control C to not get the swimming during animation.

But that’s why I was struggling. Because I was initially trying to have a control that the first time I place it moves control B with it but after the initial position didn’t move control B with it, or at least the object relative to control B, which is asking for two different functions in one control.

The only way I’ve got this to work without jumps when it switches space was with a plugin. As you rotate the control the transform around the pivot object is converted into the control’s parent space and passed back to the control.
This will effectively mean that the rotation about the pivot is broken into both translation and rotation in the control’s parent space so that the stored transform is always in the same space.