PDA

View Full Version : How to prefixHierarchy Joint chain using MEL


theJackson
01-23-2013, 11:13 AM
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.
thankYou!

depakeen
01-23-2013, 01: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-23-2013, 01: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.