一半君的总结纸

听话只听一半君

remove nested reference ?

敲完才发现根本没用,namespace remove的时候必须先unload, 只要unload了,显然child namespace也跟着没了?

 def delNestedNamespace(ns):
        cmds.namespace(set=':')
        cmds.namespace(set=ns)
        nestedNamespaces = cmds.namespaceInfo(listOnlyNamespaces=True)
        if nestedNamespaces:
            print 'nested namespaces found in :',ns,'-->',nestedNamespaces
            for nns in nestedNamespaces:
                print 'recursive calling del ns :',nns
                delNestedNamespace(nns)
        else:
            print 'del leaf ns :',ns

            print 'current ns:',cmds.namespaceInfo(currentNamespace=True)
            print 'child ns:',cmds.namespaceInfo(listOnlyNamespaces=True)
            cmds.namespace(set=':')
            cmds.namespace(mv=(ns,":"), force=True)
            cmds.namespace(rm=ns)
Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: