Quantcast
Channel: Daz Script Developer Discussion - Daz 3D Forums
Viewing all articles
Browse latest Browse all 1067

How to get only modifiers of current selection?

$
0
0

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?


Viewing all articles
Browse latest Browse all 1067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>