From d6072b6689bb2ac02a405575a4b54036be94bf92 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Mon, 22 Feb 2021 15:31:03 -0500 Subject: [PATCH] Fix crash in Path of the Shell related to empty animations. --- korman/properties/modifiers/anim.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/korman/properties/modifiers/anim.py b/korman/properties/modifiers/anim.py index 3f6c4f0..c836df4 100644 --- a/korman/properties/modifiers/anim.py +++ b/korman/properties/modifiers/anim.py @@ -66,12 +66,19 @@ class PlasmaAnimationModifier(ActionModifier, PlasmaModifierProperties): @property def anim_type(self): - return plAgeGlobalAnim if self.obj_sdl_anim else plATCAnim + return plAgeGlobalAnim if self.enabled and self.obj_sdl_anim else plATCAnim def export(self, exporter, bo, so): action = self.blender_action anim_mod = bo.plasma_modifiers.animation - atcanim = exporter.mgr.find_create_object(anim_mod.anim_type, so=so) + + # Do not create the private animation here. The animation converter itself does this + # before we reach this point. If it does not create an animation, then we might create an + # empty animation that crashes Uru. + atcanim = exporter.mgr.find_object(anim_mod.anim_type, so=so) + if atcanim is None: + return + if not isinstance(atcanim, plAgeGlobalAnim): atcanim.autoStart = self.auto_start atcanim.loop = self.loop