View Full Version : How to prefixHierarchy Joint chain using MEL

01 January 2013, 12:13 PM
as prefixHierarchy is a procedure we can`t automate that using MEL. I want all the selected joint hierarchy to be renamed with ("FK_" + $originalJointName) as a suffix.

01 January 2013, 02:36 PM
As prefixHirarchy is automatically loaded, you can use it in your script...
Or, if you don't want the GUI that this script generates, copy the parts you need.
Here's a simplified version.

string $prefix = "FK_";
select -hi;//if you want to rename all the children of the selected joint
string $selec[] = `ls -type "joint" -sl`;

if (size($selec) > 0 )
for ($each in $selec)
string $nodeName = `substitute ".*|" $each ""`;
string $newName = `rename $each ( $prefix + $nodeName )`;

CGTalk Moderation
01 January 2013, 02:36 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.