You
have a single character rig that you will be referencing into a scene multiple
times. This character rig has a GUI that works well on its own, but once it’s
imported or referenced into a scene the namespacing breaks it. You will need to
animate the character multiple times in the scene, so you must find a way to
make the char GUI namespace friendly.
Anyone
who has encountered this issue may know two possible solutions. You predict the
namespace of the characters and build a character GUI for each of them or you
build one character GUI that would work with all the characters. For
example; the GUI would query all the characters in the scene and put them in a
drop down menu for the animator to choose from).
Now with
containers, you have a third solution. You can script one GUI and use it as
often as you want. This way you can have one GUI for each character in the scene, that you
can build quickly, regardless of namespaces or how many times the character is in the scene.
For this, you will need to place your character rig in a container. The default container has a string attribute called RMB Command; this is a global procedure that gets called by clicking the RMB button over the container object. The character GUI will be written in a global procedure and save to your default script path, scripting it only once. Your GUI will need to take into account namespaces, but with this simple mel:
string
$curContainer = `container -q -findContainer $object`;
string $namespace[];
tokenize $curContainer ":" $namespace;
You are able to
find the current namespace once the character has been referenced and use that
information in the script.
There are a few advantages of using this method. The animators can easily bring up the character GUI for the current character they are animating, the character GUI does not have to be stored in a shelf and you not have to predict what their namespaces will be.





Subscribe
This is exactly what I'm looking for, but I'm not sure I understand how to implement it. I've written my GUI already, but I've never worked with containers before. Any help would be greatly appreciated! Thanks!!!
Posted by: Eliot Sirota | 13/07/2010 at 05:33 AM
I'm just trying to figure out what $object is.
Posted by: Eliot Sirota | 15/07/2010 at 07:00 AM