Browse Source

Add Runtime Light Option

Adds kLPMovable to lights without animation for real-time lamps (for animated objects and kickables).
pull/207/head
Patrick Dulebohn 5 years ago
parent
commit
37ce4ac7b4
  1. 2
      korman/exporter/rtlight.py
  2. 5
      korman/properties/prop_lamp.py
  3. 12
      korman/ui/ui_lamp.py

2
korman/exporter/rtlight.py

@ -193,7 +193,7 @@ class LightConverter:
# If the lamp has any sort of animation attached, then it needs to be marked movable.
# Otherwise, Plasma may not use it for lighting.
if projectors or bo.plasma_object.has_animation_data:
if projectors or bo.plasma_object.has_animation_data or rtlamp.runtime_lamp == True:
pl_light.setProperty(plLightInfo.kLPMovable, True)
# *Sigh*

5
korman/properties/prop_lamp.py

@ -63,6 +63,11 @@ class PlasmaLamp(idprops.IDPropObjectMixin, bpy.types.PropertyGroup):
description="Size of the area for the Area Lamp in the Z direction",
min=0.0, default=200.0,
options=set())
# For Runtime Lights without animation
runtime_lamp = BoolProperty(name="Runtime Lamp",
description="Allows the lamp to cast light in real time",
default=False,
options=set())
def has_light_group(self, bo):
return bool(bo.users_group)

12
korman/ui/ui_lamp.py

@ -67,7 +67,17 @@ class PlasmaShadowPanel(LampButtonsPanel, bpy.types.Panel):
col.prop(rtlamp, "shadow_power")
col.prop(rtlamp, "shadow_falloff")
col.prop(rtlamp, "shadow_distance")
class PlasmaRuntimeLampPanel(LampButtonsPanel, bpy.types.Panel):
bl_label = "Runtime Lamp"
def draw(self, context):
layout = self.layout
rtlamp = context.lamp.plasma_lamp
split = layout.split()
col = split.column()
col.prop(rtlamp, "runtime_lamp")
def _draw_area_lamp(self, context):
"""Draw dispatch function for DATA_PT_area"""

Loading…
Cancel
Save