Notifications
Clear all

[Closed] Questions regarding modifier stack via maxscript

I’m trying to find a good way to automatically cycle through an object’s modifiers within MaxScript. I can’t find a way to do this without using the rather cumbersome “modPanel.setCurrentObject” method. The primary concern I have with using that method is that I get the same warning popup that I would get manually clicking through the stack. (i.e. “A modifier exists in the stack that depends on topology. Changing parameters may have undesirable effects”).

I have the option to disable this message box, which solves the problem for the short term, but I don’t know how to turn it back on again when I am done running the script. I would like it to skip these warnings while the script is running (kind of pointless to have a script to automate something and then need to click a stream of annoying dialog boxes), but then turn them back on so I don’t accidentally screw up any topology dependent modifiers afterward.

If there is a way to do what I need without using modPanel methods, that would be even better. So, what are my options?

5 Replies

Not sure what you’re looking for exactly, but you can get to an object’s modifiers via

$Object.modifiers[index] where the index starts at 1, and 1 is always the modifier at the top of the stack

So real simply you can do a for loop to go through all and change the parameters / check the class of each modifier, etc.


  for i = 1 to $.modifiers.count do
  (
  	print (classof $.modifiers[i])
	show $.modifiers[i]
  )

this an other way to access to a modifier:

$.modifiers[#ModifierName]

or

$.modifiers[#'Modifier Name']

I knew about that, but thanks. Unfortunately I am working with a 3rd party plugin object class that requires me to actually be -on- the base object in the stack in order to access its properties. So using $.baseobject doesn’t work (I get the error: “Unable to convert: cgMuscle to type: <node>”). I was using modpanel.setcurrentobject $, which worked, but then I kept getting prompted with the warning message popup for each object.

For now, I have disabled the warning, but I feel nervous about leaving it off… how do I turn it back on again?

 JHN

Preferences > general > UI display group > “Display Topology-Depence Warning” checkbox

-Johan

Thanks, appreciate it!