Saturday, 3 July 2021

Reverse-Engineering Rigs

You should take any opportunity you can to learn from more experienced riggers. There are many character rigs available on places like Gumroad, Gumroad, and even Gumroad if you can believe that!
I learned a crap-tonne by pulling these rigs apart and learning how they accomplished certain effects. How there are multiple ways to do just about anything.
Reverse-engineering rigs is a super vital skill. Like, you need to know how to do it. Not just for learning from downloaded rigs, but when your own rigs bug out (and they will) you use the same reverse-engineering skills to isolate the problem before fixing it.

But there are many ways for riggers to hide their tracks, either intentionally or just as a side effect of keeping the rig clean for animators. Even if not, there some key places to look to find vital information quickly when understanding how a rig system works, and what might be going wrong when diagnosing problems.
Here are some tricks you should know about.

Inputs in the channel box


A quick and dirty way to check what kinds of deformers are acting upon an object: you can take a look at the inputs section of the channel box. Be warned, that this isn't necessarily an accurate list of all the deformers acting on that object, since whether or not the deformer shows up in that list depends on how it's hooked up in the node network.
But still the channel box can be a useful tool. For instance, if you want to know where a certain effect is coming from, you can move the character in such a way that triggers that effect, and then go through those deformers and dial down their Envelope attributes until you isolate where the effect is coming from.


Exposing hidden attributes in the node editor

Nodes usually come in by default collapsed, so you can see connections going in and out, but not which attribute the connections are going to/from.
You can cycle between the different levels of attribute exposure with these buttons in the node editor, which are also mapped to the 1, 2, and 3 keys.
1 collapses the node completely,
2 exposes attributes with connections,
and 3 exposes all attributes... except not really...
... to really properly truly show all the attributes of a node you have to right click-hold on it and click 'Show All Attributes'.

 
Quite why they couldn't have just mapped this to the 4 key is a question for people who don't work at Autodesk, apparently. 


Exposing hidden shape nodes in the node editor

When graphing all incoming and outgoing connections of a node - especially when tracing deformer influences - you might sometimes get the feeling the node editor isn't showing you everything.
Maybe it's not.
When deformer stacks are involved, an object can have quite a few iterations of shape nodes, and by default Maya might not show them all to you. But sometimes we need this information to make sense node networks. So in this case, in the node editor, go Display> and tick All Shapes.



Hidden attributes in the channel box

It's good form for a rigger to lock and hide attributes that the animator isn't supposed to be messing with. All it takes a single misplaced keystroke to access a control's parent group rather than the control itself, and you do not want animators keying that. No sir.
But that does make it difficult for the people of the future like you to see from the channel box if an object has incoming connections into those attributes.

But beyond the usual transform attributes, unhiding attributes can be a pain of you don't know what you're looking for. That's why riggers rely so heavily on the node editor. Hidden attributes will still show up there.
But if you do want to unhide and attribute, you can do so in the channel box in edit>channel control



Unhiding shapes in the Outliner

Has this ever happened to you? There's an object of some kind, perhaps a locator, that for some reason you can't see in the viewport. You confirm that it isn't hidden, so why can't you see it?
Well remember that most objects that are both visible and transformable are actually two nodes. A transform node, and a shape node beneath it. And by default the shape nodes don't appear in the outliner.
You can expose them in the outliner by going Display> and ticking Shapes.


And lo, often the shape node was what was hidden. Why would anyone do that? Well often you want to hide an object without also hiding its children. But those children are not children of the shape node, they're children of the transform node and siblings to the shape node. So hiding the object's shape doesn't trickle down to its children.

 

Unhiding joints' shapes

Joints are craftier still! Joints don't have shape nodes, so you might be especially perplexed when they don't show in the viewport despite their visibility being turned on.
Joints have a unique attribute to make up for their lack of distinct shape node. In the attribute editor, under the Joint section is the attribute Draw Style. Setting this to None will cause the joint not to render in the viewport.


Sometimes, either to better hide their tracks, or more likely just to minimise the risk of animators accidentally unhiding a joint and keying it, a rigger might sweep through the entire rig and switch the draw styles of every single joint to None. And so unhiding them all one at a time would suck. Better to script it. Try this python script:


import maya.cmds as cmds

# Get all joints in scene
allJoints = cmds.ls(type='joint')

for jnt in allJoints:

    # Make sure draw style attribute is unlocked
    cmds.setAttr(jnt+'.drawStyle', lock=False)

    # Set draw style to 'Bone'
     cmds.setAttr(jnt+'.drawStyle', 0)

 

Increasing the node editor's draw limit

Node networks can get coooooomplicated. And when you graph a node's inputs and outputs, Maya isn't always smart enough to know the extent of what should be included of the node network it dumps onto the screen for you. Sometimes the simple request to see the network influencing a given node includes so many nodes that the node editor will bump up against Maya's connection scan limit.
It's set to a few hundred by default, but with a little scripting, you can increase that limit to whatever you want.
Be warned, this limit exists so the interface doesn't experience slow down, so be prepared for said slow down if you decide to increase this limit. Of course, you can escape that slowdown at any time by simply closing the node editor.

There's no way to tweak this limit in Maya's UI (Autodesk does not trust you...) but this MEL script will help you out:

optionVar -iv "editorConnectionScanLimit" #####;

where '#####' is whatever number you want to set the limit to.


Straightening the connection paths in the node editor


With So much going on in a node network, it's tricky to follow a connection sometimes... a lot of the time.
This might just be personal preference, but I find it helps.
You have a few options for the visual appearance of the connections. In the node editor, under Display>Connection Style> there are four options, and I find Straight makes things easier, because the line gives you the direction to follow with your eyes in order to find the next node in sequence.


While we're on the subject, you can turn off the grid pattern in the background if that's just making things more cluttered:
Display>Grid


No comments:

Post a Comment