Hi all,
I am writing a script that will do this:
1. Check if there are lights in the scene.
2. If there are no lights, create 3 point lighting and then link it to a point helper object.
3. But if there are lights in the scene, don't create new lights, select the lights and pass it into an empty array.
The problems I am having are that I can't seem to get the script to check the scene for lights.
Cheers
/Saij
Here is my code:
(
sLights = #()
if sLights.count != 0
then append sLights (for l in lights where ClassOf l != light collect l) else
fn lightCreate = --Ligh Creator
(
local alignObj = Point pos:[0,0,0] size:25 box:true cross:false Name:"AlignObj"
local keyLight = TargetDirectionallight name:(uniqueName"KeyLight") rgb:(color 255 255 255) shadowColor:(color 0 0 0) multiplier:1 pos:[600,-540,540] isSelected:on target:(Targetobject transform:(matrix3 [1,0,0] [0,1,0] [0,0,1] [0,0,0]))
local fillLight = targetSpot name:(uniqueName "FillLight_" rgb:(color 255 255 255) multiplier:0.5 pos:[-890,-630,410] isSelected:on target:(Targetobject transform:(matrix3 [1,0,0] [0,1,0] [0,0,1] [0,0,0]))
local rimLight = targetSpot name:(uniqueName "RimLight_") rgb:(color 255 255 255) multiplier:0.3 pos:[-100,890,70] isSelected:on target:(Targetobject transform:(matrix3 [1,0,0] [0,1,0] [0,0,1] [0,0,0]))
lightArray = (for l in lights where ClassOf l != light collect l)
lightArray.parent = alignObj
)
append sLights (lightCreate())
)
barigazy · 2013-01-12
Anubis · 2013-01-12