diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-09-20 06:54:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-09-20 07:00:14 +0300 |
commit | 56748dbbcdb21aa6d764ee56988032e4796bce11 (patch) | |
tree | 61453a64227d0b1fc0fee4b0987e8b2b38544adb /release/scripts/startup/bl_operators/anim.py | |
parent | 7d2a67f25818f76800d508d55dcac7c4055cf774 (diff) |
Fix T61985: NLA Bake exception baking pose with non-pose selection
Diffstat (limited to 'release/scripts/startup/bl_operators/anim.py')
-rw-r--r-- | release/scripts/startup/bl_operators/anim.py | 10 |
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, |