If I understand correctly, you want to delete all intermediate shapes that are not a part of deformation chain for current shape(s)? then your method fails even when there is a skin cluster on the mesh - there can be multiple intermediate shapes due to mesh duplication and some of them unused.

Normally an intermediate shape can be discarded if it's not being connected anywhere, so just list all outgoing connections from each intermediate shape and delete it if there's no connections.

On 2010.11.16 23:20, Christian Akesson wrote:
Making a utility method to clean out duplicate shape nodes and I want to check if a mesh is being deformed. Instead of the if not m.listHistory(type='skinCluster'): I would love if there was a way to check if there is any deformer type on the mesh....
______________________________________________
for m in meshes:
# Filter out bound meshes
if not m.listHistory(type='skinCluster'):
shapes = m.getShapes()
for s in shapes:
if s.intermediateObject.get():
delete(s)
rename(m.getShape(), '%sShape' % m.name <http://m.name>())
________________________________________________

Thanks,

/Christian
--
http://groups.google.com/group/python_inside_maya


--
Viktoras
www.neglostyti.com

--
http://groups.google.com/group/python_inside_maya

Reply via email to