I'm trying to get the modifiers(morphs) of the current selected item (which is usually a cloth piece). Code looks like this:
var oNode=Scene.getPrimarySelection();
var oObj = oNode.getObject();
var nShapes = oObj.getNumShapes();
for (var j=0; j < nShapes; j++) {
var oShape = oObj.getShape(j);
var nMod= oObj.getNumModifiers();
for (var k=0; k < nMod; k++) {
var oMod = oObj.getModifier( k );
//filter
if(oMod.getTypeLabel()!="Morph") continue;
if(oMod.getValueChannel().isHidden()) continue;
if(oMod.getValueChannel().isNumeric()==false) continue;
//..
//do something
}
}
This works to get the modifiers. But when selecting a cloth item which is attached to a character the code returns as well morphs from the character. How can those be filtered to have only modifiers connected to the selected item?