random light temperature/color

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.

any ideas gratefully received

pg

almost got there:

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?)

Maybe the best approach is to write a script that goes through all selected lights and assigns some random temperature values.

Best regards,
Vlado

probably… can any scripters help me out? I don’t do maxscript!

I thought you were going to say that :slight_smile:

Try the following:

*) 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

madness… so quick!

thanks Vlado, you’re a legend.

Peter,
A quick way of doing this is to use this script here-
http://www.scriptspot.com/3ds-max/scripts/modifier-modifier-zorb

Its a very handy script with an easy to use UI.

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.

Mod mod Zorb is indispensable in some situations. I use it mostly for removing modifiers across many unique objects. Good call, Chris.

zorb is probably the best thing about max (after vray)

That looks really useful, thanks Chris!

tried zorb but get a maxscript error with vraylights.. maybe it needs to be updated for most recent vray?

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.

Best regards,
Vlado