Announcement

Collapse
No announcement yet.

Change settings for multiple materials

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

  • Change settings for multiple materials

    Hi everyone

    Does anyone know if there is a way to change the same setting for many materials at once?

    example: I have 15 materials, where i need to set the same reflections color and glossiness.

    I tried using "Shift" to select many material, but it only changes setting for the last one i selected.

  • #2
    Hello, Theis,

    In V-Ray 6 you can do this by grouping the materials under the same tag and then change their properties with a script.
    To assign the tag select all materials in Asset Editor you want to change, then right click and from the context menu select Tag > New. After you create the Tag you can double click on it to change its name.

    The script below changes the Reflection color and Reflection Glossiness of all materials under the tag with name Tag1 to - (almost) White color, with RGB color values (0.95,0.95,0.95) and 0.85 (value for Glossiness).
    You can substitute "Tag1" on line 4 with the name of your tag and the reflection glossiness and reflection color (RGB values) on line 11 and 12 with the values you need. Then copy paste the modified script in the Ruby console (Extensions > Developer > Ruby console) and hit Enter:
    Code:
    scene = VRay::Context.active.scene
    tagged_plugins = Array.new
    scene.each {  |plugin|
          tagged_plugins.push(plugin) if plugin[:ui_tags].include?('Tag1')
    }
    
    tagged_plugins.each { |tagged|
       scene.each {  |plugin|
          if plugin.name == "#{tagged.name}/VRay Mtl"
             scene.change{
                plugin[:reflect_glossiness_float] = 0.85
                plugin[:reflect_color] = VRay::Color.new(0.95,0.95,0.95)
             }
          end
       }
    }
    
    ​
    Let me know if you have any questions.

    Kind regards,
    Iva
    Iva Mancheva
    V-Ray for SketchUp | V-Ray for Rhino | QA
    www.chaos.com

    Comment


    • #3
      Hi iva_mancheva

      Thanks a lot for the answer.

      I will try to use the script for the task that i have right now.

      But sins this is possible via script, then I'm guessing that it also could be a feature in the asset editor also?
      My coding skills are not good enough to be able to change anything or add to that script. Other than the values you mentioned.

      So can i suggest that this kind of "batch change" could be a feature in the regular UI, so non-coding people like me can make changes like this?

      Kind regards, Theis

      Comment


      • #4
        Hello, Theis ,

        I logged a feature request based on your suggestion. We will let you know if there is any progress in this regard.

        Kind regards,
        Iva
        Iva Mancheva
        V-Ray for SketchUp | V-Ray for Rhino | QA
        www.chaos.com

        Comment

        Working...
        X