Notifications
Clear all
[Closed] Add morpher
Jun 19, 2017 12:41 pm
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
Jun 19, 2017 12:41 pm
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>).
Jun 19, 2017 12:41 pm
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)