Announcement

Collapse
No announcement yet.

Randomize texture for each object

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

  • Randomize texture for each object

    Hey guys!

    I was wondering if there is a Maya and/or V-Ray node that allows you to randomize your texture color in a defined space for each object that has the material. I couldn't find anything on the internet - so maybe some power user could help me with that. Would be awesome if there is something deep hidden inside in Maya or V-Ray that allows you to do that.

    Thanks in advance guys!

    Greetings
    Felix

  • #2
    No, we don't have such thing on a texture/color basis.
    But you could use some MEL scripting to do that, where you give a range out of which you pick your colors and assign it afterwards.
    Here's an example, along with a scene:

    Code:
    string $objects[]=`ls -sl`;
    string $o;
    for ($o in $objects) {
        vray addAttributesFromGroup $o vray_user_attributes 1; // adds vray user attributes to the selected nodes
        vector $v=`rand <<0,0,0>> <<1,1,1>>`; // random range from 0 to 1 for the 3 color components
        evalDeferred("setAttr -type \"string\" "+$o+".vrayUserAttributes \"random="+$v.x+","+$v.y+","+$v.z+";\""); // sets the attribute and value for each node
    }
    Just select your objects and run this. Then assign one shader to all of them, in the diffuse add a vrayUserColor texture and just type in "random" in the attribute field.

    randomColor.zip
    Last edited by yolov; 11-01-2016, 01:28 PM.
    Alex Yolov
    Product Manager
    V-Ray for Maya, Chaos Player
    www.chaos.com

    Comment


    • #3
      Thanks! I am gonna try that out

      But such a node would be a great addition to V-Ray. Do you think that could be considered in the next versions?

      Greetings

      Comment


      • #4
        We'll put some thought into this.
        Alex Yolov
        Product Manager
        V-Ray for Maya, Chaos Player
        www.chaos.com

        Comment


        • #5
          Actually, the V-Ray implementation of the samplerInfo node can produce a random floating-point number of each object in the scene, which could then be used to drive f.e. a Ramp node or something), we just have to expose this.

          Best regards,
          Vlado
          I only act like I know everything, Rogers.

          Comment


          • #6
            I was thinking of something like the hairSamplers randombyStrand, and plug it into a ramp would be so great for vray (and maybe not that hard?). Maybe have a few different options like random by object, random by shell(element?, for example for tons of leafs all combined into one object, to save on the transform node count).

            But that sounds already like what you are talking about Vlado. Would be VEERY powerful.
            The same idea, but to randomize shaders would also be equally great (but in a different way).
            CG Artist - RnD and CG Supervision at Industriromantik

            Comment


            • #7
              Originally posted by vlado View Post
              Actually, the V-Ray implementation of the samplerInfo node can produce a random floating-point number of each object in the scene, which could then be used to drive f.e. a Ramp node or something), we just have to expose this.

              Best regards,
              Vlado
              So that means I can already plug the samplerInfo Node into my node and it will work our do you guys have to implement that in V-Ray first?

              Thanks for your quick replys guys!

              Comment


              • #8
                We have to implement it first.
                Alex Yolov
                Product Manager
                V-Ray for Maya, Chaos Player
                www.chaos.com

                Comment


                • #9
                  Well, we need to expose the additional V-Ray output for the samplerInfo... hopefully in a nightly build in a few days.

                  Best regards,
                  Vlado
                  I only act like I know everything, Rogers.

                  Comment


                  • #10
                    Sounds good. Thanks guys!

                    Comment


                    • #11
                      Yay! That would be awesome. How does one get access to Nightly builds? I've sent requests before to support@chaosgroup.com but that hasn't seemed to work. Should I be contacting a different address?

                      Thanks,
                      Ben

                      Comment


                      • #12
                        You can email me to vlado@chaosgroup.com and I'll pass it along. Our support guys are specifically instructed not to give out nightly builds indiscriminately

                        Best regards,
                        Vlado
                        I only act like I know everything, Rogers.

                        Comment


                        • #13
                          Wow, superb!
                          This works on a per Object base or per face? Or maybe even per shell? Per shell would be amazing, because on trees, grass etc. you don't have single objects but a lot of combined shells.

                          Comment


                          • #14
                            Originally posted by pechart View Post
                            Wow, superb! This works on a per Object base or per face? Or maybe even per shell? Per shell would be amazing, because on trees, grass etc. you don't have single objects but a lot of combined shells.
                            There is a per-object option right now; Vlado Nedev recently coded something for Modo that works based on mesh elements, I guess we could use that too at some point.

                            Best regards,
                            Vlado
                            I only act like I know everything, Rogers.

                            Comment


                            • #15
                              Sounds great. That would help in many situations!

                              Comment

                              Working...
                              X