Heya folks,
Based on the discussions we've been having about the universal settings and what not, here's a little utility that'll allow you to mass change your entire scene's refection subdivs based on how glossy you have them set. It's only working on vray material reflections, and vray mats in multi sub reflections for now, and it's also perhaps a little blunt in that it's using 5 set ranges of glossiness (0.0 - 0.2, 0.2 - 0.4, 0.4 - 0.6, 0.6 - 0.8, 0.8 - 1.0) but hopefully it'll be useful for someone!
The idea is also to change it to give options to work with Bertrand Benoit's setup, as I bought his chicago loft scene and with a lot of carefully tweaked materials, it'd be very time consuming to try and apply the new high subdiv method that we're currently looking at on the forum. I was trying to think of a method that'd work for lights, but since they can vary in size so much I'll have to figure out a better way to divide them into ranges of size to drive subdiv values with. Maybe it's not needed? Maybe refraction wold be more useful next?
Either way copy and paste this to your maxscript editor, select it all and drag it to a tool bar. It's provided as is and hopefully uses such simple code that it won't do any damage to a scene, but as ever it's worth keeping a copy of a scene in case you want to get your old values back.
Based on the discussions we've been having about the universal settings and what not, here's a little utility that'll allow you to mass change your entire scene's refection subdivs based on how glossy you have them set. It's only working on vray material reflections, and vray mats in multi sub reflections for now, and it's also perhaps a little blunt in that it's using 5 set ranges of glossiness (0.0 - 0.2, 0.2 - 0.4, 0.4 - 0.6, 0.6 - 0.8, 0.8 - 1.0) but hopefully it'll be useful for someone!
The idea is also to change it to give options to work with Bertrand Benoit's setup, as I bought his chicago loft scene and with a lot of carefully tweaked materials, it'd be very time consuming to try and apply the new high subdiv method that we're currently looking at on the forum. I was trying to think of a method that'd work for lights, but since they can vary in size so much I'll have to figure out a better way to divide them into ranges of size to drive subdiv values with. Maybe it's not needed? Maybe refraction wold be more useful next?
Either way copy and paste this to your maxscript editor, select it all and drag it to a tool bar. It's provided as is and hopefully uses such simple code that it won't do any damage to a scene, but as ever it's worth keeping a copy of a scene in case you want to get your old values back.
Code:
/* Script to give a global control to set all material subdivs based on how glossy the material's reflections are. No respnsibility taken for any errors this script may cause. Written badly by John O'Connell - http://www.joconnell.com Stick thoughts or comments on the vray forums if you have ideas on features! */ try(destroydialog SetVraySamples)catch() Function setVrayMatSubdivs TheMat glossy_02 glossy_04 glossy_06 glossy_08 glossy_10 = ( case of ( (TheMat.reflection_glossiness >= 0.0 and TheMat.reflection_glossiness < 0.2): TheMat.reflection_subdivs = glossy_02 (TheMat.reflection_glossiness >= 0.2 and TheMat.reflection_glossiness < 0.4): TheMat.reflection_subdivs = glossy_04 (TheMat.reflection_glossiness >= 0.4 and TheMat.reflection_glossiness < 0.6): TheMat.reflection_subdivs = glossy_06 (TheMat.reflection_glossiness >= 0.6 and TheMat.reflection_glossiness < 0.8): TheMat.reflection_subdivs = glossy_08 (TheMat.reflection_glossiness >= 0.8 and TheMat.reflection_glossiness < 1.0): TheMat.reflection_subdivs = glossy_10 ) ) rollout SetVraySamples "Set VrayMat Samples" ( Group "Material sample amounts" ( spinner glossy_00_to_02 "Glossiness 0.0 to 0.2" range:[00,5000,100] align:#right type:#integer spinner glossy_02_to_04 "Glossiness 0.2 to 0.4" range:[00,5000,80] align:#right type:#integer spinner glossy_04_to_06 "Glossiness 0.4 to 0.6" range:[00,5000,60] align:#right type:#integer spinner glossy_06_to_08 "Glossiness 0.6 to 0.8" range:[00,5000,40] align:#right type:#integer spinner glossy_08_to_10 "Glossiness 0.8 to 1.0" range:[00,5000,20] align:#right type:#integer button DoubleVraySamples "Double samples" width:180 align:#left button HalfVraySamples "Half samples" width:180 align:#right offset:[0,-26] ) button SetVraySamples "Set Sample amounts" width:200 align:#right on DoubleVraySamples pressed do ( glossy_00_to_02.value = glossy_00_to_02.value*2 glossy_02_to_04.value = glossy_02_to_04.value*2 glossy_04_to_06.value = glossy_04_to_06.value*2 glossy_06_to_08.value = glossy_06_to_08.value*2 glossy_08_to_10.value = glossy_08_to_10.value*2 ) on HalfVraySamples pressed do ( glossy_00_to_02.value = glossy_00_to_02.value*0.5 glossy_02_to_04.value = glossy_02_to_04.value*0.5 glossy_04_to_06.value = glossy_04_to_06.value*0.5 glossy_06_to_08.value = glossy_06_to_08.value*0.5 glossy_08_to_10.value = glossy_08_to_10.value*0.5 ) on SetVraySamples pressed do ( for m in scenematerials do ( print m.name print (classof m as string) if (classof m == VrayMtl) then ( setVrayMatSubdivs m glossy_00_to_02.value glossy_02_to_04.value glossy_04_to_06.value glossy_06_to_08.value glossy_08_to_10.value ) -- Stupid messy bit to find multi sub mats theMultiMats = for o in objects where ((classof o.material) == MultiMaterial) collect o for obj in theMultiMats do ( for n = 1 to obj.material.numsubs do ( if (classof obj.material[n] == VrayMtl) then ( setVrayMatSubdivs obj.material[n] glossy_00_to_02.value glossy_02_to_04.value glossy_04_to_06.value glossy_06_to_08.value glossy_08_to_10.value ) ) ) ) ) ) CreateDialog SetVraySamples width: 400
Comment