Just to reiterate, use this, it will work and is much simpler: def delcube(self, *args): todelete = cmds.ls("myCube*", sl=True, dag=True, v=True, ud=False) for obj in todelete: try: cmds.delete(obj) except ValueError: # Shape Node already deleted pass
-- 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_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPaTLMRxSUf8h%2B%3DjVvPp9eGYN6My8XppzOPENTYU5jtnjPeNpQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.