Search ProofOfProgress Blog

Wednesday, April 13, 2011

Find index of modifier in stack via classID in Maxscript

Suppose you are looking for a skin modifier
in the selected object (myObject).
BUT... The skin modifier has been renamed to "JMIMS_SKIN".
Here is how you would find the skin modifier, even though it is
no longer named "Skin" in the stack.


myObject = $;
srchID=Skin.ClassID; --Search for skin modifier in MyObject.

For m = 1 to myObject.modifiers.count do(
cmID = myObject.modifiers[m].ClassID;
modFound=False;
if(cmID[1]==srchID[1])then(
if(cmID[2]==srchID[2])then(
modFound=True;
)--[x]
)--[x]

if(modFound)then(
Print("Your Modifier is index#" + m as string);
)else(
print(cmID as string + "!=" + Skin.ClassID as string);
)--[x]
)--[Next m]

No comments:

Post a Comment