Announcement

Collapse
No announcement yet.

randomize material id

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

  • randomize material id

    anyone knows a script?
    i ve got an object with alot of faces wich i want to aply 4 diferent materials in a random order....anyone?
    Nuno de Castro

    www.ene-digital.com
    nuno@ene-digital.com
    00351 917593145

  • #2
    Hi,

    If each face is an element, you can use the MaterialByElement modifier.
    Surreal Structures
    http://surrealstructures.com/blog

    Comment


    • #3
      thanks Frances....will try!
      Nuno de Castro

      www.ene-digital.com
      nuno@ene-digital.com
      00351 917593145

      Comment


      • #4
        Re: randomize material id

        Originally posted by ene.xis
        anyone knows a script?
        i ve got an object with alot of faces wich i want to aply 4 diferent materials in a random order....anyone?
        with the object selected run this:
        Code:
        for i=1 to $.mesh.numfaces do  setfacematid $.mesh i (random 1 4)
        As long as the object is an editable mesh this will work the treat.
        For editable poly objects it's slightly different in practice, but the concept does not change.

        Hope it helps

        Lele

        Comment


        • #5
          thank u lele!
          i got away with frances modifier already...
          thanx anyway!
          Nuno de Castro

          www.ene-digital.com
          nuno@ene-digital.com
          00351 917593145

          Comment


          • #6
            Also the Blur studios script pack has a script that does exactly this.
            "Why can't I build a dirigible with my mind?"

            Comment


            • #7
              the blurscript is called select random faces.
              very handy tool indeed
              Chris Jackson
              Shiftmedia
              www.shiftmedia.sydney

              Comment


              • #8
                is there even a possibility with this script for select every 2nd or 3rd face?
                Jonas

                www.jonas-balzer.de
                www.shack.de

                Comment


                • #9
                  For Blur's script, i wouldn't know

                  For that one line script up there, it can surely be done (add a "by 2" to the for cycle, and that's done), even though it sounds odd as a method (accessing POLYS is a different thing: faces are only triangular.).

                  One handy thing might be that the user selects a set of faces, and to those it applies random mat ids.

                  Also, it should be expanded to check for what's selected: a mesh and a poly object work in fairly different ways, and have different methods that apply to the classes.

                  But that's prolly another couple of lines of scripting, and i'm a tad busy at the moment, so i'd skip it for now...

                  Lele

                  Comment


                  • #10
                    i was waiting for an answer from you lele
                    Chris Jackson
                    Shiftmedia
                    www.shiftmedia.sydney

                    Comment


                    • #11
                      things like polyboost and orion flame have stuff just like that. Plus alot of other cool features.

                      But hey.. you got what you wanted

                      Comment


                      • #12
                        Spot on, daforce!
                        i was watching orionflame's videos just a couple of days ago...

                        now, THAT is scripting
                        I so want one :P

                        Lele

                        Comment


                        • #13
                          thanks lele, but when i see no matter what, that includes the word "script", my brain totaly shuts down.
                          i've tried it, but........

                          orion flame i don't know, but its right polyboost is great!
                          its a while ago now, i think i have to try it out

                          where did you find the orionflame videos?
                          Jonas

                          www.jonas-balzer.de
                          www.shack.de

                          Comment


                          • #14
                            Lele,

                            Yeah amazing hey.
                            You seen the polyboost videos?
                            The topology buttons are wicked.. not that usefull but fun to play with

                            jonnybefree,
                            Try the polyboost demo

                            Comment


                            • #15
                              yeah, impressive.

                              I haven't tried it, but i am extremely curious to see how it works on bad topology objects (autocad models, anyone?), as from my experience what he does with select every nth poly, select interior, select border and so on can be done with a very regular mesh (loops and rings at their proper places) in a fairly straightforward way.
                              I wonder if it works in limit cases, and if it does, boy what algorithms that chap threw at it!

                              I'll go fetch the demo

                              Lele

                              Comment

                              Working...
                              X