From 5531a191e8eb007a4f080510f2579ff99b0097ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 11 Mar 2024 17:11:14 +0100 Subject: [PATCH] Fix #117798: "Nothing to Bake" when pose object is not selected Use `context.pose_object` when baking a pose, on on top of the objects in `context.selected_editable_objects`. When in pose mode, it's expected that the pose of the active will be baked, regardless of whether the pose object is selected itself. Pull Request: https://projects.blender.org/blender/blender/pulls/119317 --- scripts/startup/bl_operators/anim.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/startup/bl_operators/anim.py b/scripts/startup/bl_operators/anim.py index 5f192338645..289e1f1138f 100644 --- a/scripts/startup/bl_operators/anim.py +++ b/scripts/startup/bl_operators/anim.py @@ -289,6 +289,11 @@ class NLA_OT_bake(Operator): else: objects = context.selected_editable_objects if bake_options.do_pose and not bake_options.do_object: + pose_object = getattr(context, 'pose_object', None) + if pose_object and pose_object not in objects: + # The active object might not be selected, but it is the one in pose mode. + # It can be assumed this pose needs baking. + objects.append(context.pose_object) objects = [obj for obj in objects if obj.pose is not None] object_action_pairs = (