I have been reading a book, "MEL Scripting a Character Rig in Maya," by Chris Maraffi. I'm still learning MEL syntax, but I have managed to create a couple tools from things I picked up from the book.
FK Control Creation
Using part of the author's script, I created an FK control creation tool. I took what Chris Maraffi wrote for his xform tool, and changed particular parts of it. His code queried the translations of an object using the xform command. Well, that works great with objects, but joints inside a hierarchy have transforms based on their parent joint. So, in order to find the transforms of a joint in the hierarchy, I used a world space flag (-ws) to find the transforms of any joint in the world space. From there I created a simple GUI that requests the user to input a part of the joint name they wish to remove.
For example: I select my joint "left_shoulder_bindJT". From here, I activate my arm control tool from the shelf. In the text field I input "_bindJT" which tells my tool to substitute "_bindJT" with blank space. I then select the "Create" button and my FK control NURBs Circle is created. The selected joint is then oriented to the control circle, and the group of the control circle is parent constrained to the joint's parent. For this example, the control is named "cc_left_shoulder" and the control group is named "grp_cc_left_shoulder" which is automatically done by the script.
I am currently working on a way to host the script, and when I do I will post it with instructions on how to use them.
No comments:
Post a Comment