|
|
|
@ -72,6 +72,10 @@ class AnimationConverter:
|
|
|
|
|
# There is a race condition in the client with animation loading. It expects for modifiers |
|
|
|
|
# to be listed on the SceneObject in a specific order. D'OH! So, always use these funcs. |
|
|
|
|
agmod, agmaster = self.get_anigraph_objects(bo, so) |
|
|
|
|
anim_data = bo.plasma_modifiers.animation |
|
|
|
|
if anim_data.obj_sdl_anim: |
|
|
|
|
atcanim = self._mgr.find_create_object(plAgeGlobalAnim, so=so) |
|
|
|
|
else: |
|
|
|
|
atcanim = self._mgr.find_create_object(plATCAnim, so=so) |
|
|
|
|
|
|
|
|
|
# Add the animation data to the ATC |
|
|
|
@ -89,14 +93,23 @@ class AnimationConverter:
|
|
|
|
|
if i is not None: |
|
|
|
|
yield i.frame_range[index] |
|
|
|
|
atcanim.name = "(Entire Animation)" |
|
|
|
|
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: |
|
|
|
|
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))) |
|
|
|
|
|
|
|
|
|
# Marker points |
|
|
|
|
if obj_action is not None: |
|
|
|
|
if obj_action is not None and anim_data.obj_sdl_anim is None: |
|
|
|
|
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 |
|
|
|
|