From 9a82d3279354963af03a2be803cbafdeef8c69b9 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Fri, 23 Apr 2021 21:52:20 -0400 Subject: [PATCH] Fix #238. --- korman/exporter/animation.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/korman/exporter/animation.py b/korman/exporter/animation.py index e37b653..f8c6d3c 100644 --- a/korman/exporter/animation.py +++ b/korman/exporter/animation.py @@ -318,10 +318,18 @@ class AnimationConverter: # libHSPlasma assumes a channel is not shared among applicators... # so yes, we must convert the same animation data again and again. - channel = plScalarControllerChannel() - channel.controller = self.make_scalar_leaf_controller(fcurve, convert=convert_volume) - applicator.channel = channel - yield applicator + # To make matters worse, the way that these keyframes are stored can cause + # the animation to evaluate to a no-op. Be ready for that. + controller = self.make_scalar_leaf_controller(fcurve, convert=convert_volume) + if controller is not None: + channel = plScalarControllerChannel() + channel.controller = controller + applicator.channel = channel + yield applicator + else: + self._exporter().report.warn("[{}]: Volume animation evaluated to zero keyframes!", + sound.sound.name, indent=2) + break def _convert_spot_lamp_animation(self, name, fcurves, lamp): if not fcurves: