Since Maya 2011, there's a new (scripted) function 'findRelatedDeformer' that lists down all the deformers controlling a particular mesh. This is long overdue. And now it's finally here, it's not perfect. Deformers are listed in the order they were created (I think.). I wrote this wrapper script list out deformers for a geometry and also sort out the return list in the order of deformation for a particular object. Just to note, I'm still using the same 'findRelatedDeformer' function to let my iterator know when to stop. This is not necessary but until I've found another method, I'll keep this as is.
Update, this function is no longer relying on the 'findRelatedDeformer' for it to work. And I fixed it so that it will still return the correct nodes even though there were no 'groupParts' nodes used.
This function is useful if you want to replace the "List of all input operations..." dialog box in Maya that has become buggy ever since they've switched to using PyQt. I'm sure they'll quickly repair this, but til then people will need an alternative. I think I'll work on one.
I scripted this too.
// this procedure will return a list of deformers ordered
global proc string[] jd_listOfOrderedDeformers () {
// initialize
$sel = `ls -sl`;
if (`size $sel` != 1) {
warning -sl 0 "listOfOrderedDeformers requires you to have one (1) object selected!";
return {};
}
$selobj = $sel[0];
$shapeList = `listRelatives -type shape`;
if (`size $shapeList` < 1) {
warning -sl 0 "listOfOrderedDeformers requires you to have one (1) object with a mesh selected!";
return {};
}
// get shape name
$shape = $shapeList[0];
// get list of deformers for a the shape
string $listOfDefs[];
$globallistofdeformers = `ls -type geometryFilter`;
for ($each in $globallistofdeformers) {
$geo = `deformer -q -g $each`;
for ($gtry in $geo) {
if ($gtry == $shape) {
$listOfDefs[size($listOfDefs)] = $gtry;
}
}
}
// check if there are deformers after all...
if (`size $listOfDefs` < 1) {
warning -sl 0 "listOfOrderedDeformers found no deformer on the object selected!";
return {};
}
$lisofdefssize = `size $listOfDefs`;
$listOfGroupIDs = `listConnections -d 0 -t "groupId" $shape`;
// initialize return variable
string $orderedDeformers[];
$temp = `listConnections -c 0 -p 0 -s 1 -scn 1 -type geometryFilter ($shape+".inMesh")`;
$orderedDeformers[0] = $temp[0];
// loop and spider through each deformer to find which ones next
for ($i = 1;$i<$lisofdefssize;$i++) {
$listofgroups = `listConnections -d 0 -t "groupParts" $orderedDeformers[$i-1] `;
if (`size $listofgroups`>0) {
string $connected;
for ($group in $listofgroups) {
int $itDeforms = 0;
while ($itDeforms < 1) {
$connectedTMP = `listConnections ($group+".inputGeometry")`;
$connected = $connectedTMP[0];
if (`stringArrayContains $connected $globallistofdeformers`) {
$itDeforms = 1;
} else {
$group = $connected;
}
}
$connectedGroupIDTMP = `listConnections ($group+".groupId")`;
$connectedGroupID = $connectedGroupIDTMP[0];
if (`stringArrayContains $connectedGroupID $listOfGroupIDs`) {
$orderedDeformers[$i] = $connected;
}
}
} else {
$connectedToInputGeometry = `listConnections -type geometryFilter -d 0 ($orderedDeformers[$i-1]+".input[0].inputGeometry")`;
$orderedDeformers[$i] = $connectedToInputGeometry[0];
}
}
return $orderedDeformers;
}

[...] I decided to write an alternative, using my jd_listOfOrderedDeformers as [...]