If you're interested, I have modified my own PyPRP copy to assign lights to objects based on any group an object has in common with a light. In prp_DrawClasses.py, replace this:
- Code: Select all
# Only add lights for this icicle if we are not "SHADELESS"
if not mat.mode & Blender.Material.Modes["SHADELESS"]:
if not lightGroup == None:
# if a lightgroup is set, use those lights, else use all lights in the page....
for pllamp in lights:
for lobj in list(lightGroup.objects):
dataname = lobj.getData(True) # First param sets return of name only
if str(pllamp.data.Key.name) == lobj.name or str(pllamp.data.Key.name) == dataname:
mylights.append(pllamp)
with this:
- Code: Select all
# Only add lights for this icicle if we are not "SHADELESS"
if not mat.mode & Blender.Material.Modes["SHADELESS"]:
for group in Blender.Group.Get(): #get list of groups
if obj in list(group.objects):
#current object is in current group
for pllamp in lights:
if (not pllamp in mylights):
#go through all lamps not already appended
for lobj in list(group.objects):
if str(pllamp.data.Key.name) == lobj.name or str(pllamp.data.Key.name) == lobj.getData(True):
mylights.append(pllamp)
EDIT: One other thing--if you've installed PyCo, you have to delete all the .pyc files in the PyPRP directory before this change will take effect.
The other thing you should know is that by default, *no* lights will affect any objects--you'll have to put all of your outdoor objects in a group with your sun and your indoor objects in a group with your indoor lights.
Also, as was mentioned, this won't affect avatars--you'll have to use SoftVolumes for that.
EDIT2: One other thing I should add--if your sun(or, for that matter, any of your other lights) doesn't animate at all, you should probably just use vertex painting to simulate the effect.
EDIT3: Unlike the current code, my code uses the groups under "Objects and Links," NOT lightgroups.