From c5552f890ccc6f9ad09a66fdf0e7f6c24efb7d64 Mon Sep 17 00:00:00 2001 From: Patrick Dulebohn Date: Fri, 9 Oct 2020 12:30:30 -0400 Subject: [PATCH] Separate ATC and AgeGlobal in Props Separates ATC and AgeGlobal animtaions so we don't get any doubles between the two. Also, AgeGlobal doesn't need auto start and loop values as it does that automatically. --- korman/properties/modifiers/anim.py | 52 ++++++++++++++++------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/korman/properties/modifiers/anim.py b/korman/properties/modifiers/anim.py index 5ce8a41..f59b853 100644 --- a/korman/properties/modifiers/anim.py +++ b/korman/properties/modifiers/anim.py @@ -67,33 +67,37 @@ class PlasmaAnimationModifier(ActionModifier, PlasmaModifierProperties): def export(self, exporter, bo, so): action = self.blender_action - atcanim = exporter.mgr.find_create_object(plATCAnim, so=so) - atcanim.autoStart = self.auto_start - atcanim.loop = self.loop - - # Simple start and loop info - if action is not None: - markers = action.pose_markers - initial_marker = markers.get(self.initial_marker) - if initial_marker is not None: - atcanim.initial = _convert_frame_time(initial_marker.frame) - else: - atcanim.initial = -1.0 - if self.loop: - loop_start = markers.get(self.loop_start) - if loop_start is not None: - atcanim.loopStart = _convert_frame_time(loop_start.frame) + anim_data = bo.plasma_modifiers.animation + if anim_data.obj_sdl_anim: + atcanim = exporter.mgr.find_create_object(plAgeGlobalAnim, so=so) + else: + atcanim = exporter.mgr.find_create_object(plATCAnim, so=so) + atcanim.autoStart = self.auto_start + atcanim.loop = self.loop + + # Simple start and loop info for ATC + if action is not None: + markers = action.pose_markers + initial_marker = markers.get(self.initial_marker) + if initial_marker is not None: + atcanim.initial = _convert_frame_time(initial_marker.frame) else: + atcanim.initial = -1.0 + if self.loop: + loop_start = markers.get(self.loop_start) + if loop_start is not None: + atcanim.loopStart = _convert_frame_time(loop_start.frame) + else: + atcanim.loopStart = atcanim.start + loop_end = markers.get(self.loop_end) + if loop_end is not None: + atcanim.loopEnd = _convert_frame_time(loop_end.frame) + else: + atcanim.loopEnd = atcanim.end + else: + if self.loop: atcanim.loopStart = atcanim.start - loop_end = markers.get(self.loop_end) - if loop_end is not None: - atcanim.loopEnd = _convert_frame_time(loop_end.frame) - else: atcanim.loopEnd = atcanim.end - else: - if self.loop: - atcanim.loopStart = atcanim.start - atcanim.loopEnd = atcanim.end class AnimGroupObject(idprops.IDPropObjectMixin, bpy.types.PropertyGroup):