Browse Source

Use collision bounds in PanicLinkRegion modifier

pull/9/head
Adam Johnson 10 years ago
parent
commit
515c4f6b44
  1. 11
      korman/properties/modifiers/region.py
  2. 9
      korman/ui/modifiers/region.py

11
korman/properties/modifiers/region.py

@ -120,20 +120,13 @@ class PlasmaPanicLinkRegion(PlasmaModifierProperties):
play_anim = BoolProperty(name="Play Animation",
description="Play the link-out animation when panic linking",
default=True)
exact_bounds = BoolProperty(name="Exact Bounds",
description="Use exact (triangle mesh) bounds -- only use if your mesh is not convex",
default=False)
def created(self, obj):
self.display_name = "{}_PanicLinkRgn".format(obj.name)
def export(self, exporter, bo, so):
# Generate the base physical object
if self.exact_bounds:
bounds = "trimesh"
else:
bounds = "hull"
simIface, physical = exporter.physics.generate_physical(bo, so, bounds, self.display_name)
phys_mod = bo.plasma_modifiers.collision
simIface, physical = exporter.physics.generate_physical(bo, so, phys_mod.bounds, self.display_name)
# Now setup the region detector properties
physical.memberGroup = plSimDefs.kGroupDetector

9
korman/ui/modifiers/region.py

@ -18,9 +18,6 @@ def footstep(modifier, layout, context):
layout.prop(modifier, "surface")
def paniclink(modifier, layout, context):
split = layout.split()
col = split.column()
col.prop(modifier, "exact_bounds")
col = split.column()
col.prop(modifier, "play_anim")
phys_mod = context.object.plasma_modifiers.collision
layout.prop(phys_mod, "bounds")
layout.prop(modifier, "play_anim")

Loading…
Cancel
Save