Announcement

Collapse
No announcement yet.

Maxscripting and Extrude modifier

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Maxscripting and Extrude modifier

    Hi,

    I'm working on some tools too speed up my work a bit (Extruding shapes to walls using Extrude modifier).

    I have selected a Rectangle shape and write this:
    Code:
    modPanel.addModToSelection (Extrude ()) ui:on
    $.modifiers[#Extrude].amount = 2100
    -- Unknown property: "amount" in undefined
    As you can see it doesn´t work, I get an error about undfined "amount".

    But if I write this:

    Code:
    modPanel.addModToSelection (Extrude ()) ui:on
    OK
    and then this:

    Code:
    $.modifiers[#Extrude].amount = 2100
    2100
    it works. But why can´t I do it in one sweep? The goal is just to have a simple button that creates walls that are 2100 mm high from a shape.

  • #2
    try this instead:

    Code:
    myObj = $
    
    theExtrude =  (Extrude ())
    theExtrude.amount = 2100
    addmodifier myObj theExtrude
    Changing to the modifier might be losing your selection temporarily - not sure exactly why.

    Comment


    • #3
      It worked great, thank you. I also discovered that I can't code this using the MAXScript Listener...
      But now I know better! (type CTRL+N when in the MAXScript Listener to open a new script window, script, and the "Evaluate all")

      Comment


      • #4
        I would suggest you to go over to scriptspot (www.scriptspot.com) and check out both the commercial and free educational resources listed there.
        They are GOLD to any user, at any level, to start understanding the concepts behind maxscript.
        Unfortunately using the macrorecorder in max isn't like doing it in maya.
        You will need some more work to make things happen the way you want them.

        Lele

        Comment


        • #5
          Thank you Lele, I will have a look! I also considering buying a book on the subject, since it´s sooo useful to build your own little features to speed up work.

          Comment


          • #6
            I can't recommend enough the CGAcademy DVDs from bobo (intermediate to advanced) and the Lyric Media cd (beginners to intermediate).
            And yes, i can confirm you that being able to throw a little scripting here and there is a great arrow to have in any company's quiver.
            The good thing of it is that most times, there's little work to do to make impossibly tedious tasks become a breeze.

            Lele

            Comment


            • #7
              I can say that Bobos intermediate disc is awesome as well as John Wainrights (creator of maxscript) dvd as well. Its funny, Johns disc kind of feels like your being taught by a really smart uncle or something. He's really soft spoken. Lots of great examples.
              -----Dwayne D. Ellis-----

              Comment

              Working...
              X