Browse Source

Fix Lamp Animation error introduced by #54

The changeset referenced makes the assumption that
`grouped_fcurves[chan]` is a dict. We really can't assume anything about
types this deep inside the animation converter.
pull/66/head
Adam Johnson 8 years ago
parent
commit
1a58ef2ea2
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 15
      korman/exporter/animation.py

15
korman/exporter/animation.py

@ -673,15 +673,16 @@ 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:
if i in grouped_fcurves[chan]: try:
fcurve = grouped_fcurves[chan][i] fcurve = grouped_fcurves[chan][i]
except:
chan_keyframes.values[i] = defaults[chan]
else: 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: # it's actually a default value!
# it's actually a default value! chan_keyframes.values[i] = fcurve
chan_keyframes.values[i] = fcurve
# All values are calculated! Now we convert the disparate key data into a single keyframe. # All values are calculated! Now we convert the disparate key data into a single keyframe.
kwargs = { data_path: keyframe.values for data_path, keyframe in keyframes.items() } kwargs = { data_path: keyframe.values for data_path, keyframe in keyframes.items() }

Loading…
Cancel
Save