Aim Constraints, IK Switch and Nodes
Maya: Rigging Fundementals
ANIM CONSTRAINTS, IK SWITCH, NODES
Todays Class
IK FK Switch Control
Nodes
Auto Twisting Halfway Joints
INSTRUCTIONS
1. Lecture
We’ll cover IK FK switch, nodes and auto driven halfway joints.
2. Practical
We’ll make an auto driven halfway joint system in the shoulder.
CONSTRAINTS AND SWITCHING WORLD SPACES
Animating Constraints
Animating constraints between two objects is really very straight forward.
1. Shift select the multiple objects we wish to constrain to
2. Shift select then the main object we want to constrain last
3. Go to
Animate Menu > Constrain > Parent Constraint (options)
4. Click “Maintain Offset” off and press “Apply”
When we want to change the magnet weighting of each object we can select the constraint on the constrained object find the attributes with object weighting and change/animate accordingly.
[iframely]http://www.youtube.com/watch?v=LNsbnssihgY
Mixing Keys with Constraints Film Example
Some scenes will require complex hierarchy changes in animation. While working on the previs for this sequence from Happy Feet 2 the Krill character had to be animated in multiple world spaces including sometimes parenting him to the camera itself.
I found the easiest solution was to plot out the previs animation to different world spaces using constraints but only work in one world space at a time with plotted keys. When I wanted to adjust another section of animation I’d re-plot to that world space, delete keys on area’s I needed to change and reanimate from there.
This is a simple technique that came from my experience working on complicated scenes on the film Gravity.
The Happy Feet 2 scene was a tricky sequence to work on in previs/lensing because the director kept changing the details of the previs animation including merging shots together and re cutting as we went along. Some of these crazy camera moves were a real challenge to work on…
Happy Feet Two Krill Abseiling Scene. Dr D Studios and Warner Bros, many animators were involved in this scene. I guess you could say I was responsible for getting the scene to work, getting the core animation physics to read correctly by using a lot of this plotting constraints technique.
[iframely]http://www.youtube.com/watch?v=kCtYNJiDbtg
Mixing Keys with Constraints
The important thing to remember with mixing keyframes and constraints in maya is that the action we performed last wins. So if we constrain first and then keyframe after the keyframe will break the constraint. But if we keyframe first and then add the constraint… the constraint will take priority.
Overall: Keyframes vs Constraints the one we did last wins, as seen in the demo below.
It’s important to distinguish because it’s common to use constraints to copy keys from one world space to another. This is handy for plotting world space changes like walk cycles animated on the spot into world coords. Or as I’ve found on any scene which requires animating between different hierarchies as seen above.
[iframely]http://www.youtube.com/watch?v=7p7_rvpsvk4
Plotting Constraints
[iframely]http://www.youtube.com/watch?v=QGqFrJYb5qw
Locking Feet On Walk Cycles
Here’s an overview of how and why we want to plot our controls from local space into world space for walk cycles.
[iframely]http://www.youtube.com/watch?v=dyvOW1ZEbS8
Here’s how we manually do this in Maya step by step.
1. Animate the walk cycle on the spot.
2. Use the MoveAll control to animate the walk cycle through space, be sure to make the feet slide as little as possible. You can also have the character walk along a curve with a motion path.
3. Create 3 locators in world space and plot the animation of both feet and hips. By…
a) Key the locators for translation and rotation
b) Constrain the locators individually to the hips and both feet
c) bake the animation by selecting the rotation and translation attributes in the channel box and in the fcurve editor…
curves > bake channel
d) delete the contraints
4. Delete the animation on the MoveAll control and reset it to world center. Leave keyframes on the hip and feet controls
5. Constrain the hip and feet curve controls to the locators
6. Plot out the new position and rotation of the curve controls with “bake” as per step 3.
7. delete the constraints and the locators.
[iframely]http://www.youtube.com/watch?v=DNvdjBnlaAM
On the short film Polar I used the same technique manually in another program called Softimage for the 3rd shot which was shared with other animators. Animating 5 Polar bears with four feet each and a long shot with deadlines and a tricky client makes for some challenging obstacles as we all found out!
Coke-a-Cola Short Film “Polar”. Animal Logic. Many animators were involved in the many walk cycles at the beginning of this short film.
[iframely]http://www.youtube.com/watch?v=WtxJft7B2ts
Locking Feet On Walk Cycles
There are some scripts that automate the manual part of this plotting workflow. One such script is Locinator an extremely handy script by CG Monks who are resposible for the Morpheus rig.
http://www.cgmonks.com/tools/maya-tools/locinator/
Locinator Basics
[iframely]http://www.youtube.com/watch?v=F7yyc3CQ8lg
Using Locinator For Animated Constraints
The following is a tutorial which combines both animated constraints and Locinator as a tool to help smooth out transitions.
The main sphere character jumps off a moving platform and lands on the ground with a smooth transition without blending constraints.
In the end we use 3 controls
2 custom controls
1. Control while on the platform
2. Control while on the ground
And a third for the transition
3. Locinator to bridge the transition.
This method keeps our keys from becoming baked. However I’ll often bake my animation on controls to simplify animation. As layering between different controls and constraints can become very messy. The following method gets around that by simply having the character in one world space at any given time. No blending.
[iframely]http://www.youtube.com/watch?v=fW0ktPuVGjM
IK/FK Switch with Driven Keys
Continuing on from last week we’ll make an IK/FK switch this time with full controls and attributes linked with Driven Keys. Here’s an overview of an IkFk switch on an arm rig…
[iframely]http://www.youtube.com/watch?v=v-CSBnt542g
This demo below shows how to build and setup the constraints for an ik arm.
[iframely]http://www.youtube.com/watch?v=oT0g18o92BU
And here we’ll create one attribute rather than 6 to control the arm switch with driven keys.
[iframely]http://www.youtube.com/watch?v=KUXspbcl22E
Nodes Vs Expressions
Now is a perfect time to introduce nodes into the equation, this is where a lot of the meat of complex rigging takes place.
Many programs have complex functionality driven via expressions and maya is no different, we can use .mel to take control of our objects. However expressions in Maya are slow, the expressions have to go through a filter to convert them into machine code… the frame rate on our rigs can slow to a chuggy crawl.
An alternative and much more common approach is to use nodes which are more hard coded into the infastructure of Maya making them fast! 🙂
The Node Editor in Maya
Advantages of Nodes
1. No need to learn code! Use friendly
2. They’re fast, faster than expressions
3. We can change object names, connections are linked via objects not names.
Nodes have been a core part of maya from day one, however Maya 2013 brought the introduction of the Node Editor a nicer way to view and interact with nodes, and it’s been improved again in 2014. You can also view nodes networks in the Hypershade and Hypergraph. The Node Editor is the nice new way of using nodes.
Connections
Previously we used the Connection Editor to link objects to each other. We can easily do this in the Node Editor too.
[iframely]http://www.youtube.com/watch?v=g8P_Ifra29g
Layering Nodes
Nodes come in a little more handy when we need to alter the way a node values go in and out of objects. Say we wanted to multiple the value of a connection or mix the values of two object’s translation together.
[iframely]http://www.youtube.com/watch?v=hG9SFzwPhPA[/iframely]
With enough nodes and clever linking we can make some pretty complex setups.
Adding Auto Twist To Halfway Joints
Here’s a basic example of sending the twist of an object through 3 other objects dividing by three in order to add twist.
[iframely]http://www.youtube.com/watch?v=MckO0XPnHYY
Twist Throwing Values Forwards: Shoulder
In this example we twist from the shoulder control forward into halfway twisting joints.
[iframely]http://www.youtube.com/watch?v=yuwJ-qEljDA
Twist Throwing Values Backwards: Wrist
In this example we twist from the wrist control backwards into halfway twisting joints.
[iframely]http://www.youtube.com/watch?v=PZ-Lit-QwuU
Gimbal Problems with the Twist Setup
Auto twist has long ben a problem in Maya because it relies on Gimbal rotations to solve. This is fine for most joints but with controls that require multi rotational ranges like the shoulder joint it causes a lot of problems. Old styles that used this method would have to have counter rotation methods or off switches to manually let animators solve the problem.
In this demo we see how the auto twist can flip with gimbal rotations.
[iframely]http://www.youtube.com/watch?v=XcgpuqgatcM[/iframely]
New Skool Twisting
The older methods of twisting were prone to gimbal problems, seen in the shoulder especially. But I like to teach this course because it shows a few fundamental tools in a nice way and also exposes common problems regarding gimbal.
For proper shoulder twist we can use ik solutions (which use a quaternion math solution). The page for building that setup is here it’s very easy to build but to fully understand it’s a little abstract. It requires a bit more knowledge of quaternions which is for later classes. But easy to build and use so here it is…
No Flip Shoulder Setup (Link)
Instructor
Andrew Silke