Browse Source

fix for missing axes in position animation

fix animation exporter not being able to handle position animation with missing axes (e.g. an animation with only a curve for the X axis)
pull/54/head
Marein Könings 8 years ago
parent
commit
0c155267e4
  1. 7
      korman/exporter/animation.py

7
korman/exporter/animation.py

@ -319,9 +319,14 @@ class AnimationConverter:
pos = kwargs.get(pos_path)
scale = kwargs.get(scale_path)
# Since only some position curves may be supplied, construct dict with all positions
# TODO: probably the same is needed for scale but I don't need it now!
allpos = dict(enumerate(pos_default))
allpos.update(pos)
matrix = hsMatrix44()
# Note: scale and pos are dicts, so we can't unpack
matrix.setTranslate(hsVector3(pos[0], pos[1], pos[2]))
matrix.setTranslate(hsVector3(allpos[0], allpos[1], allpos[2]))
matrix.setScale(hsVector3(scale[0], scale[1], scale[2]))
return matrix

Loading…
Cancel
Save