Browse Source

Opacity animations require alpha blending

pull/10/head
Adam Johnson 9 years ago
parent
commit
62bf783990
  1. 7
      korman/exporter/material.py

7
korman/exporter/material.py

@ -307,7 +307,7 @@ class MaterialConverter:
# and chain this biotch up as best we can. # and chain this biotch up as best we can.
layer_animation = None layer_animation = None
for attr, converter in self._animation_exporters.items(): for attr, converter in self._animation_exporters.items():
ctrl = converter(bm, tex_slot, fcurves) ctrl = converter(bm, tex_slot, base_layer, fcurves)
if ctrl is not None: if ctrl is not None:
if layer_animation is None: if layer_animation is None:
name = "{}_LayerAnim".format(base_layer.key.name) name = "{}_LayerAnim".format(base_layer.key.name)
@ -340,14 +340,15 @@ class MaterialConverter:
# Well, we had some FCurves but they were garbage... Too bad. # Well, we had some FCurves but they were garbage... Too bad.
return base_layer return base_layer
def _export_layer_opacity_animation(self, bm, tex_slot, fcurves): def _export_layer_opacity_animation(self, bm, tex_slot, base_layer, fcurves):
for i in fcurves: for i in fcurves:
if i.data_path == "plasma_layer.opacity": if i.data_path == "plasma_layer.opacity":
base_layer.state.blendFlags |= hsGMatState.kBlendAlpha
ctrl = self._exporter().animation.make_scalar_leaf_controller(i) ctrl = self._exporter().animation.make_scalar_leaf_controller(i)
return ctrl return ctrl
return None return None
def _export_layer_transform_animation(self, bm, tex_slot, fcurves): def _export_layer_transform_animation(self, bm, tex_slot, base_layer, fcurves):
pos_fcurves = (i for i in fcurves if i.data_path.find("offset") != -1) pos_fcurves = (i for i in fcurves if i.data_path.find("offset") != -1)
scale_fcurves = (i for i in fcurves if i.data_path.find("scale") != -1) scale_fcurves = (i for i in fcurves if i.data_path.find("scale") != -1)

Loading…
Cancel
Save