[Closed] Turning of modifier all at once
Hello,
I’ve been unsuccessfull writing a Maxscript to turn off symmetry modifier on all the selected objects.
I tried something like this
$.symmetry.enabled = false
It works for just one obeject, but it does not work for all the
objects at once if each object has symmetry applied individually.
Thanks
You have to loop through a specified set of Objects. (Selection, the whole scene, Geometry Class, etc.)
If you want to execute a action to all the selected Objects for example you would do this:
for obj in selection do
(
$.symmetry.enabled = false
)
Its a very simple example and lacks of a few things (error handling, check if the modifier is applied , etc…)
this one is a bit better:
for obj in geometry do
(
try
(
if obj.modifiers[#symmetry] != undefined then obj.modifiers[#symmetry].enabled = false
)
catch()
)
It loops through all your geometry objects and checks if a symmetry Modifiers i applied. If so, then it gets disabled. If an error occurs it will be catched and the next Object gets tested.
so long…
-Asgaard
Originally posted by Asgaard
[B]
for obj in selection do ( $.symmetry.enabled = false )
-Asgaard [/B]
I am sure you meant something like
for obj in selection do
(
try(obj.symmetry.enabled = false)catch()
)
If any of the selected objects does not have symmetry applied, you would get an error you need to catch.
Its a very simple example and lacks of a few things (error handling, check if the modifier is applied , etc…)
for obj in selection do
(
try(obj.symmetry.enabled = false)catch()
)
Hello, I tried the scripts, but got the error below.
I used it in listener and also saved as .ms, then
ran it from the file, getting the same error.
am I supposed to declare some kind of function or
some sort before the scripts?
Thank you very much for your help.
– Syntax error: at ), expected <factor>
– In line: )
Try [Max Script] –> “New Script” –> Paste the code and execute it (CTRL + E)
so long…