[Closed] add modifier via script not working
…well it works in some cases.
i’m adding an emptyModifier() & putting some custom attributes on it via script. if i run the script directly the modifier & ca’s goes on the object fine. however, if i run it as a macroscript, or call it with a fileIn, the add modifer (&therefore the ca’s) gets skipped.
i’ve run into this before & i believe it due to something about the stack needs to be evaluated after the command to actually work. for the life of me, i can’t remember how to do that.
anyone know a workaround for the skipping or how to force max to evaluate the stack?
thx!
Sometimes making sure you are in Max Modify Mode will help with modifiers. Also selecting the object can halp (it does with point cache)
thanks!
select $myObject works & i’ll go with it since it’s just a couple objects to work on. but it just seems super inefficient especially if it were a lot of objects to add modifiers to. i’m curious if there’s a technical explanation for this.
Calling CLASSOF() on the object updates the stack and is MUCH faster than selecting the object.