[Bf-blender-cvs] [08b938a3430] blender-v2.83-release: Fix T61985: NLA Bake exception baking pose with non-pose selection
Campbell Barton
noreply at git.blender.org
Wed Oct 7 10:23:18 CEST 2020
Commit: 08b938a3430be680a1f3369bd291ad522a2651a9
Author: Campbell Barton
Date: Sun Sep 20 13:54:22 2020 +1000
Branches: blender-v2.83-release
https://developer.blender.org/rB08b938a3430be680a1f3369bd291ad522a2651a9
Fix T61985: NLA Bake exception baking pose with non-pose selection
===================================================================
M release/scripts/startup/bl_operators/anim.py
===================================================================
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,
More information about the Bf-blender-cvs
mailing list