# basics

## Rigging in Maya – Main concepts

Rigging in maya tends to be a very straight forward and no bullshit process, so getting a grasp of the fundamentals will pretty much be enough to let you build your knowledge further by experimenting with different approaches and techniques. Therefore, in this post I’ll describe all the essential building blocks of a rig.

Disclaimer: This post is going to be a continuous work in progress, as I will keep adding rigging concepts as we go.

#### Nodes

Now, even though the dependency graph is not an essential knowledge for a beginner rigger who just wants to build rigs, it is absolutely crucial for grasping the fundamentals of how rigging in maya works. As such, it is vital for understanding the following points of this article.

In a most broad aspect the dependency graph is the place where the scene is described in terms of it’s building blocks – nodes. A node is essentially similar to the concept of a function or method in traditional programming. If you are not into programming, then you can think of a node as a sort of a calculator, which takes in some data in the form of an input, modifies it and it returns the output data. Nodes seem to be used in a lot of the major packages in the 3D industry – Maya, Houdini, Nuke, Cinema 4D, etc., so it is a concept which is useful to understand.

Every object in a maya scene is described by one or more nodes. And when I say object I do not only mean geometries, but also locators, cameras, deformers, modeling history (polyExtrude commands, polyMerge, etc.) and a lot of other stuff we don’t need to worry about. If you are curious about everything that’s going on in a scene, you can uncheck the Show DAG objects only checkbox in the outliner.

A simple example is a piece of geometry. You would expect that it would be described by one node containing all the information, but there actually are two. One is a transform node, which contains all the transformation data of the object – translations, rotations and scale (world transformations). The other is the shape node, which contains all the vertex data to build the actual geometry (local transformations), but we don’t need to worry about this one just yet.

A very cool thing about nodes is that we can actually create our own. The Maya API allows us to write custom nodes in Python and C++.

Further reading: Autodesk User Guide: Node types

#### Joints

In a non-technical aspect a joint is incredibly similar to a bone of a skeleton. A number of them are chained together in order to create limbs, spines, tails, etc., which in turn together form exactly that, a skeleton. These joints then are told to influence the body of a character or any other object and that’s how you get a very basic rig.

In a more technical approach to describe a joint, we can start off by saying it is a transform node. Therefore it has all the usual attributes – translation, rotation, scale, etc., but there also are some new ones like joint orientation and segmentScaleCompensate.

The segmentScaleCompensate essentially prevents the children joints in the hierarchy from inheriting the scale of the parent joints. And it is generally something we don’t need to think about at all, if you are not rigging for games. If you are, you will need to turn this off and work around it in your rigs.

The joint orientation on the other hand, is absolutely crucial for rigging. It is such an extensive subject that I am considering writing a whole post just about it. Here is a good post on the topic. Describing it briefly, joint orientation describes the way the joint is going to rotate. That is the reason it is called orientation (I think), because in a sense it shows us which way is forward, which is up and which is to the side.

So to summarize, a joint is a transform node with extra attributes, used to create hierarchies (joint chains) which in turn form a skeleton, used to drive the deformations of a piece of geometry.

#### Skinning

In non-technical terms skinning is like creating a sock puppet. You stick your arm (the joint chain) inside the sock (the geometry) and by moving your hand and fingers the sock is being deformed as well.

In a more technical manner, skinning is the process of binding a geometry to a joint chain. In maya nodes terms, this action is described by a skinCluster node. Essentially, when skinning a piece of geo, maya calculates all the vertex positions of the mesh relative to the joint they are influenced by and stores that data in the skinCluster. Then when the joint is transformed in any way – moved, rotated or scaled, the vertices of the mesh follow that transformation, by applying their relative positions on top of the transformed positions of the joint.

#### Other deformers

A skinCluster is what maya calls a deformer. It makes quite a lot of sense if you think about it as a skinCluster does exactly that – it deforms the geometry using the joints. Now, there are other deformers as well and even though they work in many different ways, essentially what they do is, they take a version of the geometry as an input (they can take as input the output of other deformers which allows us to chain deformations), deforms it and outputs the new deformed points into the shape node. Some good simple examples are the nonlinear deformers.

Just like with nodes (deformers are essentially nodes themselves) we can write our own custom ones, which is very useful. For example I have written a collision deformer which makes geometries collide and prevents intersections.

