PDA

View Full Version : add modifier via script not working


steev
08-19-2008, 01:14 AM
...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!

floopyb
08-19-2008, 01:26 AM
Sometimes making sure you are in Max Modify Mode will help with modifiers. Also selecting the object can halp (it does with point cache)

steev
08-19-2008, 01:38 AM
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.

Bobo
08-19-2008, 05:11 AM
o 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!

Calling CLASSOF() on the object updates the stack and is MUCH faster than selecting the object.

CGTalk Moderation
08-19-2008, 05:11 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.