Created
July 18, 2013 13:30
-
-
Save tokejepsen/6029298 to your computer and use it in GitHub Desktop.
remove namespaces
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def removeNamespaces(namespace='::'): | |
ignoreNamespaces = ['UI', 'shared'] | |
cmds.namespace(setNamespace=namespace) | |
childNamespaces = cmds.namespaceInfo(listOnlyNamespaces=True) | |
if childNamespaces: | |
namespaces=list(set(childNamespaces)-set(ignoreNamespaces)) | |
for n in namespaces: | |
removeNamespaces(':'+n) | |
else: | |
parent=':'+cmds.namespaceInfo(parent=True) | |
cmds.namespace(setNamespace=parent) | |
cmds.namespace(moveNamespace=[namespace,parent],force=True) | |
cmds.namespace(removeNamespace=namespace) | |
if parent!='::': | |
removeNamespaces(parent) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment