I've done some searching and I can't find a simple answer to this; is there a command in maxscript to call on the currently active modifier?
I have some scripts that work in Editable/Edit Poly, but if I have multiple copies of Edit Poly on the mesh, they refuse to work. It'd be nice to say "Hey, we're currently using modifier
#4 in the stack, so try this using THAT edit poly...".
Replies
setCommandPanelTaskMode #modify
--THIS GETS THE MODIFIER
CurrentMod = modpanel.getCurrentObject()
CurrentMod = modpanel.getCurrentObject()
theModifier_ID = modPanel.getModifierIndex $ CurrentMod
-- and then use this to call it
$.modifiers[theModifier_ID]
this way your script will control the modifier that will be specific to your Object
--------------here is the maxdoc definition on the two function.-------------------
modPanel.getCurrentObject()
Returns the modifier or base object currently selected in the Modify panel stack.
If the Modify panel is not open, this function returns undefined . Use the max modify mode command to switch to the Modify panel.
modPanel.getModifierIndex <node> <modifier>
Returns the index of the given modifier in the modifier stack for the given node.
This index corresponds to the modifiers position in the <node>.modifiers array.
This function returns undefined if the given modifier is not in the node's modifier stack.
I hope this will be helpful for the next person that will search for this information.