Professional Documents
Culture Documents
The aim of these tutorials is to show and explain how you might tackle rigging your 3D character for animation. These tutorials will give help and advice to novices and experts who are looking to build on their rigging skills or approach rigging for the first time. The series gives a detailed step by step guide as to how to approach rigging but also shows us how to tackle common problems and issues that regularly occur even in a professional environment. The artists will be reflecting on working in the industry as well as talking us through their individual approaches to creating the best rigs possible.
- Free Model
This download includes The Model Used Within This Tutorial
Introduction to Rigging Chapter 1: Planning your Rig Introduction to Rigging: 1 - Planning your Rig
Software Used: Maya
Chapter Overview
Welcome to the Introduction to Rigging tutorial series for Maya. Throughout these lessons for beginners, you will discover some basic technical concepts that will get you started in the fun and crazy world of rigging! And at the end, we will rig a complete biped character and leave with a short introduction on scripting, to automate simple tasks. In this first chapter we almost wont be using the software itself first things first! Anyone can follow a tutorial and get things working, but you cant rely on tutorials forever, right? Youve got to understand what you are doing! So were going to explain a little about how character riggers think, and how to optimize your work from the very start of the process in just about any kind of job. Are you ready? Lets do this! everything thats in your mind, like some crazy, hungry monkey, before planning your rig! Like with almost everything in life, if you dont plan before taking action you will most likely have a hard time trying to get things working! The process of building a character rig can be really complex, so its a good idea to write a task list to avoid skipping important steps (Fig.01). Pro Tip: First, lets play a little with our character and try to imagine how we can get good deformations. Good practice is to take screenshots from your model and draw over them. Try to figure out the ideal location of the skeleton, controls and pivots based in your characters proportions. Dont worry about this now; we will help you throughout this chapter (Fig.02). Good practice in Maya is to use Groups (Any Mode > Edit > Group). Your rig must be as simple as possible. It doesnt matter whether youre working on a simple cartoon character or on a badass realistic creature: keep thinking in terms of solutions! They will come to you more easily when your rig and workflow are organized (Fig.03). Please, try to rename all objects, geometries, curve controls, nodes, etc. To sum up: everything you create and may have to use later.
Planning
Before taking any action, here is something you should always remember: Do not try to create
Naming
There are lots of object types in the 3D world, so its easy to mix them up or delete what you shouldnt when youre on a tight schedule or working on really large scenes. Be careful to always name all of your objects, whilst keeping the names as clean and understandable as possible. A simple pipeline only uses prefixes and suffixes for all nodes (objects in your Maya scene).
Organization
In the rigging world, being organized is essential! Organization helps you to create easy-to-understand and up-to-date setups.
www.3dcreativemag.com
page 75
References
Whenever rigging creatures, be they humanoid, alien, animal, robotic, or whatever, always look for anatomy references in books and on the internet. Having knowledge about anatomy is a very important basis for creating good skeletons and muscle deformations.
Basic Anatomy
Lets now discuss a little about some of the basic aspects of anatomy so we can position
www.3dcreativemag.com
page 76
Spine
The center of gravity (or center of mass) of a character is located in the spine, near the navel (wed usually consider the waist joint as the root joint of all the hierarchy). When building the chest, be aware that its the body part that deforms the least, while the abdomen is the most flexible region of the spine (Fig.06).
www.3dcreativemag.com
page 77
Legs
The leg joint can rotate in all directions, and its possible to rotate the ankle with it together, as if in a group. The knee just rotates in one direction, whilst the toes on the feet are similar to the fingers on the hand (with three phalanx bones for each), except that the toes only have two phalanges each (Fig.10). Pro Tip: Remember to base your rigging on good anatomy whenever you can, but dont let it imprison your creativity! Sometimes we need to create mechanics that are different to realistic and natural anatomy in order to achieve the desired effects and deformations. Feel free to diversify using your creativity to get the best solutions for your needs.
In Closing
Thats it for this lesson! Be sure to draw and study a lot of anatomy and deformations! In the next chapter we will dive into Maya our 3D software of choice to put our knowledge into practice! Thats right, in the next part we will test our planning on the real thing! A brief overview will show you how the software works and explain some of its main tools that are used for the rigging process, and we will also discover some tips and tricks on general rigging so you can speed up your workflow.
www.3dcreativemag.com
page 78
The aim of these tutorials is to show and explain how you might tackle rigging your 3D character for animation. These tutorials will give help and advice to novices and experts who are looking to build on their rigging skills or approach rigging for the first time. The series gives a detailed step by step guide as to how to approach rigging but also shows us how to tackle common problems and issues that regularly occur even in a professional environment. The artists will be reflecting on working in the industry as well as talking us through their individual approaches to creating the best rigs possible.
- Free Model
This download includes The Model Used Within This Tutorial
Introduction to Rigging Chapter 2: Knowing your Tools Introduction to Rigging: 2 - Knowing your Tools
Software Used: Maya
Chapter Overview
In this chapter we will explain a little about Mayas architecture and take a look at some useful tools for the rigging process in order to get the best out of them. You will also see some tips and tricks on general rigging that will help you speed-up your rigging process a lot.
Concepts
When we work with rigging we need to think: what can we do to bring this character to life, whilst keeping it simple and clean? Rigging is a technical process that stands between modeling and animation and our responsibility is to create simple and easily understandable controls for the animators, while keeping the pipeline clean and straightforward as possible to achieve what we need. That is why it is very important to look for references in real-life or other CG sources. A good knowledge about anatomy and movement is essential! We need to understand a little about programming too, some processes can be very repetitive and scripting these tiring parts will make your work a lot quicker and fun. If you use Maya, you should learn a little about MEL and Python scripting. But dont worry about all of these topics right now! We will see all of them in the tutorials. an empty group. The visual representation of the object you are moving is called Shape. To see this clearly open up a new scene, take a look into your Outliner and check (Display > Shapes). Click on the plus sign on the left of the top camera object and you will see it has a transform (the white box) and a shape (the camera icon) (Fig.01). Please note you cannot move the shape without the transform, its Mayas way to keep track of where your object is in your scene. Now, I just said we cant move the shape without the transform, but that is not entirely true to meshes. You can move around geometry vertices without moving its transform, we will call this kind of movement deformation of components. Note that you cannot deform a camera, because its shape doesnt have components. Only edit shapes if you know what you are doing! That can lead to undesired deformations and weird pivots. So, summing it up, Transformation is when we edit (translate, rotate or scale) entire objects. Deformation is when we edit (translate, rotate or scale) components of a mesh (Fig.02).
www.3dcreativemag.com
page 113
In a practical example, you would use transformation to move around an entire ball and deformation to squash and stretch the components of this ball.
* Aim Constraint: constrains only the rotation of the object to make it always aim to the targets; * Scale Constraint: constrains only the scaling of the object (Fig.03);
riggers! The main goal of working with joints is to put them on the right position of the character in order to get the best deformations when the joint is transformed... that is how joints work; they are used to drive components of meshes. Simply put, you move a joint and it moves components of a mesh that are bound to this joint. Do not worry if you do not understand, we will talk about skinning in a moment (Fig.04). Tip: (Joints) = When creating a linear joint hierarchy using Joint Tool (Animation >>
Constraints:
Sometimes in Maya we need to make an object follow another in translation, rotation, scale, for example making it always face the target, etc... These can be done using constraints. To create a constraint, first select the target object (the one who will lead), then select the constrained object (the one who will follow the lead) and click on the desired type of constraint from the menu (Animation >> Constrain). By default, constraints override your objects transform values to match the target values but you can also create an offset in your constraint by checking the Maintain Offset checkbox in any constraint option box. * Point Constraint: constrains only the translation of the object using its own pivot point; * Orient Constraint: constrains only the rotation of the object using its own pivot point; * Parent Constraint: constrains only the translation and rotation of the object using the targets pivot point;
Joints
Joints are hierarchical deformers that makes the skeletal structure for our models possible. They are very flexible and we can use them for lots of different characters, animals and creatures as we like. By far the most used object for us
www.3dcreativemag.com
page 114
Skinning
Smooth Bind Skin (Animation >> Skin > Bind Skin > Smooth Bind) is used to drive your geometry using joints. It creates a skin Cluster deformer in the input history of the geometry making it possible for our joints to be used as deformers of our character model (Fig.06). We will take a look at the skinning process in detail in the next chapter.
Deformers
There are a lot of deformers in Maya. Each deformer has an attribute named Envelope that we can use to weigh the deformation applied. We will list some of the main ones that are used in rigging, but do not be satisfied with only these below, go ahead to try others too: Cluster It is a center point to modify geometries or selected vertices from a geometry. Create it by selecting a mesh or points of a mesh and going to (Animation > Create Deformers > Cluster), it will create a little C letter, our cluster Handle manipulator. This works almost the same as joints with the advantage of having a localized and easily adjustable effect. We can optimize this effect by painting its weight using (Animation >> Edit Deformers > Paint Cluster Weights Tool) (Fig.07).
www.3dcreativemag.com
page 115
Blend Shapes This allows us to model our own deformations anyway we want and toggle them as needed. We will see this topic in detail in chapter 5 (Fig.08). Lattice This deformer creates a box shape with points around geometries or selected points of geometries. Edit these points to deform the associated model. Create a lattice deformer by
selecting entire objects or components of them and going to (Animation >> Create Deformers > Lattice). Change the lattice S/T/U divisions for more resolution in X/Y/Z in order to get more precise deformations. The deformer also creates a lattice Base object (look at Outliner Panel) to define a starting location to calculate the deformations (Fig.09).
we have seen until now work? They need a start and an end position to points and simply send them from one point to another, in a straight line. Non-linear deformers do not calculate the deformation this way. Youll notice each of them has a unique method of editing your meshes points. Main Nonlinear Deformers, very useful for
There are also the non-linear deformers. Why non-linear? Remember how all the deformers
cartoon rigging projects: Bend + The bend deformer literally bends your
www.3dcreativemag.com
page 116
points in an arc. You can define its position and orientation by transforming the bend Handle manipulator. The Curvature attribute is used to measure the bending power and Low and High Bounds are used to change the boundaries of
the deformation. Create a bend deformer by selecting meshes or points of meshes and then clicking on (Animation >> Create Deformers > Nonlinear > Bend) (Fig.10).
Squash + The squash deformer will squash (or stretch) your geometry vertices while maintaining its volume. A squash Handle manipulator will be applied to selected meshes or points by going to (Animation >> Create Deformers > Nonlinear > Squash). You can move this handle around to the position where you get the best squash deformation for your needs. Edit its Factor attribute value in order to squash or stretch your geometry amongst other editable attributes (Fig.11). Now that you know some tricks, you are ready to get busy! In the next chapter we will start rigging our ET character by creating its skeleton hierarchy, go deeper into the skinning process and see a little more about blend shapes. Until then, practice a lot and get yourself comfortable with Maya!
www.3dcreativemag.com
page 117
The aim of these tutorials is to show and explain how you might tackle rigging your 3D character for animation. These tutorials will give help and advice to novices and experts who are looking to build on their rigging skills or approach rigging for the first time. The series gives a detailed step by step guide as to how to approach rigging but also shows us how to tackle common problems and issues that regularly occur even in a professional environment. The artists will be reflecting on working in the industry as well as talking us through their individual approaches to creating the best rigs possible.
- Free Models
This download includes The Models Used Within This Tutorial
Introduction to Rigging Chapter 3: Rig Creation Part 1 Introduction to Rigging: 3 - Rig Creation - Part 1
Software Used: Maya
Chapter Overview
This time we are finally getting down to business! We will start to create the skeleton hierarchy of our character while giving a deeper explanation to the skinning process. At the very end, we will take a peek on some blendshape targets for our ET character. Enough said, lets rig!
Joint Outlining
Now it is time to use our planned material from previous lessons to create the characters skeleton. Use the side, front, top and persp viewports to create these structures: the last joint in the hierarchy and for helping Spine: the root joint of a biped character must be the first lower spine, the waist. From then on you will need to create up to three joints until the chest area. Name them as spineA_jnt, spineB_ jnt and spineC_jnt. After that build another five joints for the neck_jnt, head_jnt, jaw_jnt, chin_jnt and chin_end. (Fig.01) TIP (joint Ends) = We do not use the joints suffixed _end as skinned influences. We only create them to help us visualize the rotation of Leg: now we can start with another separated joint hierarchy from top to bottom, but this time we will concentrate only on the left side because we will mirror the limbs from left to right later on. So, create six joints named as following: l_leg_ jnt, l_upKnee_jnt, l_lowKnee_jnt, l_ankle_jnt, l_foot_jnt, l_foot_end. Note the l_ prefix, that means left side. We will replace that for r_ when we mirror these and other limbs. Arm: for the arms we will use five joints that can be: the l_clavicle_jnt, l_shoulder_jnt, l_upElbow_ jnt, l_lowElbow_jnt and l_wrist_jnt. (Fig.03) TIP (Forearm Twist) = This technique is for a simple forearm twist: duplicate the wrist joint (Any Mode >> Edit > Duplicate) and move it along the chain (in our case, the X direction) until it is 1/3 of the distance of the low Elbow. Rename it as forearm_jnt and delete its child wrist joint. This is a simple yet very useful way to mimic the forearm twisting, when we rotate our hands. For now we wont actually be setting the forearm rig, we will take a look into its expression in the next chapter! (Fig.04) TIP (knee/elbow) = We use two joints as knee (or elbow) in order to get better deformations. These parts are very complex in real-life, so we need two joints to reach almost 180 degrees of rotation while minimizing volume loss. (Fig.02) Maya calculate the starting skin weights.
www.3dcreativemag.com
page 85
Introduction to Rigging
Hand: lets create four joints for each finger, such as: l_thumbA_jnt, l_thumbB_jnt, l_ thumbC_jnt, l_thumb_end. Parent finger joints to the l_wrist_jnt. (Fig.05)
the command (Any Mode >> Modify > Freeze Transformations). This way you will be able to return to the default joint positions (bind pose) when you paint skin weights.
vertices with the command and value currently set for the selected joint. A technique that we use is to repaint all of the character model again. It may seem hard to do sometimes, but this way you can get better results instead of trying to repair the original skin weights generated by the software. Lets do this by activating Replace paint mode with the Value of 1 for the waist! After you block it, also paint value 1 for spineA to all faces of the mesh that are above this joint. When you have the two white blocks, hold the weights of all other joints except spineA and waist. Now press 3 or 4 times the Flood button with the Smooth option selected. Look at what you should have: a nice smooth blending between these two joints while the other joints do not influence this area - they were held. Continue by holding the waist joint and unholding spineB, then block influences between spineA and spineB areas, lock and smooth. Repeat this process for all adjacent joints. (Fig.07) TIP (skinning) = You can rotate joints when painting to see if your weights are good. When you are finished, just reset their rotations to zero! Concentrate in painting the skin values for only one side of the character, as we can
Mirroring
Now, we can parent the clavicle joint to the spineC and then do the mirroring using (Animation >> Skeleton > Mirror Joint) . Look at the options for this command, we should search for l_ (left side) and replace for r_ (right side) while mirroring in YZ mirror across. Do the same for the l_leg_jnt parented to the waist. (Fig.06)
Skinning in Action
Now lets put these joints into action! Freeze the joints transformations, select your model and all of your joints except those named _end and apply the Smooth Bind Skin by going to (Animation >> Skin > Bind Skin > Smooth Bind). Go to the option box and mark these options: Bind to Selected joints, Max influences 3, Maintain Max Influences off. Maya will then create a default skinCluster with point weight values that we can refine using the artisan brush (Animation >> Skin > Edit Smooth Skin > Paint Skin Weights Tool). When you look the mesh with this tool activated, you will see that it is painted black, white and gray. Do not worry, it is all right. These colors are showing you the weights values for joints (black = 0, white = 1 and gray = values between 0 and 1). This means that: the whiter the region is, the more the currently selected joint will affect your mesh. With this tool, we can replace, add, scale or smooth influences for each deformer joint. The button Toggle Hold Weights on Selected can be used to lock the selected joint for modifications and the button Flood paints all
Skinning Theory
Ok, in a moment we will start the skinning process to actually drive our mesh using our created joints - but before that we need to understand what this is all about. We will be using the smooth bind command, it allows you to deform a mesh using one or more joints by creating a skinCluster deformer in your mesh. Smooth means that you can have more than one joint driving the position of a single point of your mesh. So the skin Cluster lets joints drive points in a mesh and for each point the rules for which the joint is to follow is completely open for us to edit (either by numeric values or painting the values directly in the mesh). TIP (Skinning) = Reset joint rotations before applying the skin Cluster. To do this preserving your joint hierarchy, select all joints and use
www.3dcreativemag.com
page 86
Secondary Deformations
If you want to get better deformations while animating your character, you should create secondary deformations as corrective blendshape targets to simulate muscles and interactive anatomy that will be automatically controlled. This technique is simple: just duplicate the original model and deform it to what you need, when you use it as a target then link its blendshape slider to a controller. We usually connect the rotation of a specific joint to values of the blend shape slider using Set Driven Keys (Animation >> Set Driven Key > Set...). Let us see an example. Look at the picture to get the idea: (Fig.08) Here we created an inflated biceps blendshape. This target is controlled by the lowElbow joints rotation Y value. We then use SDK to tell Maya: when the rotation Y of the joint is 0, the value of the slider of the blendshape is also 0. When the rotation Y of the joint is -30, the value of the blendshape will be 1. Simple, isnt it? TIP (secondary deformation) = Always think in volume preservation. You can use secondary deformations in any part of the character that you need. So try to do it for the main muscles of your character like elbows, knees, belly volume, etc. That is it for this lesson! Try to skin the joints in different positions to better understand how the smooth skinning works in order to get the best deformations possible! Also model and test a lot of targets for your character to learn this properly! These are valuable assets in any riggers workflow, remember that! :) Now that the entire joint hierarchy is created and the skin weights are nicely adjusted, in the next chapter we will see some rigging tricks to create IK/FK blending, reverse foot controls, forearm twist and create the actual controllers that the animators will use. See you then!
www.3dcreativemag.com
page 87
The aim of these tutorials is to show and explain how you might tackle rigging your 3D character for animation. These tutorials will give help and advice to novices and experts who are looking to build on their rigging skills or approach rigging for the first time. The series gives a detailed step by step guide as to how to approach rigging but also shows us how to tackle common problems and issues that regularly occur even in a professional environment. The artists will be reflecting on working in the industry as well as talking us through their individual approaches to creating the best rigs possible.
- Free Models
This download includes The Models Used Within This Tutorial
Introduction to Rigging Chapter 4: Rig Creation Part 2 Introduction to Rigging: 4 - Rig Creation - Part 2
Software used: Maya
Chapter Overview
In this chapter we will build the rig setups using the joints we created in our last lesson and add control curves for the animators to use (after all, no one likes to have to select the actual joints when animating - sometimes this will not even work and break the rig).
Controls
Now its time to set up controls to move the skeleton. We usually create CV curves as controls and modify the shapes by editing components to make them more intuitive for the animators (Fig.01). We should also add attributes to them in the ChannelBox panel (ChannelBox > Edit > Add Attribute) to get powerful results as we will see next (Fig.02). To zeroOut an object you just have to: - Create an empty group. - Translate and rotate the group to the same position and rotation of your object (you can do this by creating a parentConstraint to snap the group to the object and then delete the constraint). - When they are both on top of each other, TIP (zeroOut): Notice this is not the same as freezing the transform (that aligns the object to the world). Keep the zeroOut process in mind, as it is the key to easily creating correctly oriented controls and we will be using it a lot in this chapter. parent the object to the group. - Voil, your object now has zero values without freezing and without losing its orientation. Transformations). But notice that when you freeze a control curve, its orientations will jump back to the worlds axis. Thats a problem. Most of the time we dont want to lose the controls orientation. Thats where we use the zeroOut process.
zeroOut
When creating our controls we must make them clean and simple, which means all controls by default cannot have any transform value. We can nullify these values by freezing the transformations (Any Mode > Modify > Freeze
Master Control
This will be our global control for the character rig. You can use the default circle or create a CV curve shaped like a character, it is up to you. Name this curve Master_ctrl and add one attribute named EXTRAS as the only displayable label for our attributes. All the curve controls we will be creating must be in a group inside of the Master_ctrl so the entire rig will behave properly (Fig.03).
www.3dcreativemag.com
page 85
Introduction to Rigging
www.3dcreativemag.com
page 86
TIP (duplicate_IK/FK): Renaming is simple using the Search and Replace Names command (Any Mode > Modify > Search and Replace Names...). Try to use it (Fig.06)! Now lets constrain all the joints on these three hierarchies. Follow these steps for each joint of the chain we want to blend:
Remember to do this only once for each joint in the _jnt chain; this will make our _jnt chain follow both the _ik and the _fk chains though the orientConstraint. If you move the joints around you will see that they follow both chains equally. We will now create an attribute to control these influences. For all limbs we will add a float attribute called
Go to the Hypergraph panel (Any Mode > Window > Hypergraph), create a reverseNode (in Hypergraph > Rendering > Create Render Node > Utilities tab > Reverse) and connect the blend attribute from the Master_ctrl curve on its inputX. Now, connect the outputX attribute of the reverseNode on all of the (IK-W1) of the orientConstraints. Look at the image sequence for a better comprehension (Fig.07). TIP (direct connections): Directly connecting attributes can be a cleaner alternative to driven keys or expressions, as they evaluate real-time and do not create animation curves.
- First select a _fk joint. - Add its corresponding _ik joint to the selection. - Finish by adding the corresponding _jnt joint and applying an orientConstraint (Animation > Constrain > Orient).
(limb)_ikFkBlend (for example: l_arm_ ikFkBlend for the left arm), with min value 0 and max value 1 to the Master_ctrl curve. Connect this attribute on every (FK-W0) of the orientConstraints we just created (the constraint nodes should be right under the _jnt joints).
www.3dcreativemag.com
page 87
Introduction to Rigging
IK handles creation
This is an important step. If you skip this, your IK chains will be useless! Now that we have created the chains we can create our ikHandles (Animation > Skeleton > IK Handle Tool) to get the inverse kinematics behaviour from our joints. - For the arms, create a rotate plane (ikRPsolver as the current solver) for both sides starting in the l_shoulder_ik joint and ending on the l_wrist_ik joint. - For the legs, create the rotate plane ikHandles starting in the l_leg_ik joint and ending on the l_ankle_ik joint. - For the feet, create two single chain solvers (ikSCsolver). One starting in the l_ankle_jnt and ending on the l_foot_jnt and the other one starting at the l_foot_jnt and ending at the l_foot_end. Name them as l_foot_ikh and l_toe_ikh. - Do this on the left and right sides of the limbs and feet. - Group all the ikHandles in a single group named ikHandles_grp.
Clavicle Control
Since the clavicle doesnt need to have an Ik to Fk blending, just create a simple curve oriented like the joint, zeroOut and parentConstraint the clavicle_jnt to your control on both sides like so (Fig.08). To finish, just parent the zeroOut groups of both clavicles to the spineC_ctrl.
and driving the correspondent joint with a parentConstraint. There will be three controls (shoulder, elbow and wrist) that must be parented to the clavicle controller. As for the IK chain, create only a control for the wrist (aligned and oriented to the wrist joint) that will orientConstraint it; also pointContraint the corresponding ikHandle of the limb to the controller. ZeroOut the curve and parent it to the controls_grp (Fig.09). TIP (ik/FK_visibility): You can set drivenKeys on joints and control visibilities when switching between IK and FK mode.
Arms Controls
To drive these two newly created chains, create controls as you wish - use the same process as the head/neck controls using zeroOuts to pseudo-freeze your controls. For the FK chain, create a control for each joint (except for the elbow, that will have only one control as we skip the second joint), parented hierarchically
www.3dcreativemag.com
page 88
Fingers
The simplest way to rig fingers is to create a curve for each one of the joints. Align and orient, zeroOut them in a hierarchy (like the spine controls) and then parentConstraint the joint to the corresponding curve.
Legs Controls
Ok, now that the arms are complete, lets quickly create the legs controls. Its the same process except for the IK control - you might want to orient it to the world (with just a little bit offset on the Y axis to follow the foot angle) so that the translate Y of the controller is facing upwards. (Fig.12)
www.3dcreativemag.com
page 89
Introduction to Rigging
Reverse Foot
Sometimes we must think beyond the real anatomy because movements in real world are very complex and difficult to reproduce in 3D. That is why we must fake some processes: lets take a look at the Reverse Foot setup that is used to get good foot control. Create a hierarchy of four joints, then rename and dispose them on top of the original foot chain, as in Fig.13 (start by the Base joint and end with the Ankle joint). The idea is to create an inverted chain that will drive the bones in the reverse order. To make our foot joints follow this new chain; just pointConstraint the l_foot_ikh we created earlier to the l_footReverseHeel_jxt. Before going on, lets create a control to move the toe independently, only one curve for both IK/FK modes named l_toe_ctrl. Create and align it to the toe joint then zeroOut. Parent the group to the controls_grp and parentConstraint it to the l_footReverseTip_jxt so it is always following the foot. ParentConstraint the l_toe_ikh to this control and now both our feet ikHandles are being controled. - Connect the reversed blending attribute Group the reverse joints we just created as l_footReverse_grp - this will act as our hand. (reverse_l_leg.outputX) to the feet ikHandles ikBlend attributes (l_foot_ikh.ikBlend only! ParentConstraint it to both the FK and IK foot controls, do not forget to also make the blending connections to switch who is driving the group accordingly. While youre at it, notice that the foot FK motion is still not completely right. To fix it, just follow these two steps for both feet:
www.3dcreativemag.com
page 90
Leave l_toe_ikh.ikBlend always as 1). - Now remember the ikHandles_grp? Group the scattered l_foot_ikh, l_toe_ikh and l_leg_ikh ikHandles into a group called l_foot_ ikh_grp and parentConstraint it to follow its corresponding reverse foot group - in this case, l_footReverse_grp. If you followed these steps correctly, when you rotate the reversed chain, the heel now raises without losing ground contact!
IK Twisting Controls
Now that we have created all of our IK controls, lets add an attribute to control the limbs orientations: the twist attribute. This little fellow will play the part of our polevector. As an attribute, there are less controls floating around and since it works in angles, not in translation aiming like the polevector,, it is much more intuitive and clean to animate. Ok, so create a float attribute on each arm and leg IK control, and make a direct connection to the twist attribute of their respective ikHandles. To finish, select those four ikHandles and in the channelBox, set their polevector X, Y and Z values to zero - this will free the movement, reducing the flipping effect to almost none.
following the rig. We will see this is the next lesson! For now, you can group these and parentConstraint to the head joint. Phew! We have come to the end of this extensive lesson and now you can almost say your character is fully rigged and ready to be animated! Now, how about giving him more emotion through facial expressions? Thats what we are going to study in our next lesson. Until then, practice what you have learned in this lesson - how about trying to come up with a solution for an automatic clavicle setup using Constraints, Expressions and Set Driven Keys!
Wrapping Up
To finish our entire rig, group the root_jnt, l_footReverse_grp and r_footReverse_grp as joints_grp and parent this group and the ikHandles_grp to the Master_ctrl. You can hide these two groups, leaving only the geometry and the controls visible - and now our setup is also scalable! You will notice the eyes and teeth are still not
- Free Models
This download includes The Models Used Within This Tutorial
www.3dcreativemag.com
page 91
The aim of these tutorials is to show and explain how you might tackle rigging your 3D character for animation. These tutorials will give help and advice to novices and experts who are looking to build on their rigging skills or approach rigging for the first time. The series gives a detailed step by step guide as to how to approach rigging but also shows us how to tackle common problems and issues that regularly occur even in a professional environment. The artists will be reflecting on working in the industry as well as talking us through their individual approaches to creating the best rigs possible.
- Free Models
This download includes The Models Used Within This Tutorial
Chapter Overview
In this chapter, we will learn how to build a simple yet powerful facial rig. We will explain how to do facial expressions using blending shapes and get more advanced results using joints for local deformations of the face. It is easy and fun (Fig.01).
Blendshape theory
Sometimes deforming meshes by just painting influences can be tiring and time consuming. Instead we can model the desired deformation and then apply it to our mesh using the blendShape deformer. By duplicating our model and deforming it using any modeling tool, we have the ability to make these deformations show up whenever we want by applying them as blendShape targets. To create a blendShape deformer, select two meshes that have the same topology (same number and order of points - do this by duplicating the geometry), edit the copy as desired and then select it and the original model (in this order) and go to (Animation > Create Deformers > Blend Shape). You will get a blendShape deformer with an attribute that does the transition from one geometry to another; you decide how much influence to use in the channelBox. This works pretty much the same as joint skinning. Each point has a starting position (the default mesh) and an end position that is weighted by an envelope multiplier. You can even create exaggerated deformations or input negative values if you need, just take care not to overuse this feature and get ugly deformations. The blendShape technique is widely used for facial rigging for its speed and for when it would
www.3dcreativemag.com
page 87
Introduction to Rigging
Wrapping up
The process of creating blendShapes can be made parallel with the body rigging and then brought together at this point. Our next step is to associate the modeled targets to the rigged model. Lets do this by selecting all blend shape targets and lastly select the rigged model geometry (ett_body_geo) and apply the blendShape deformer using the command (Animation > Create Deformers > Blend Shape), we usually use it with Check Topology turned off and in the Advanced configuration tab of the deformer, use Front of Chain as the Deformation Order.
www.3dcreativemag.com
page 88
www.3dcreativemag.com
page 89
Introduction to Rigging
Facial Joints
If you need more control over a specific facial area of your character you can create joints to do this. Start by creating a single joint at the origin of the scene (Animation > Skeleton > Joint Tool); you can do this by holding the X key to snap on the grid, clicking at the center and pressing Enter. Create a nurbs curve to be the control of this joint and scaleConstraint and parentConstraint the joint to it. Group the control and move it to the desired position on the face snapping to points holding the V key of the keyboard. Repeat these steps for additional joints and do not forget to name them properly (Fig.09). To make the controls follow the head lets group these control groups and parentConstraint them to the head joint, jaw joint or another part to the facial rig. Remember to put this group under controls_grp to keep our scene clean and organized. Do the same to the joints we just created, group them and parent under joints_grp. Now, to deform the face with these new joints we need to add them as an influence of the skinned geometry mesh. So, select all the facial joints and the character model (face) and add the influences (Animation > Skin > Edit Smooth Skin > Add Influence). You can now paint the skin influences of the facial joints using (Animation > Skin > Edit Smooth Skin > Paint Skin Weights tool) and getting the values from the head and jaw joints (Fig.10). on the chin joint. Skin these joints to the tongue geometry and create nurbs curves shapes parented to the chin_ctrl to control these joints. It is really simple (Fig.11).
Teeth
The rigging of teeth is just geometries in groups that will receive parentConstraints by curves following the head_ctrl (for the upTooth) and to the chin_ctrl (for lowTooth).
Tongue
You can rig a simple tongue by creating three joints and parenting them
www.3dcreativemag.com
page 90
Eyes
Animators prefer eyes that aim towards a look at control for characters. So what we do is create two circles, one in front of each eye, and create another one as a father of these so we can move the two eyes together. After that, we just create aimConstraints selecting the eye controls and lastly the eye geometry group and choosing the command (Animation Mode >> Constrain > Aim).
Lets create two layers to further organize things: One for the characters geometry called ett_L_geo - you can put this layer in reference mode so the animators do not accidentally select the mesh; And another one for the character controls called ett_L_ctrl - you can put the entire controls_grp in this layer. If you followed our organization correctly, just
back to where you still understand what you are doing and continue. This is the key to learning while having fun and without frustrations. We hope you liked these lessons and got motivated to study even more! See you in the next chapter, where we will take a look into scripting - something every hardcore rigger should know to help speed and efficiency in any kind of production.
Finally, the last thing to do is to group the eye_ctrl named as eye_ctrl_grp and parent it to the head_ctrl. Please remember the eye geometries must be in a group that is parentContrained and scaleConstrained to the head_ctrl (Fig.12).
hide the joints_grp to make all the joints unreachable. It is simple as that.
Conclusion
All right! We pretty much reached the end of the rigging part of our series as the next chapter will only cover scripting, so make sure to leave nothing behind! Remember to always keep things simple and organized. Build up your understanding of the basics and try to come up with more complex solutions little by little. If you get mixed up, go
Wrapping up
We have come to the end of our rig. Everything is working nicely and now we just have to hide some things from the animators to avoid them moving and keyframing what they are not supposed to.
- Free Models
This download includes The Models Used Within This Tutorial
www.3dcreativemag.com
page 91
The aim of these tutorials is to show and explain how you might tackle rigging your 3D character for animation. These tutorials will give help and advice to novices and experts who are looking to build on their rigging skills or approach rigging for the first time. The series gives a detailed step by step guide as to how to approach rigging but also shows us how to tackle common problems and issues that regularly occur even in a professional environment. The artists will be reflecting on working in the industry as well as talking us through their individual approaches to creating the best rigs possible.
Chapter Overview
In this last chapter we will look at scripting for Maya. Even if you are an animator or modeler, knowing a little about scripting can help you in ways you could never imagine! We can identify the best cases for using scripting by analyzing when you repeat certain tasks, like keyframing sets of controllers or duplicating meshes for symmetry modeling. In rigging this can also be used, but in larger scales. Good examples are the automation of the creation of rigs that are always set up in the same manner, like a reverse foot or when you need to constrain a large quantity of objects while maintaining a certain set of rules.
Variables
To help us make things dynamic, the variables exist. Variables store information that we can use in programming and as the name says, their value can vary. Lets create and use a variable to better understand the concept:
Scripting Theory
To start understanding how scripting works in Maya, you can think about it this way: Everything you do in Maya by clicking with your mouse is actually a shortcut to a command. That command is logged into the script editor window where you can see it, copy and most of the times run it again, changing parameters (we call them flags) if needed.
www.3dcreativemag.com
page 69
Chapter 6: Scripting
just do not forget to use the dollar sign ($) at the start of its name! For example: $myName, $numberOfJoints, $currentFrame, etc... (Fig.03) 3. Finally the float variables, that are also used only for numbers, but contain only fractional numbers like 1.0, 3.96, -560.34 and so on. TIP (casting variables) = You can force some variables to show as another type by casting. You do this by writing the wanted data type name and then enclosing a variable or value in parenthesis right after that. Try writing print (int(4.5)); in the script editor.
Introduction to Rigging
create an integer array, you cannot populate it with a string or a float number. To store and access data to the array you work with an index identifier, pretty much like an unique number in a queue; the order the elements that are being stored in the array is the order you will call it later (please remember that array indexes always starts at zero!). Do not worry about this now, things will get clear when we put it into practice. To create an array, just put a pair of square brackets after the data type. For example: string $names[], int $numbers[], float $decimals[], etc. To populate arrays use a pair of braces encapsulating your data and separate them with commas, like so: string $names[] = {Julie, Florence, Yuki}; int $numbers[] = {1, -2, 4, -8}, float $decimals[] = {1.34, 5.0005, -0.4498}, etc.
Arrays
Sometimes we need to deal with a large amount of data and using lots of variables can be troublesome. For these cases there is a different variable type with the ability to easily organize, access and manipulate data. They are called arrays. A single array can contain multiple strings, integers, vectors, you name it - but only one type of data at a time. That means if you
Loops
Now that you know the basics about variables and arrays, lets take a look at loops. Loops, as the name suggests, are used to repeatedly execute a piece of code several times. Combine this with the power of an array and you will get yourself a new best friend! For a simple introduction, lets execute this for loop, like so: int $numberArray[] = {1,2,3,4,5}; for ($i in $numberArray) { print $i; }; You will get the following result: 12345. Simple, right? You must be wondering about that $i variable over there... its simply our index variable. You can name it as you wish and you dont need to declare it before entering the loop (unless you want to keep track of its last value). So, every time the code between the braces finish it goes back to the top, gets the next data value in queue and repeats all over
www.3dcreativemag.com
page 70
Conditionals
Ok, so far we can work on really simple and repetitive scripts. But what if you need something more complex like adding some choice-making to them? Meet the conditionals. Conditionals allow your code to choose how to act based on any rule you write - better than that, they prevent your scripts from breaking or even your software from crashing, just by checking if certain conditions are met. If not, you can make the action cease and display an error message or even continue through another route. For instance: string $selectedObjects[] = `ls -sl`; if (`objectType $selectedObjects[0]` == joint ){ print You have selected a joint! As a prize, you win a polyCube!\n; polyCube; } else { print There is no joint selected! Bad, bad user!\n; } Now take a look at this other kind of conditional which can be very useful: TIP (capturing return values) = Notice the grave accent (`) symbols surrounding the ls command of the first conditional example. In MEL they are used to indicate that you want to get and use the return value(s) of that command. In other words, every object name that is listed using the ls -sl command will be automatically put inside the $selectedObjects When run, this code creates five spheres on top of each other. The while conditional also works as a loop - in this case, the conditional worked as a counter since at the end of every iteration, it was checking to see if the statement was still true. When its not true anymore, the loop stops running. }; int $numberOfSpheres = 5; int $i = 0; while ($i < $numberOfSpheres){ sphere; $i++; NOTE: Its important that you declare the variable that will capture the return value(s) as the right data type, otherwise you may get a data type error. Check the Maya Commands reference to see the expected return type for each function. array that we can use later in a loop, for instance.
Procedures
When your script starts to get bigger, it also starts to get troublesome to edit variables whenever you need to debug it. Using procedures we can run several lines of code using a single command, easily feeding data to it at the same time. Some more features were added to our last script, take a look at the procedure below:
www.3dcreativemag.com
page 71
Chapter 6: Scripting
proc createSpheres(string $sphereName, int $numberOfSpheres, float $positionOffset){ int $i = 0; while ($i < $numberOfSpheres){ sphere -name ($sphereName + ($i+1) ); setAttr .translateX ($positionOffset*$i); $i++; }; }; After running the code above, nothing will happen. That is because we only declared the createSphere command. Lets run it by typing: createSpheres(ball, 5, 3); You will notice five spheres with the name ball were created separated by the same amount of units we wrote as the $positionOffset value. Much easier, right? Its like creating your own commands and defining your own flags (Fig.05). NOTE: In the rest of the chapter we will look at a couple of scripts and try to explain how they work as much as possible. Until now we have only seen the tools you can use to accomplish certain tasks. But like in real life you can use tools the way you want to build anything and most of the times there is not only one way to do things. So keep in mind you can (and must) change whatever you see fit in the code in order to experiment and understand. Remember! Your best friend in any situation is the Maya Commands Help documents, accessible by pressing F1 inside Maya. If you get stuck in a tricky part, try searching for similar scripts on the internet and learn by looking at other peoples code. Now lets create our zeroOut group - since we cannot set its position and orientation at creation, lets just give it a name. The same as the object, but with a suffix: string $zeroOutGroup = `group -name ($selectedObjects[0] + _grp)`; The only way to get the selected object in Maya is by using the ls -sl command, so lets use it! Since it returns an array, we should capture the results as so: string $selectedObjects[] = `ls -sl`; Lets see this line by line. } TIP (comments) = You can comment lines in your script so it is easier to organize and debug; just add two slash (//) symbols at the beginning proc zeroOut(){ //get the object //create the group and name it //snap the groups position to the object //parent the object to the group creating our procedure with pseudo-code, so that we have a good guideline to follow:
Introduction to Rigging
string $selectedObjects[] = `ls -sl`; string $zeroOutGroup = `group -empty -name ($selectedObjects[0] + _grp)`; string $constraint[] = `parentConstraint $selectedObjects[0] $zeroOutGroup`; delete $constraint; parent $selectedObjects[0] $zeroOutGroup; } Ta-daaa! To test it, select any object and type zeroOut at the command line!
of a commented line. To comment multiple lines, use a slash with an asterisk (/*) to start the comment and an asterisk with a slash to end the comment (*/).
With our group created, we need to snap the position and orientation of the group to be the same as the object. The easiest way is to parentConstraint it (then get rid of the constraint): string $constraint = `parentConstraint $selectedObjects[0] $zeroOutGroup`; delete $constraint; And now, for the finishing touch: parent $selectedObjects[0] $zeroOutGroup; Put it all together in order and you should get: proc zeroOut(){
for ($side in $mirror) { for ($jntName in $jointNames) { for ($hier in $hierarchy) { string $control[] = `circle -ch off -r 0.4 -nr 1 0 0 -d 1 -name ($side+$jntName+$hier+_ ctrl)`; parentConstraint -name tempToDelete ($side+$jntName+$hier+_jnt) $control[0]; delete tempToDelete; select -r $control[0]; zeroOut(); // call zeroOut procedure // control joints by control curves: parentConstraint $control[0] ($side+$jntName+$hier+_jnt);
www.3dcreativemag.com
page 72
The End
In the next chapt.. wait a minute. This is the end of the Maya Introduction to Rigging Series! Well, we hope that you enjoyed it and learned a lot, because we sure did! Our concern was to create good lessons (not too simple and not too complex) that could get anyone started on rigging: a fun and rewarding experience!
www.3dcreativemag.com
page 73