Deformation Layering in Maya’s Parallel GPU World

What is Deformation Layering?

Deformation layering is an old technique; in fact, I was taught how to do it on my first job in the industry, but didn’t truly internalize it for a long time. Taking two identical meshes, you design the deformation such that one deformer’s output is passed downstream to a second deformer, which then deforms the modified points of the first. In most cases this means making two meshes with two separate deformers, then using a blendShape to blend the output of one deformer onto the input of the other. (More advanced users will immediately recognize that they could skip the blendShape node, opting instead for a source_meshShape.outMesh -> target_meshShapeOrig.inMesh connection, but as we’ll see neither technqiue will not work for our use case.) This is different than using a blendShape node to blend deformations all at once— the intent here is for the deformations to change the mesh sequentially, not in parallel.

Figure 1a: lid upper weights
Figure 1b: lid lower weights
Figure 1c: eye blink (animated)
Figure 2a: eye mover weights
Figure 2b: eye mover gif
Figure 3: the complete effect of two layers working in serial.
Figure 3a: GPU point count before connection
Figure 3b: outMesh -> inMesh connection
Figure 3c: GPU point count after connection

Your Best Friend, the Profiler

Sorry, what’s that? You haven’t used the Profiler? Why, then you haven’t lived, my friend! In the Parallel Evaluation / GPU Override utopia of the future, the Profiler is your spirit guide. There are a many changes you can make to a rig today that, while speeding up things in the old DG world, can slow you down now. If you change your rig, profile. Profile the same animation, and let it run a long time if you can (set the buffer to higher than 20mb). Check your average timings. Look at how your setup stacks together with a single animated character, then with two. You’ll be surprised, I bet, that not everything is working as you believe it should.

Figure 4: profile of disconnected, skinned meshes
Figure 5: profile of outMesh-connected graph

How Do We Fix This?

The best solution I’ve found so far is to chain skins. It’s conceptually simple: instead of having skins that feed one another using blendShapes or nodal connections, you use the deformer command to add new skins to the current mesh, one literally after the other, then copy weights and influences over.

Figure 6: profile of stacked skins
Figure 7: profile of LAYER_0 skin node

Extensions to the Technique

I haven’t provided an example, but layers past LAYER_0 may need to have bindPreMatrix connections into the skinClusters if you want to have the driving joints move with the rig. This is a simple addition the above script. In my current facial setup I have three layers (0, 1, and 2), and all joints on the last two layers have bindPreMatrix connections.

Now Go Rig Something

I hope this helps you move your rigs into Maya 2017 and beyond, and to really squeeze the most performance out of the tools at hand. Remember to check the script in the Github repo, and send me a pull request if you come up with something better.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store