ScriptSpot

Forum topic · General Scripting

Add Vray lights to Vray Fog with Array.

By edgemaster · 2016-06-06

Downloads
Description

Well I'm getting back into scripting and learning as I go. I still need assistance on getting this to work though. I usually have trouble with getting into the deeper part of scripting for Vray.

I have this so far but I don't know how to get array part to work. I tried to add a picture if this helps. All I want is to add a group of selected VRay lights to the VRayEnvironmentFog list and turn off all lights for now. And I could have this written wrong to start with for all I know.

Vat = getAtmospheric 1

Vat.use_all_lights = true

for obj in (selection as array)
where classOf obj == lights do
(
Vat.lights --what goes here?
)

Comments (2)

edgemaster · 2016-06-09

Pixamoon So now I'm having trouble knowing where do I place the (add) to include these lights to the list in the Environments Panel. Sorry I'm still learning on getting max script to vray.

And thanks for your help!

`

pixamoon · 2016-06-07

Hey,

Try this one (for all kind of lights):


Vat = getAtmospheric 1

Vat.use_all_lights = true

Vat.lights = for obj in selection where SuperClassOf obj == light collect obj

or if you want to add just VRayLights:


Vat = getAtmospheric 1

Vat.use_all_lights = true

Vat.lights = for obj in selection where ClassOf obj == VRayLight collect obj

Best,