From 6bb0b32a3ceb5e47663df023afcad926ac49a52e Mon Sep 17 00:00:00 2001 From: Patrick Dulebohn Date: Fri, 9 Oct 2020 11:23:28 -0400 Subject: [PATCH] Bring more sanity to animation exporter Rearrange a few things and some sanity checks. --- korman/exporter/animation.py | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/korman/exporter/animation.py b/korman/exporter/animation.py index d71fab9..68ac5d5 100644 --- a/korman/exporter/animation.py +++ b/korman/exporter/animation.py @@ -22,7 +22,7 @@ import weakref from . import utils -class AnimationConverter: +class AnimationConverter(plAGAnim): def __init__(self, exporter): self._exporter = weakref.ref(exporter) self._bl_fps = bpy.context.scene.render.fps @@ -75,7 +75,7 @@ class AnimationConverter: anim_data = bo.plasma_modifiers.animation if anim_data.obj_sdl_anim: atcanim = self._mgr.find_create_object(plAgeGlobalAnim, so=so) - else: + elif anim_data.obj_sdl_anim is None: atcanim = self._mgr.find_create_object(plATCAnim, so=so) # Add the animation data to the ATC @@ -96,7 +96,7 @@ class AnimationConverter: if anim_data.obj_sdl_anim: atcanim.start = self._convert_frame_time(min(get_ranges(obj_action, index=0))) atcanim.end = self._convert_frame_time(max(get_ranges(obj_action, index=1))) - else: + elif anim_data.obj_sdl_anim is None: atcanim.start = self._convert_frame_time(min(get_ranges(obj_action, data_action, index=0))) atcanim.end = self._convert_frame_time(max(get_ranges(obj_action, data_action, index=1))) @@ -105,18 +105,17 @@ class AnimationConverter: for marker in obj_action.pose_markers: atcanim.setMarker(marker.name, self._convert_frame_time(marker.frame)) - def set_anim_params(plAGAnim): - sdl_name = bo.plasma_modifiers.animation.obj_sdl_anim - if sdl_name: - atcanim.globalVarName = sdl_name - else: - # Fixme? Not sure if we really need to expose this... - atcanim.easeInMin = 1.0 - atcanim.easeInMax = 1.0 - atcanim.easeInLength = 1.0 - atcanim.easeOutMin = 1.0 - atcanim.easeOutMax = 1.0 - atcanim.easeOutLength = 1.0 + sdl_name = bo.plasma_modifiers.animation.obj_sdl_anim + if sdl_name: + atcanim.globalVarName = sdl_name + elif sdl_name is None: + # Fixme? Not sure if we really need to expose this... + atcanim.easeInMin = 1.0 + atcanim.easeInMax = 1.0 + atcanim.easeInLength = 1.0 + atcanim.easeOutMin = 1.0 + atcanim.easeOutMax = 1.0 + atcanim.easeOutLength = 1.0 def _convert_camera_animation(self, bo, so, obj_fcurves, data_fcurves): if data_fcurves: