From 0c155267e46a2139fdceb528a9aa54c00039035a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marein=20K=C3=B6nings?= Date: Fri, 17 Feb 2017 18:30:16 +0100 Subject: [PATCH] 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) --- korman/exporter/animation.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/korman/exporter/animation.py b/korman/exporter/animation.py index 385df77..3a1b82c 100644 --- a/korman/exporter/animation.py +++ b/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