Announcement

Collapse
No announcement yet.

how to get material color from wire color ?

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

  • how to get material color from wire color ?

    Hi,
    i'm using a script to randomize wire colors of some objects. And i'd like to assign them material with the colors randomized.
    Is there a way to get the wire color of an object as a diffuse color for the mat ?
    or is there a way to randomize the diffuse color of , say, a multi sub mat ?

    Thanks

  • #2
    If you dont apply a material to an object it renders as a diffuse version of the wire colour, cant you just do it like that?

    Comment


    • #3
      yeah if you wanted to do that you could do:

      Code:
      (
         for o in getCurrentSelection() do (
            -- Assign a random wirecolor
            local randomColor = color (random 0 255) (random 0 255) (random 0 255)
            o.wirecolor = randomColor
            
            -- Assign a material with the random color
            o.material = VRayMtl diffuse:randomColor
         )
      )
      Colin Senner

      Comment


      • #4
        Thanks cubiclegangster.
        Unfortunately i cannot do like that because i would like to assign materials custom refl, refr, bumps, gloss...

        Comment


        • #5
          Wow MoonDoggie,
          you seem to script pretty fast and well. i'm an ass at maxscript. i know vb that's all...
          i will test this script.
          Thank you

          Comment


          • #6
            For your alternative approach, check out the random function of MasterBercon's gradient map:

            http://www.ylilammi.com/BerconGradient.shtml

            With this you have options for random color per Material ID or Object. This option will also give you control over the spectrum the random colors are drawn from.
            Ben Steinert
            pb2ae.com

            Comment


            • #7
              Very nice link
              Thn k you very much

              Comment

              Working...
              X