Compare commits

...

3 Commits

Author SHA1 Message Date
Adam Johnson b919e5ca05
Fix regression introduced by typo in #400. 3 months ago
Adam Johnson 2b689610e3
Fix #401. 3 months ago
Adam Johnson 4414f2de3d
Allow vertex colors to modulate lightmaps. (#404) 3 months ago
  1. 18
      korman/exporter/mesh.py
  2. 2
      korman/nodes/node_messages.py
  3. 4
      korman/render.py
  4. 2
      korman/ui/ui_camera.py

18
korman/exporter/mesh.py

@ -384,7 +384,7 @@ class MeshConverter(_MeshManager):
# Locate relevant vertex color layers now...
lm = bo.plasma_modifiers.lightmap
color = None if lm.bake_lightmap else self._find_vtx_color_layer(mesh.tessface_vertex_colors)
color = self._find_vtx_color_layer(mesh.tessface_vertex_colors, autocolor=not lm.bake_lightmap, manual=True)
alpha = self._find_vtx_alpha_layer(mesh.tessface_vertex_colors)
# Convert Blender faces into things we can stuff into libHSPlasma
@ -717,13 +717,15 @@ class MeshConverter(_MeshManager):
return alpha_layer.data
return None
def _find_vtx_color_layer(self, color_collection):
manual_layer = next((i for i in color_collection if i.name.lower() in _VERTEX_COLOR_LAYERS), None)
if manual_layer is not None:
return manual_layer.data
baked_layer = color_collection.get("autocolor")
if baked_layer is not None:
return baked_layer.data
def _find_vtx_color_layer(self, color_collection, autocolor: bool = True, manual: bool = True):
if manual:
manual_layer = next((i for i in color_collection if i.name.lower() in _VERTEX_COLOR_LAYERS), None)
if manual_layer is not None:
return manual_layer.data
if autocolor:
baked_layer = color_collection.get("autocolor")
if baked_layer is not None:
return baked_layer.data
return None
def is_nonpreshaded(self, bo: bpy.types.Object, bm: bpy.types.Material) -> bool:

2
korman/nodes/node_messages.py

@ -54,7 +54,7 @@ class PlasmaMessageNode(PlasmaNodeBase):
class PlasmaMessageWithCallbacksNode(PlasmaMessageNode):
soutput_sockets: dict[str, dict[str, str]] = {
output_sockets: dict[str, dict[str, str]] = {
"msgs": {
"can_link": "can_link_callback",
"text": "Send On Completion",

4
korman/render.py

@ -59,6 +59,10 @@ properties_data_lamp.DATA_PT_falloff_curve.COMPAT_ENGINES.add("PLASMA_GAME")
properties_data_lamp.DATA_PT_custom_props_lamp.COMPAT_ENGINES.add("PLASMA_GAME")
del properties_data_lamp
from bl_ui import properties_data_camera
properties_data_camera.DATA_PT_lens.COMPAT_ENGINES.add("PLASMA_GAME")
del properties_data_camera
from bl_ui import properties_render
_whitelist_all(properties_render)
del properties_render

2
korman/ui/ui_camera.py

@ -226,7 +226,7 @@ class PlasmaCameraAnimationPanel(CameraButtonsPanel, bpy.types.Panel):
class PlasmaCameraViewPanel(CameraButtonsPanel, bpy.types.Panel):
bl_label = "Camera Lens"
bl_label = "Lens (Plasma)"
def draw(self, context):
camera = context.camera.plasma_camera

Loading…
Cancel
Save