Ok, totally forgot about this trick. If you have lots of unused (aka junk) nodes in your hypershade, just hold a right click on for example an empty area in the Materials tab, and select ‘Edit > Delete Unused Nodes’.
Ok, totally forgot about this trick. If you have lots of unused (aka junk) nodes in your hypershade, just hold a right click on for example an empty area in the Materials tab, and select ‘Edit > Delete Unused Nodes’.
Not sure if this is the only way to do it, but it’s a quick little hack that works a treat:
Select attribute you want to reorder by clicking on it in the channel box. In the channel box menu, goto edit > delete attributes. Now hit ctrl+z (undo). The attribute is undeleted and added at the bottom of the channel box list.
To add an inbetween key in the graph editor which doesn’t affect the shape of the existing curve, don’t use the ‘+’ icon.
Hold down ‘i’ with your curve selected, and middle click where you want to insert the key.
There are some locked nodes on our rigs (which is good usually, to stop accidental alterations especially within a team)… but occasionally I have to unlock them temporarily to futz with them.
I’ve finally made a simple shelf button to use the lockNode command with a selected object. Posting here in case anyone finds it useful too:
//to lock a node
lockNode -lock(on) `ls -sl`;
// to unlock a node
lockNode -lock(off) `ls -sl`;
The ` is actually NOT a single quotation; it’s the little diddy thing next to your ‘1’ key on the keyboard. `ls -sl` is a typical way to refer to ‘all selected objects’.
You can do handy things like ‘apply this line of code to all selected objects’, and if you need to step through the objects one at a time you do this:
string $items[] = `ls -sl`;
for ($x in $items)
{
lockNode -lock(off) $x;
}
Note that the above isn't necessary for the lock command (as the one liners earlier work too), just an example :)
This is a beginner’s tutorial on finding a command you need in the MEL Command Reference, and running it in the script editor. I’ll use deleting a namespace as an example, as it’s something I had to do recently.
Some background: I have shelf buttons which let me select a set of objects at once (eg: all of the character’s animation controls), and these all expect that the objects will be prefixed with “C_Nell_REF:”. The prefix gets added automatically when I reference the Nell character file (C_Nell_REF.ma) into the shot scene, where the animation gets done.
This works great, until I removed the reference, and referenced a file with the same name back in (not a workflow I’m advocating; you should use ‘replace reference’ but I did this without thinking and it wasn’t undoable). Maya did an annoying thing and left the first namespace there (but empty). My new character had the prefix C_Nell_REF1:, because C_Nell_REF was already taken. None of my shelf buttons worked anymore, grrr.
So how to remove the empty namespace then?
If you look up ‘namespace’ under Help > MEL Command Reference, you’ll see something like this:
namespace [-addNamespace string] [-exists string] [-force] [-moveNamespace string string] [-parent string] [-recurse] [-relativeNames boolean] [-removeNamespace string] [-rename string string] [-setNamespace string] [string]
The [square brackets] denote that something is an option. Words preceded by ‘-’ are called flags; describers of what the following italic item is for. Things in italics are info that you need to provide.
So to remove the C_Nell_REF namespace, the script line looks like this:
namespace -removeNamespace “C_Nell_REF”;
(Note: the namespace you’re trying to delete does need to be empty first - you might need to select all items with the prefix “C_Nell_REF:”, and hit delete).
Easy, huh? Enter that into the script editor, press ctrl+a (to select all the code), and hit numerical enter (that’s the vertical enter key on the right of your keyboard - it runs any code that is selected).
The final step after successful namespace removal was to go File > Reference Editor > C_Nell_REF, and change the namespace from C_Nell_REF1 to C_Nell_REF.