Add Vray lights to Vray Fog with Array.

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

AttachmentSize
vrayenvironmentfog_0002.jpg111.76 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
edgemaster's picture

Pixamoon So now I'm having

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's picture

`

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,

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.