Saturday, 3 January 2015

Maya tips 006 - Constraining Object

Oh this is a headache topic, at least for me! Sometimes i just don't get it. Sometimes it works, sometimes it doesn't. So i am going to record what works for me and i can refer to it when i need to.

This assignment shot i did for Animation Mentor class 3, is about Stella Rig doing a acrobatic slam dunk. So it requires the Stella to hold a basket in one hand and pass to another a few times during the jump. 

I have done passing the ball sequence without constraint before and it is an even bigger headache. I have to go frame to frame to adjust the position of the ball, and any adjustments to the timing and spacing i have to do it all over again. So i learnt the hard way and give in to using constraint. And it is easy! Just a few things to take note of before confusion sets in.

The most important thing here is the "Outliner"! So get it on Hotkey or custom shelf button.

Create Locators

1. Click "Create"
2. Click "Locator" to create locators and scale them to appropriate size. I created 2 locators.
3. Position the locators near the body part i want to constrain object to.
4. Open up "Outliner" and rename locators to prevent confusion.



Constrain Locators

1. Click the curve that best suits controlling the movement of the object. I chose the wrist curve.
2. Hold "Shift" key and click the locator.
3. Click "Constrain".
4. Click "Parent". Default settings.
5. In "Outliner" a constraint will be created under the locator



Constrain Object

1. Reference or create the object. From the "Outliner" it would look like "Ball 2". Position near the locator.
2. Middle mouse click the object in "Outliner", hold and drag into the constraint created before. From the "Outliner" it would look like "Ball 1".


Done! Now when the wrist curve is moved the object moves together!


Switch on/off constrain

The constrain can be turned on and off, allowing the object to be animated dropping away from the hand.

1. There are 2 ways to go to constraint menu. Either click the constraint in "Outliner".
2. Or click the object, press up, up on keyboard.
3. This is the constraint menu.
4. 1 = ON , 0 = OFF



Things to take note

1. Make sure the graph for on/off constrain animation is either in stepped tangent.
2. Or create keys before and after the switch so that it works even if it is in auto tangent. Any in-betweens in the switching will cause the object to move. 



3. During constrain, the values are fixed, no animation needed. But when the constrain is switched off, the object will be back at where it was located at the start. So it is necessary to reposition 1 frame after the switch and not change anything before. Using bhGhost sure helps with the repositioning!
4. The visibility can also be animated. I use it instead of animating the on/off switch. So i actually already constrained 2 balls on each hand locators, switching "ON" one ball's visibility at a time, and used a third ball unconstrained to animate when its not contact with the hand. Well, this works at this moment because there is no spin on the ball, and nobody can see the spin anyway to tell that the ball switched between 3 balls.



No comments:

Post a Comment