View Full Version : Simple Maxscript Question
10-03-2011, 12:48 AM
Can't seem to figure out how to make a if then statement change 2 things.
What I want is...
If 'something' == true then (do this and this)
else (do this)
What I am trying to do is create an edit poly NURMS toggle. I would like it to NURMS Subdivision on and Show Cage off, then go from 1 iteration, 2 iteration and back off.
(On, 1, 2, Off)
EDIT: NVM... Maxscript 101! Has someone else made it?! The answer is yes.
Sorry for not checking first.
10-03-2011, 02:08 AM
Ha, I have that exact script available on my website:
It's called Toggle NURMSlevel.
10-03-2011, 02:38 AM
well would you look at that! Yours was the one I found! :D
I did have a question though... the one you wrote toggles all objects globally. How would I go about tweaking it to just do the selected objects? What I tried was changing all of the 'objects' to $ which works... but when I have nothing selected I get an error.
I don't know enough to be able to do a check for that. :/
Btw man I love your scripts. And I am going to buy the game you just finished up once I graduate in December. ;) Been keeping an eye out and watching Chris' character art on facebook... I am stoked man!
10-03-2011, 03:42 AM
Thanks for the kind words. Yeah, Chris Moffitt is an awesome character artist. To change the script:
Each line that says:
for o in objects dochange it to
for o in selection doThen you can change multiple object by just selecting them. Or just one if you only have one selected.
BTW, after you save you need to either evaluate the script or restart max.
10-03-2011, 04:16 PM
Awesome man! I had something similar last night but I didn't know about evaluating the script. Works like a charm! I really appreciate the help and keep up the awesome work!
vBulletin® v3.8.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.