Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2015-05-26 16:30:34 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-05-26 16:32:06 +0300
commit6973e26bf92ed927e20c3ae986dc01f7d287a84a (patch)
tree73cb6c739def4af0dd467f643a0e2501e80fa720 /release/scripts
parenta23fbc71a1886e9f83fd1d6782050d5a8c356d13 (diff)
Fix T44036: Add option to bake into current action instead of creating a new one.
This is needed when you want to bake only part of an armature's bones, since they all share a single action, otherwise you'd lose non-baked bones' animation...
Diffstat (limited to 'release/scripts')
-rw-r--r--release/scripts/startup/bl_operators/anim.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_operators/anim.py b/release/scripts/startup/bl_operators/anim.py
index 1b3e719b2bd..ed7423f0615 100644
--- a/release/scripts/startup/bl_operators/anim.py
+++ b/release/scripts/startup/bl_operators/anim.py
@@ -210,6 +210,12 @@ class BakeAction(Operator):
description="Bake animation onto the object then clear parents (objects only)",
default=False,
)
+ use_current_action = BoolProperty(
+ name="Overwrite Current Action",
+ description="Bake animation into current action, instead of creating a new one "
+ "(useful for baking only part of bones in an armature)",
+ default=False,
+ )
bake_types = EnumProperty(
name="Bake Data",
description="Which data's transformations to bake",
@@ -224,6 +230,12 @@ class BakeAction(Operator):
from bpy_extras import anim_utils
+ action = None
+ if self.use_current_action:
+ obj = bpy.context.object
+ if obj.animation_data:
+ action = obj.animation_data.action
+
action = anim_utils.bake_action(self.frame_start,
self.frame_end,
frame_step=self.step,
@@ -234,6 +246,7 @@ class BakeAction(Operator):
do_constraint_clear=self.clear_constraints,
do_parents_clear=self.clear_parents,
do_clean=True,
+ action=action,
)
if action is None: