Browse Source

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.
pull/219/head
Patrick Dulebohn 4 years ago
parent
commit
c5552f890c
  1. 52
      korman/properties/modifiers/anim.py

52
korman/properties/modifiers/anim.py

@ -67,33 +67,37 @@ class PlasmaAnimationModifier(ActionModifier, PlasmaModifierProperties):
def export(self, exporter, bo, so): def export(self, exporter, bo, so):
action = self.blender_action action = self.blender_action
atcanim = exporter.mgr.find_create_object(plATCAnim, so=so) anim_data = bo.plasma_modifiers.animation
atcanim.autoStart = self.auto_start if anim_data.obj_sdl_anim:
atcanim.loop = self.loop atcanim = exporter.mgr.find_create_object(plAgeGlobalAnim, so=so)
else:
# Simple start and loop info atcanim = exporter.mgr.find_create_object(plATCAnim, so=so)
if action is not None: atcanim.autoStart = self.auto_start
markers = action.pose_markers atcanim.loop = self.loop
initial_marker = markers.get(self.initial_marker)
if initial_marker is not None: # Simple start and loop info for ATC
atcanim.initial = _convert_frame_time(initial_marker.frame) if action is not None:
else: markers = action.pose_markers
atcanim.initial = -1.0 initial_marker = markers.get(self.initial_marker)
if self.loop: if initial_marker is not None:
loop_start = markers.get(self.loop_start) atcanim.initial = _convert_frame_time(initial_marker.frame)
if loop_start is not None:
atcanim.loopStart = _convert_frame_time(loop_start.frame)
else: 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 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 atcanim.loopEnd = atcanim.end
else:
if self.loop:
atcanim.loopStart = atcanim.start
atcanim.loopEnd = atcanim.end
class AnimGroupObject(idprops.IDPropObjectMixin, bpy.types.PropertyGroup): class AnimGroupObject(idprops.IDPropObjectMixin, bpy.types.PropertyGroup):

Loading…
Cancel
Save