Browse Source

Don't truncate matrix44 controllers

pull/10/head
Adam Johnson 9 years ago
parent
commit
e7827e0c52
  1. 9
      korman/exporter/animation.py
  2. 4
      korman/exporter/material.py

9
korman/exporter/animation.py

@ -14,6 +14,7 @@
# along with Korman. If not, see <http://www.gnu.org/licenses/>. # along with Korman. If not, see <http://www.gnu.org/licenses/>.
import bpy import bpy
import itertools
import math import math
import mathutils import mathutils
from PyHSPlasma import * from PyHSPlasma import *
@ -54,8 +55,12 @@ class AnimationConverter:
# a lot of temporary objects, but until I see profiling results that this is terrible, I prefer # a lot of temporary objects, but until I see profiling results that this is terrible, I prefer
# to have code that makes sense. # to have code that makes sense.
keyframes = [] keyframes = []
for pos, scale in zip(pos_keyframes, scale_keyframes): for pos, scale in itertools.zip_longest(pos_keyframes, scale_keyframes, fillvalue=None):
if pos.frame_num == scale.frame_num: if pos is None:
keyframes.append((None, scale))
elif scale is None:
keyframes.append((pos, scale))
elif pos.frame_num == scale.frame_num:
keyframes.append((pos, scale)) keyframes.append((pos, scale))
elif pos.frame_num < scale.frame_num: elif pos.frame_num < scale.frame_num:
keyframes.append((pos, None)) keyframes.append((pos, None))

4
korman/exporter/material.py

@ -349,8 +349,8 @@ class MaterialConverter:
return None return None
def _export_layer_transform_animation(self, bm, tex_slot, base_layer, 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]
# Plasma uses the controller to generate a matrix44... so we have to produce a leaf controller # Plasma uses the controller to generate a matrix44... so we have to produce a leaf controller
ctrl = self._exporter().animation.make_matrix44_controller(pos_fcurves, scale_fcurves, tex_slot.offset, tex_slot.scale) ctrl = self._exporter().animation.make_matrix44_controller(pos_fcurves, scale_fcurves, tex_slot.offset, tex_slot.scale)

Loading…
Cancel
Save