Hi all, I am trying to do some namespace removal in the python way but I
am meeting with some problems, especially those nested namespaces.
This is my code:
nsLs = cmds.namespaceInfo( lon=True )
defaultNs = ["UI", "shared", "camera01"] # I need camera01
diff = [item for item in sel if item not in defaultNs]
for ns in diff:
if cmds.namespace( exists=str(ns)):
cmds.namespace(rm=str(ns))
# Error: line 1: The namespace 'v02' is not empty.
# Traceback (most recent call last):
# File "<maya console>", line 8, in <module>
# RuntimeError: The namespace 'v02' is not empty. #
nsLs = cmds.namespaceInfo( lon=True )
defaultNs = ["UI", "shared", "camera01"] # I need camera01
diff = [item for item in nsLs if item not in defaultNs]Hi all, I am trying to do some namespace removal in the python way but I am meeting with some problems, especially those nested namespaces.
This is my code:
nsLs = cmds.namespaceInfo( lon=True )
defaultNs = ["UI", "shared", "camera01"] # I need camera01
diff = [item for item in sel if item not in defaultNs]
for ns in diff:
if cmds.namespace( exists=str(ns)):
cmds.namespace(rm=str(ns))
I am having issues with deleting "new_run01" that resides within "v02" and "v03", as soon as I run the code, I am getting this error:# Error: line 1: The namespace 'v02' is not empty.
# Traceback (most recent call last):
# File "<maya console>", line 8, in <module>
# RuntimeError: The namespace 'v02' is not empty. #
I have checked and verified that there is no contents listed within those 2 new_run01 but unless I opened up the Namespace Editor and delete them manually, it seems to defeat the purpose of scripting it in the first place.
Was wondering if anyone happen to do something similar before? Many thanks in advance!
--Gerard.
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/00412c30-471d-4ba5-bb35-13cf7657c5e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/80fd0be8-c9b8-4500-b4db-76540d8774b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.