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
[mel]
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”;
}
[/mel]
Create a shelf button using the following commands.
[mel]
source bc_CleanAllNameSpace.mel;
bc_CleanAllNameSpace();
[/mel]