Change Camera Marking Menu
This is a small tips for clear all namespaces in the maya scene. First copy the script bellow and save it as “bc_CleanAllNameSpace.mel” in any of your user script folder. Or you can download the script from here
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
global proc string bc_CleanAllNameSpace() { string $bcReadOnlyNode[]; string $bcAllObjects[]; int $bcIndex; $bcAllObjects = `ls -allPaths`; $bcIndex = 0; for($bcObject in $bcAllObjects) { $bcNewName = bc_CleanNameSpace($bcObject); if(catchQuiet(`rename $bcObject $bcNewName`)) { stringArrayInsertAtIndex($bcIndex, $bcReadOnlyNode, $bcObject); $bcIndex++; } } print $bcReadOnlyNode; return "All the namespaces in the scene are cleaned"; } global proc string bc_CleanNameSpace(string $bcNodeName) { string $bcBuffer []; string $bcNewName; $bcBufferLen = `tokenize $bcNodeName ":" $bcBuffer`; if($bcBufferLen > 1) { return $bcBuffer[$bcBufferLen - 1]; } else { return $bcNodeName; } return "Its Not working"; } |
Create a shelf button using the following commands.
1 2 |
source bc_CleanAllNameSpace.mel; bc_CleanAllNameSpace(); |