Browse Source

Alert on triangle mesh regions.

This makes the bounds selection RED when a region is marked as triangle
mesh. The export will succeed for TPotS but fail for Myst V and MOUL.
pull/336/head
Adam Johnson 3 years ago
parent
commit
87cc4e8d1b
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 4
      korman/nodes/node_conditions.py
  2. 14
      korman/ui/modifiers/region.py

4
korman/nodes/node_conditions.py

@ -174,7 +174,9 @@ class PlasmaClickableRegionNode(idprops.IDPropObjectMixin, PlasmaNodeBase, bpy.t
def draw_buttons(self, context, layout):
layout.prop(self, "region_object", icon="MESH_DATA")
layout.alert = self.bounds == "trimesh"
layout.prop(self, "bounds")
layout.alert = False
def convert_subcondition(self, exporter, parent_bo, parent_so, logicmod):
# REMEMBER: parent_so doesn't have to be the actual region scene object...
@ -379,7 +381,9 @@ class PlasmaVolumeSensorNode(idprops.IDPropObjectMixin, PlasmaNodeBase, bpy.type
# Okay, if they changed the name of the ObData, that's THEIR problem...
layout.prop(self, "region_object", icon="MESH_DATA")
layout.alert = self.bounds == "trimesh"
layout.prop(self, "bounds")
layout.alert = False
def get_key(self, exporter, parent_so):
bo = self.region_object

14
korman/ui/modifiers/region.py

@ -16,6 +16,12 @@
import bpy
from .. import ui_camera
def _draw_bounds_prop(modifier, layout, context, *, local_prop: bool = False):
prop_source = modifier if local_prop else modifier.id_data.plasma_modifiers.collision
layout.alert = prop_source.bounds == "trimesh"
layout.prop(prop_source, "bounds")
layout.alert = False
def camera_rgn(modifier, layout, context):
layout.prop(modifier, "camera_type")
if modifier.camera_type == "manual":
@ -35,12 +41,11 @@ def camera_rgn(modifier, layout, context):
ui_camera.draw_camera_manipulation_props))
def footstep(modifier, layout, context):
layout.prop(modifier, "bounds")
_draw_bounds_prop(modifier, layout, context, local_prop=True)
layout.prop(modifier, "surface")
def paniclink(modifier, layout, context):
phys_mod = context.object.plasma_modifiers.collision
layout.prop(phys_mod, "bounds")
_draw_bounds_prop(modifier, layout, context)
layout.prop(modifier, "play_anim")
def softvolume(modifier, layout, context):
@ -61,6 +66,5 @@ def softvolume(modifier, layout, context):
def subworld_rgn(modifier, layout, context):
layout.prop(modifier, "subworld")
collision_mod = modifier.id_data.plasma_modifiers.collision
layout.prop(collision_mod, "bounds")
_draw_bounds_prop(modifier, layout, context)
layout.prop(modifier, "transition")

Loading…
Cancel
Save