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:
authorCampbell Barton <ideasman42@gmail.com>2020-09-20 06:54:22 +0300
committerJeroen Bakker <jeroen@blender.org>2020-09-21 10:48:26 +0300
commit9ec325b59d54091f437689ebdfbc3f74ad46108d (patch)
treecf892ce6755ab6b80736ed1a2182400194a905f6
parentbe8935852bd17d55c52b2416035d1c729a487f33 (diff)
Fix T61985: NLA Bake exception baking pose with non-pose selection
-rw-r--r--release/scripts/startup/bl_operators/anim.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/release/scripts/startup/bl_operators/anim.py b/release/scripts/startup/bl_operators/anim.py
index d55644f19c7..d0b4b485d82 100644
--- a/release/scripts/startup/bl_operators/anim.py
+++ b/release/scripts/startup/bl_operators/anim.py
@@ -260,7 +260,13 @@ class NLA_OT_bake(Operator):
def execute(self, context):
from bpy_extras import anim_utils
+ do_pose = 'POSE' in self.bake_types
+ do_object = 'OBJECT' in self.bake_types
+
objects = context.selected_editable_objects
+ if do_pose and not do_object:
+ objects = [obj for obj in objects if obj.pose is not None]
+
object_action_pairs = (
[(obj, getattr(obj.animation_data, "action", None)) for obj in objects]
if self.use_current_action else
@@ -271,8 +277,8 @@ class NLA_OT_bake(Operator):
object_action_pairs,
frames=range(self.frame_start, self.frame_end + 1, self.step),
only_selected=self.only_selected,
- do_pose='POSE' in self.bake_types,
- do_object='OBJECT' in self.bake_types,
+ do_pose=do_pose,
+ do_object=do_object,
do_visual_keying=self.visual_keying,
do_constraint_clear=self.clear_constraints,
do_parents_clear=self.clear_parents,