|
@@ -2,6 +2,8 @@
|
|
AnimationPlayer as well as distribute Blender action into various
|
|
AnimationPlayer as well as distribute Blender action into various
|
|
action exporting functions"""
|
|
action exporting functions"""
|
|
|
|
|
|
|
|
+import bpy
|
|
|
|
+import mathutils
|
|
from .action import (
|
|
from .action import (
|
|
export_camera_action,
|
|
export_camera_action,
|
|
export_shapekey_action,
|
|
export_shapekey_action,
|
|
@@ -94,6 +96,7 @@ class ObjectAnimationExporter:
|
|
ActionStrip(active_action),
|
|
ActionStrip(active_action),
|
|
self.animation_player.active_animation
|
|
self.animation_player.active_animation
|
|
)
|
|
)
|
|
|
|
+ self.clear_action_effect()
|
|
|
|
|
|
if not self.need_baking:
|
|
if not self.need_baking:
|
|
# here export unmuted nla_tracks into animation resource,
|
|
# here export unmuted nla_tracks into animation resource,
|
|
@@ -109,6 +112,7 @@ class ObjectAnimationExporter:
|
|
ActionStrip(strip),
|
|
ActionStrip(strip),
|
|
self.animation_player.active_animation
|
|
self.animation_player.active_animation
|
|
)
|
|
)
|
|
|
|
+ self.clear_action_effect()
|
|
|
|
|
|
def export_active_action_from_nla(self, escn_file, export_settings):
|
|
def export_active_action_from_nla(self, escn_file, export_settings):
|
|
"""Export all unmute nla_tracks into an active action.
|
|
"""Export all unmute nla_tracks into an active action.
|
|
@@ -128,6 +132,7 @@ class ObjectAnimationExporter:
|
|
ActionStrip(strip),
|
|
ActionStrip(strip),
|
|
self.animation_player.active_animation
|
|
self.animation_player.active_animation
|
|
)
|
|
)
|
|
|
|
+ self.clear_action_effect()
|
|
|
|
|
|
def export_stashed_track(self, escn_file, export_settings, stashed_track):
|
|
def export_stashed_track(self, escn_file, export_settings, stashed_track):
|
|
"""Export a muted nla_track, track with all its contained action
|
|
"""Export a muted nla_track, track with all its contained action
|
|
@@ -160,6 +165,7 @@ class ObjectAnimationExporter:
|
|
ActionStrip(strip),
|
|
ActionStrip(strip),
|
|
anim_resource
|
|
anim_resource
|
|
)
|
|
)
|
|
|
|
+ self.clear_action_effect()
|
|
|
|
|
|
if self.need_baking:
|
|
if self.need_baking:
|
|
stashed_track.mute = True
|
|
stashed_track.mute = True
|
|
@@ -175,6 +181,15 @@ class ObjectAnimationExporter:
|
|
ActionStrip(strip),
|
|
ActionStrip(strip),
|
|
anim_resource
|
|
anim_resource
|
|
)
|
|
)
|
|
|
|
+ self.clear_action_effect()
|
|
|
|
+
|
|
|
|
+ def clear_action_effect(self):
|
|
|
|
+ """Clear side effect of exporting an action"""
|
|
|
|
+ if (isinstance(self.blender_object, bpy.types.Object) and
|
|
|
|
+ self.blender_object.pose is not None):
|
|
|
|
+ for pose_bone in self.blender_object.pose.bones:
|
|
|
|
+ rest_bone = pose_bone.bone
|
|
|
|
+ pose_bone.matrix_basis = mathutils.Matrix.Identity(4)
|
|
|
|
|
|
|
|
|
|
def export_animation_data(escn_file, export_settings, godot_node,
|
|
def export_animation_data(escn_file, export_settings, godot_node,
|