Browse Source

fix for missing axes in scale animation

pull/54/head
Marein Könings 8 years ago
parent
commit
28264156a0
  1. 10
      korman/exporter/animation.py

10
korman/exporter/animation.py

@ -320,14 +320,15 @@ class AnimationConverter:
scale = kwargs.get(scale_path) scale = kwargs.get(scale_path)
# Since only some position curves may be supplied, construct dict with all positions # 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 = dict(enumerate(pos_default))
allscale = dict(enumerate(scale_default))
allpos.update(pos) allpos.update(pos)
allscale.update(scale)
matrix = hsMatrix44() matrix = hsMatrix44()
# Note: scale and pos are dicts, so we can't unpack # Note: scale and pos are dicts, so we can't unpack
matrix.setTranslate(hsVector3(allpos[0], allpos[1], allpos[2])) matrix.setTranslate(hsVector3(allpos[0], allpos[1], allpos[2]))
matrix.setScale(hsVector3(scale[0], scale[1], scale[2])) matrix.setScale(hsVector3(allscale[0], allscale[1], allscale[2]))
return matrix return matrix
fcurves = [i for i in fcurves if i.data_path == pos_path or i.data_path == scale_path] fcurves = [i for i in fcurves if i.data_path == pos_path or i.data_path == scale_path]
@ -672,7 +673,10 @@ class AnimationConverter:
continue continue
for i in range(chan_values): for i in range(chan_values):
if i not in chan_keyframes.values: if i not in chan_keyframes.values:
fcurve = grouped_fcurves[chan][i] if i in grouped_fcurves[chan]:
fcurve = grouped_fcurves[chan][i]
else:
fcurve = defaults[chan][i]
if isinstance(fcurve, bpy.types.FCurve): if isinstance(fcurve, bpy.types.FCurve):
chan_keyframes.values[i] = fcurve.evaluate(chan_keyframes.frame_num_blender) chan_keyframes.values[i] = fcurve.evaluate(chan_keyframes.frame_num_blender)
else: else:

Loading…
Cancel
Save