Has anyone scripted? (or can quickly script!)
A way of changing the multiplier in the vray light material on multiple selected object/materials.
Ideally what would be great is:
I have say 10 objects each with there own vray light material with a different map in the first slot. Then I can say select 5 of the objects and change the multiplier light value in the material all to perhaps 100.
I’m thinking it would be useful for controlling multiple plane objects with self illuminating images on - for use in shop fronts etc.
I have 100 of shops to deal with someone help me !!!
If every object has his own unique material then you can “mass-change” their light multiplier the following way:
- Select the objects you want to change their light multiplier
- Run this script from maxcript listener: $.material.multiplier = X
( change X for value you want multiplier to be )
The problem would be if you want to apply different multipliers to objects with the same material…
That’s because one of the objects you had selected did not have a material property (like a light/camera, etc)
Run this
objs = getCurrentSelection()
for o in objs do (
if (isProperty o #material) then (
if (isProperty o.material #multiplier) then (
o.material.multiplier = X -- alternatively, you can multiply it by itself like
o.material.multiplier = o.material.multiplier * 2
format "object: % multiplier changed to: %\n" o.name o.material.multiplier
)
)
)
This code will make sure the object you are trying to do that to has a material and a multiplier property first then if it does change it’s value!
-- Mass VRayLightMaterial Multiplier Updater
-- by Codi
Rollout light_mult "Mass Multiplier Updater"
(
spinner mult_value "Multiplier: " type:#float fieldWidth:50 range:[0,30000,1]
button apply_mult "Change Multiplier" width:120 align:#center
on apply_mult pressed do
(
for obj in $ do
(
if (obj.material != undefined) then
(
if (classof obj.material as string == "VRayLightMtl") then
(
obj.material.multiplier = mult_value.value
format "Object % material multiplier changed to %\n" obj.name mult_value.value
)
else
(
if (classof obj.material as string== "Multimaterial") then
(
for i = 1 to obj.material.numsubs do
(
if ( classof obj.material.materialList[i] as string == "VRayLightMtl") then
(
obj.material.materialList[i].multiplier = mult_value.value
format "Object % submaterial % multiplier changed to %\n" (obj.name as string) i mult_value.value
)
else (
format "Object % submaterial % isn't a VRayLightMaterial\n" (obj.name as string) i
)
)
)
else (
format "(Object % has no proper material assigned)\n" obj.name
)
)
)
else
(
format "(Object % has no material)\n" obj.name
)
)
)
)
if light_mult_floater != undefined then CloseRolloutFloater light_mult_floater
light_mult_floater = newRolloutFloater "VRayLightMtl Tool" 180 100
addRollout light_mult light_mult_floater
To “install” it you just have to select all the text inside the Code box and drag the selection in your toolbar.
If the script finds a selected object with VrayLightMaterial it changes the multiplier value, and if it finds an object with a Multimaterial it will change the multipliers of any VrayLightMaterial it finds on it (it’s not recursive thoug, doesn’t check multimaterials inside multimaterials)
Hope it’s what you need.
BTW, use at your own risk and better save a copy of your work before runing this script.
The vraylightmtl will almost be made void soon when Vlado finishes ( if he hasnt already) proper mesh based vraylights. So any mesh can be a vraylight so vraylightmtl will not be used as much anymore.
Well the primary difference between a vraylight and a vraylightmtl is that the vraylight is a direct light and vraylightmtl is a GI light, thus alot slower and not as clean to render without high GI settings.
The vray mesh lights will be direct lights like the vray area lights, but just with the advantages of the vraylightmtl being that you can use it on any mesh shape.
But in this case surely there will still be a place for the vray light mtl as it will be faster in animations for example when you actually want to save the light in a stored GI solution?