Script MEL (Autodesk Maya): Percorra a hierarquia

// Add a prefix "myPrefix_" to all children elements of that joint.

string $stat_element = "joint1";
select -r $stat_element;
string $nodes[] = `ls -sl -dag`;
for($node in $nodes){
rename
-ignoreShape $node ("myPrefix_" + $node);
}

essência relacionada: https://gist.github.com/ctrl-alt-delete/11099336