Notifications
Clear all

[Closed] Add morpher

Hi All,
I want add morpher to object in modifier
but add the under skin, I do not want add up skin modifier
Thanks,

2 Replies

Here’s a snippet from MAXScript help, “Node Common Properties, Operators, and Methods”

addModifier <node> <modifier> [before:index]

The optional before: keyword argument can be used to insert the modifier into the node’s modifier stack just before the indexed modifier, counting from the top of the stack.

You’ll just need to figure out which index is the modifier you want to insert before. You can do that by iterating through the modifier stack using index and checking the class of the modifier (using: classof <something>).

Pretty simple, here is an example.

-- 
myBox = Box() 
addModifier 
myBox (Skin()) 
-- 
fn getSkinIndexFn obj = 
( 
    for i = 1 to obj.modifiers.count where (classof obj.modifiers[i]) == Skin do return i 
    return 0 
) 
addModifier myBox (Morpher()) before:(getSkinIndexFn myBox)