if m.listHistory(type='deformer'):
...
- Ofer
www.mrbroken.com
Not in front of maya but I stole the code out from the file-optimize- scripts.
> --
> http://groups.google.com/group/python_inside_maya
>
--
Sent from my mobile device
Viktoras:I want to remove the intermediate shape nodes, but only if the mesh is not being deformed by any deformer in which case those are needed (meshNameShapeOrig, sometimes meshNameShapeDeformed when referenced). These intermediate shapes are sometimes retained on the mesh when duplicating or delete history to get rid of deformers. They cause some issues in our pipeline....
`can u filter them by checking whether the intermediateObject attribute is set to true?
Not sure if it is overkill to do both, but this seems to do that trick and get rid of what you want to get rid of regardless if the mesh is deformed or not...
for m in meshes:if not m.isReferenced():shapes = m.getShapes()for s in shapes:if s.intermediateObject.get():if not s.listConnections():delete(s)rename(m.getShape(), '%sShape' % m.name())/Christian
-- Viktoras www.neglostyti.com
- Ofer
www.mrbroken.com