From f2d415d14c105da8d4cdfd920e404c6802597b6f Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Fri, 30 Dec 2016 14:39:06 -0800 Subject: [PATCH] Fix exporting lamp animations If you had only transform animations on a lamp, it would still attempt to unconditionally export colour/falloff animations. --- korman/exporter/animation.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/korman/exporter/animation.py b/korman/exporter/animation.py index 4698393..73048c0 100644 --- a/korman/exporter/animation.py +++ b/korman/exporter/animation.py @@ -148,6 +148,9 @@ class AnimationConverter: yield applicator def _convert_omni_lamp_animation(self, name, fcurves, lamp): + if not fcurves: + return None + energy_fcurve = next((i for i in fcurves if i.data_path == "energy"), None) distance_fcurve = next((i for i in fcurves if i.data_path == "distance"), None) if energy_fcurve is None and distance_fcurve is None: @@ -231,6 +234,9 @@ class AnimationConverter: yield applicator def _convert_spot_lamp_animation(self, name, fcurves, lamp): + if not fcurves: + return None + blend_fcurve = next((i for i in fcurves if i.data_path == "spot_blend"), None) size_fcurve = next((i for i in fcurves if i.data_path == "spot_size"), None) if blend_fcurve is None and size_fcurve is None: