Turning of modifier all at once

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 02 February 2004   #1
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
 
Old 02 February 2004   #2
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
 
Old 02 February 2004   #3
That is great!

I am going to try that and see how it works.

Thanks
 
Old 02 February 2004   #4
Quote: Originally posted by Asgaard


for obj in selection do
(
   $.symmetry.enabled = false
)



-Asgaard


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.
 
Old 02 February 2004   #5
Quote: Its a very simple example and lacks of a few things (error handling, check if the modifier is applied , etc...)



Last edited by Asgaard : 02 February 2004 at 08:24 PM.
 
Old 02 February 2004   #6
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: )
 
Old 02 February 2004   #7
Try [Max Script] --> "New Script" --> Paste the code and execute it (CTRL + E)

so long...
 
Old 01 January 2006   #8
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 04:05 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.