それでも1クリックでやりたい時もあり、他のスクリプトと同時に走らせたい場合も多い為のメモです:
ネームスペースを全て取得して、
削除して、ペアレントとマージする。(ネームスペースエディターと同じ効果)
//mel
string $allNS[] = `namespaceInfo -listOnlyNamespaces`;
for ($ns in $allNS){
if ($ns != “UI” && $ns!=”shared”){
namespace -mergeNamespaceWithParent -removeNamespace $ns;
}
}
#Python
from maya import cmds
allNS = cmds.namespaceInfo(listOnlyNamespaces=True)
for ns in allNS:
if ns!="UI" and ns!="shared":
cmds.namespace( mergeNamespaceWithParent=True, removeNamespace=ns)