* deleted my original reply because it had syntax errors..is there any way
to edit posts? :)
Hey,
This might work. But are all the shapes duplicates? If not you would need
to discern which shape you want to keep and which to delete.
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/99b8363b-1798-4a58-b151-f0cfae0e625d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.