Browse Source

Add render layer selection to lightmap modifier

pull/30/head
Adam Johnson 9 years ago
parent
commit
deb80dfd17
  1. 4
      korman/exporter/etlight.py
  2. 8
      korman/properties/modifiers/render.py
  3. 1
      korman/ui/modifiers/render.py

4
korman/exporter/etlight.py

@ -163,9 +163,7 @@ class LightBaker:
mods = i.plasma_modifiers
if mods.lightmap.enabled:
## TODO: customizable render layers
#key = ("lightmap",) + mods.lightmap.render_layers
key = ("lightmap",) + ((True,) * 20)
key = ("lightmap",) + tuple(mods.lightmap.render_layers)
if key in bake:
bake[key].append(i)
else:

8
korman/properties/modifiers/render.py

@ -19,6 +19,7 @@ from bpy.props import *
from PyHSPlasma import *
from .base import PlasmaModifierProperties
from ...exporter.etlight import _NUM_RENDER_LAYERS
from ...exporter import utils
from ...exporter.explosions import ExportError
@ -93,6 +94,13 @@ class PlasmaLightMapGen(PlasmaModifierProperties):
("1024", "1024px", "1024x1024 pixels"),
])
render_layers = BoolVectorProperty(name="Layers",
description="Render layers to use for baking",
options=set(),
subtype="LAYER",
size=_NUM_RENDER_LAYERS,
default=((True,) * _NUM_RENDER_LAYERS))
light_group = StringProperty(name="Light Group",
description="Group that defines the collection of lights to bake")

1
korman/ui/modifiers/render.py

@ -23,6 +23,7 @@ def followmod(modifier, layout, context):
def lightmap(modifier, layout, context):
layout.row(align=True).prop(modifier, "quality", expand=True)
layout.prop(modifier, "render_layers", text="Active Render Layers")
layout.prop_search(modifier, "light_group", bpy.data, "groups", icon="GROUP")
layout.prop_search(modifier, "uv_map", context.active_object.data, "uv_textures")

Loading…
Cancel
Save