Notifications
Clear all
[Closed] Select all spotlights
Jun 02, 2009 6:37 pm
Hi,
I want a button that will add all the spotlights in a scene into an array. But for the life of me I can’t work out how to do it.
Sorry for being a bit of a newbie
Thanks in advance
Garry
3 Replies
Jun 02, 2009 6:37 pm
Hi Garry,
following code cycles through every light in the scene and collects in an array all TargetSpots and FreeSpots.
(
aSpotlights = for item in lights where ( (classOf item == TargetSpot) or (classOf item == FreeSpot) ) collect item
print aSpotlights
)
- Enrico
Jun 02, 2009 6:37 pm
Hi Enrico,
Thanks again for the help, I don’t think I’d have been able to work this out too quickly.
Cheers
Garry
Jun 02, 2009 6:37 pm
You can also do…
(getClassInstances TargetSpot) + (getClassInstances FreeSpot)