Home Technical Talk

Simple Maxscript Question

polycounter lvl 12
Offline / Send Message
jeremiah_bigley polycounter lvl 12
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.

Replies

  • monster
    Options
    Offline / Send Message
    monster polycounter
    Ha, I have that exact script available on my website:

    http://juantwo.com/maxscripts.html

    It's called Toggle NURMSlevel.
  • jeremiah_bigley
    Options
    Offline / Send Message
    jeremiah_bigley polycounter lvl 12
    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!
  • monster
    Options
    Offline / Send Message
    monster polycounter
    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 do
    
    change it to
    for o in selection do
    
    Then 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.
  • jeremiah_bigley
    Options
    Offline / Send Message
    jeremiah_bigley polycounter lvl 12
    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!
Sign In or Register to comment.