Fix T100879: Bake Action fails with "Nothing to Bake"
When applying the "Bake Action" operator in pose mode it could throw an error saying "Nothing to Bake" even though bones are selected That is because the code was looking for a selected armature But in Pose Mode, clicking into empty space to de-select would also deselect the armature. Then box selecting would not make the armature selected again Reviewed by: Sybren A. Stüvel Differential Revision: https://developer.blender.org/D16593
This commit is contained in:
Submodule release/datafiles/locale updated: ef57e2c2c6...4a581c54af
Submodule release/scripts/addons updated: bde68da02f...0b0052bd53
Submodule release/scripts/addons_contrib updated: e6179b3b11...96143b1a8b
@@ -252,9 +252,14 @@ class NLA_OT_bake(Operator):
|
||||
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]
|
||||
if do_pose and self.only_selected:
|
||||
pose_bones = context.selected_pose_bones or []
|
||||
armatures = {pose_bone.id_data for pose_bone in pose_bones}
|
||||
objects = list(armatures)
|
||||
else:
|
||||
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]
|
||||
|
||||
Reference in New Issue
Block a user