Download:

download: vRay_Material_Global_Override.zip

vRay Material Global Override

THIS CODE NEES TO BE TWEAKED PER USE!

Ever need to modify a bunch of vRay materials at once? This is the way to do it. This loops through the scene materials and will do whatever you need done to them. This one has no UI, and needs to be modified per task, but is super easy to look at and use. Perhaps someday i'll make a proper release of this that has a proceduaral UI.

You'll see that many of the lines are commented out, because that is the easiest way to use the script. By leaving any values that you find usefull or variables that you modify often, you can just leave them in there, and when you want to distribute those values throughout the scene, you can just un/comment them to your task.

Additionally, to find extra variables to be able to toggle them throughout.

This version of the code will also print off the number of modified materials, so you can keep track if the script is actually doing anything, or not.

--THIS CODE NEES TO BE TWEAKED PER USE!

--sceneMaterials.count
global allMaterialsArray
global goodCount = 0
global badCount = 0
global maxReflectSamples = 16

try(
for m in sceneMaterials do
(
Try(
if (m.map1.reflection_subdivs)>(maxReflectSamples) then (m.map1.reflection_subdivs = maxReflectSamples) else ()
if (m.map2.reflection_subdivs)>(maxReflectSamples) then (m.map2.reflection_subdivs = maxReflectSamples) else ()

--m.reflection_subdivs = 16
--m.reflection_glossiness = 0.75
--m.reflection_maxDepth = 3
--m.map1.Refraction = color 0 0 0
m.map1.texmap_reflectionGlossiness_on = off
m.map2.texmap_reflectionGlossiness_on = off
--m.reflection_lockGlossiness = off
--m.texmap_reflection = falloff ()
--m.texmap_reflection.color1 = color 0 0 0
--m.texmap_reflection.color2 = color 40 40 40
--m.option_cutoff = 0

goodCount = (goodcount +1)
)
catch
(
badCount = (badcount +1)
)
)
Print ("Goodcount " + goodcount as string)
Print ("Badcount " + badCount as string)
messagetext = (goodcount as string + " materials were sucsussfully Edited")
messagebox messagetext
)catch(messagebox "whoopsydaisy")

You can see some of the variables in there that are commented out include the reflection subdivs, and how glossy all of the materials reflectioins are.