Hey, So this might work. But are they duplicate shapes? If not, you would need to discern which shape you would want to keep, which this wouldn't do! :)
import maya.cmds as cmds transforms = cmds.ls(transforms=True) # List transforms in the scene for transform in transforms: shapes = cmds.listRelatives(transform, shapes=True, noIntermediate=True) # Find the shapes from each transform (intermediate nodes not included) if shapes is not None and len(shapes) > 1: # If the transform has multiple shapes.. cmds.delete(shapes[1:]) # Delete all but the first shape -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/7c126ce8-ce47-4c80-8111-fe046dc537d7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
