/ Published in: Maxscript
It is sometimes useful to have different modifier enabled or disabled for different passes. An alternative to using a different objects via visibility sets is to use the Before/After scripts to enable or disable the modifiers.
Modifiers can be accessed via MXS using either index (from the top), or by name - name is obviously more reliable since adding modifiers will mess up the index.
One way of getting an objects modifier by name is:
$'objectname'.modifiers[#modifiername]
(where 'objectname' is the name of the object and #modifiername is the modifier name - it pays to rename the modifier so you don't have multiples with the same name) and then
.enabled = true/false
You can of course also modify other properties.
*Note that the ' used either side of the object name is useful - it enables referencing objects with spaces in their names (not that I personally like spaces in names...)
Modifiers can be accessed via MXS using either index (from the top), or by name - name is obviously more reliable since adding modifiers will mess up the index.
One way of getting an objects modifier by name is:
$'objectname'.modifiers[#modifiername]
(where 'objectname' is the name of the object and #modifiername is the modifier name - it pays to rename the modifier so you don't have multiples with the same name) and then
.enabled = true/false
You can of course also modify other properties.
*Note that the ' used either side of the object name is useful - it enables referencing objects with spaces in their names (not that I personally like spaces in names...)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$'objectname'.modifiers[#modifiername].enabled = true/false