How to list all deformers on a mesh in Maya?

I’m trying to use the reorderDeformers command to put a blendShape node in the correct spot in the Inputs stack. However, that command requires that I know which deformers I want to reorder. I can’t find any non-ridiculous way of simply listing all deformers on a mesh.

The closest thing I’ve come up with is doing a listHistory on the object and then cross-checking the results with a list of deformer types. Even this though requires that I have a giant list of all deformer types to compare it to. It just seems dirty.

Any suggestions?

Edit: Based on this thread, got this working: http://www.scriptswell.net/2010/09/mel-list-all-deformers-on-mesh.html

What about checking the inherited types of the history nodes? All deformers inherit from “geometryFilter”, so doing:


string $types[] = `nodeType -inherited $node`;

will get you the types that a node is derived from. And then if “geometryFilter” is present in $types, you know the current node is a deformer.

There is also a command called listNodeTypes. Unfortunately, it expects a string with the classification of a node that you are searching for, but it would appear that only shading nodes have a classification.

1 Like

Sweeeeet, that did it. Thanks Neil.

Grab history on mesh, loop through each history node, check if geometryFilter is present. Bingo. Still a bit convoluted but it gave me exactly what I needed in only a couple of lines of code.

I’m glad that worked.

It’s unfortunate that listHistory doesn’t behave like the other list commands (i.e. ls, listConnections, etc…) and allow you to pass in a type flag to filter by. Sounds like something worth suggesting to Autodesk.

Indeed a good request and something I’m logging now :):

woot awesome

Wow. That’s pretty cool. Thanks.