Browse Source

Move animated physical code into anim post_export + remove a useless test

pull/28/head
jb 8 years ago
parent
commit
e15eccfac5
  1. 2
      korman/exporter/material.py
  2. 8
      korman/exporter/physics.py
  3. 9
      korman/properties/modifiers/anim.py

2
korman/exporter/material.py

@ -166,7 +166,7 @@ class MaterialConverter:
if slot.use_stencil:
hsgmat.compFlags |= hsGMaterial.kCompNeedsBlendChannel
state.blendFlags |= hsGMatState.kBlendAlpha | hsGMatState.kBlendAlphaMult | hsGMatState.kBlendNoTexColor
if slot.texture and slot.texture.type == "BLEND":
if slot.texture.type == "BLEND":
state.clampFlags |= hsGMatState.kClampTexture
state.ZFlags |= hsGMatState.kZNoZWrite
layer.ambient = hsColorRGBA(1.0, 1.0, 1.0, 1.0)

8
korman/exporter/physics.py

@ -77,14 +77,6 @@ class PhysicsConverter:
physical.sceneNode = self._mgr.get_scene_node(bl=bo)
getattr(self, "_export_{}".format(bounds))(bo, physical)
if self._exporter().has_coordiface(bo):
if not physical.mass:
# ...Since the object has a coordinate interface but isn't a kickable, it's likely going to be animated. In such case,
# we must warn Plasma to have the collisions follow the object's coordinates as well.
physical.mass = 1.
simIface.setProperty(plSimulationInterface.kPinned, True)
physical.setProperty(plSimulationInterface.kPinned, True)
else:
simIface = so.sim.object
physical = simIface.physical.object

9
korman/properties/modifiers/anim.py

@ -143,6 +143,15 @@ class PlasmaAnimationModifier(PlasmaModifierProperties):
# If the mass is zero, then we will fail to animate. Fix that.
if phys.mass == 0.0:
phys.mass = 1.0
# On CC and Prime, set kPinned so it doesn't fall through
if bpy.context.scene.world.plasma_age.version in ["pvPots", "pvPrime"]:
sim.setProperty(plSimulationInterface.kPinned, True)
phys.setProperty(plSimulationInterface.kPinned, True)
# Do the same for children objects
for child in so.coord.object.children:
self.post_export(exporter, None, child.object)
class AnimGroupObject(bpy.types.PropertyGroup):

Loading…
Cancel
Save