On Fri, 12 Jun 2015 8:44 PM mjlefevre <[email protected]> wrote:
* deleted my original reply because it had syntax errors..is there any way
to edit posts? :)
moderators can edit posts.. but seeing as it is a mailing list... people
have already received it in mail form :-)
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
<https://groups.google.com/d/msgid/python_inside_maya/99b8363b-1798-4a58-b151-f0cfae0e625d%40googlegroups.com?utm_medium=email&utm_source=footer>
.
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA10s09fh81doaAJpfJEK7oq7u1a28j1_%2B%2BCUOyDHqCLkA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.