#### Weight painting

Remember how in the skinning section I said “maya calculates all the vertex positions of the mesh relative to the joint they are influenced by“? Well how does maya know which joint a vertex is influenced by? You see, each component of the geometry can be associated with one or more joints. On creating the skinCluster maya will assign some joints to the components, but more often than not you won’t be satisfied with that assignment. Therefore, you need to tell maya which joints should be driving a specific component. The way you do that is by a process called weight painting.

When we say weight, we basically mean amount of influence.

It is called painting, because by doing so, we are creating weight maps for each joint. As with many other aspects of CGI, these maps range from 0 to 1 although we can choose to go above and below if we want to, but I wouldn’t advise doing so, just because it’s much harder to keep control of your weights this way. So a value of 0 means that this specific region of the geometry will not be deformed at all, by the current joint. Obviously then, 1 would mean that the region will be deformed entirely by the current joint. Values in between mean that the joint will influence the component some but not entirely. It’s important to note that any component needs to have a total weight of 1 (again if we are chosen to work with normalized weights, but as I said this is the suggested approach), therefore if you lower the influence of one joint over a specific component, another or a combination of multiple other ones will receive that remaining influence.

Additionally, all deformers can have their weights painted. SkinClusters seem to be the most complex ones to paint because they have multiple influences, but generally with most other deformers – nonlinears, blendShapes, deltaMush, etc. – there is a single weight per vertex describing how much influence the deformer has over that specific vertex.

Some very useful features of weights are that they can be mirrored and copied. Additionally, they can be stored and loaded at a later point, though maya’s native options for doing that have been very very limited, but this article gives some good tips about it.

## What is rigging?

As simply put rigging is the process of giving a computer generated asset the ability to move. Whenever a person not in our industry asks me what do I do I generally start with this. Then of course, you can go on to imitate puppets and puppeteers with your hands.

Now not so simply put, rigging is the process of building a system to be used by an animator to deform a CG asset in a very specific manner. This deformation takes place on multiple layers, providing all the needed controls for hitting shapes and poses designed in the pre-production stage.

Okay, let’s deconstruct this.

When I say “deform a CG asset” I mean the ability to translate, rotate, scale or make it squash, stretch, bend, etc. Generally the base of a character rig is it’s bone structure which allows for moving the limbs and body in a way similar to how we move in the real world. That is why researching and studying anatomy is very important for riggers who want to improve.

The piece about the “very specific manner” is in regards to being able to build different types of FK or IK chains, IK/FK blends, blendshapes, etc. The keyword here is specific, because every aspect of a rig needs to come from a need. Every choice in the process of rigging is to always be bound by a good reason for achieving a specific result. Otherwise, we are shooting in the dark trying to hit a moving target. Therefore, it is very important for a production team to be able to communicate exactly what they expect and want to get in the end. Because, if we add a module to a rig “just in case” we are bloating the rig, and please let’s not bloat our rigs.

The “multiply layers” bit refers to the ability of deforming objects in different, but again very specific ways, and then sequencing them in a chain to produce the final result. The face is the classical example of this, where in most rigs people tend to use a combination of a few local rigs – rigs built to deform only in local space and then add them via a blendshape to the world space rig.

Then “providing all the needed controls” is again crucial for keeping the rig as light and clear as you possibly can. In our day to day lives we are very much used to clutter everything we interact with – bedrooms, kitchens, your home folder, etc. But again, when rigging an asset we should be thinking as minimalists. Which is to say, only add controls or functions if they are going to add value to the rig. Also, it is very important to make sure the shapes of the control objects makes sense, so the animators can now instantly what they are about to pick.

And lastly, the part about “hitting the shapes and poses”. Now there are a couple of metrics that describe how good or bad a rig is. Ones that I have mentioned above are functionality, performance and clarity. But in the end of the day, rigging is just a part of the animation pipeline. Therefore, as always we need to have a clear reference point to keep us on the right track. Take a look at modelers and animators, they always have their reference opened up on the side to help them stay consistent. Why would rigging be any different? We should not be thinking that we can rigs that are absolutely perfect for our purposes, without having a clear idea of what those purposes are.

Therefore, making sure that we can get the shapes and expressions that we have received in the character sheets or animatic, or even our own sketches in a more casual production, is not only making it easier for the animator, but it is making it possible to realize the initial concept.