Anyone got any good ideas for how to randomly assign different colors/temps to vraylights? I tried with a vraymultisubtex and changing the object id of lights but no worky.
Also tried geometry and vraylightmtl with vraymultisubtex but that didnt work either.
geometry with random matIDs and a multi sub object material with lots of different vraylightmtls inside. BUT direct illumination doesnt work when nested inside a multi sub-object. (is this a bug?)
*) Go to MaxScript > New script and paste this:```
fn randomLightColors minTemp maxTemp = (
local numSelected=$.count
for i=1 to numSelected do (
if (hasProperty $[i] “color_temperature”) then (
$[i].color_mode=1
$[i].color_temperature=random minTemp maxTemp
)
)
)
Press Ctrl+E (or Tools > Evaluate All in the MaxScript editor)
\*) Select your lights, open the MaxScript listener and type `randomLightColors 3000 7000` and press Enter. This will assign random temperatures between 3000 and 7000 to the selected lights (which must be copies, not instances obviously).
Best regards,
Vlado
It works with materials/lights/xrefs and everything else!
I use it mainly for doing lots of randomised UVW stuff and random variations on light colours and intensities.
You can use similar ideas with these scripts to randomize all sorts of similar things. I did this to randomise lights turning on in a huge residential tower for a timelapse animation. Worked amazingly well - very convincing effect.
Personally, the better solution would either be a (new) randomizable node to be plugged into the light as a map and let the lights behave with some published info these “random” maps can read.
This actually touches on an issue larger than this one, as there are too many non-compatible randomizers out there (I’m referring to stuff that randomizes parametrically and not scripts that modify stuff on a one time basis).
Randomization is such an essential part of what we do, that I would like to see Vray have it’s own set of standardized “hooks” for other plugins to read from. ObjID, MatID don’t always cut it, and they are a part of the max core.
Vray and plugins for vray do things with geometry etc. today that go far beyond what people envisioned when they came up with obj and mat IDs. and thus we end up with a ratsnest of 3rd party plugins that don’t always work.
Is this something that exists in the VraySDK but is under utilized, or not at all?
Would it be an interesting addition?
We will probably implement the same approach as in Maya with the V-Ray user attributes, where you can put stuff as custom node properties and then read them through a special texture.