Anim: Pose Library - Allow blending flipped from the context menu

This adds the `Blend Pose Flipped` option to the
context menu of the pose library.
The operator already accepted a flipped property,
it was just missing a dedicated menu entry for that.

In order for this to work, the modal operator had to be modified.
Instead of setting the flipped state, pressing `Ctrl` now acts as a toggle.
That means that if the operator has been started in flipped mode,
pressing and holding `Ctrl` will unflip it.

This has been a point of discussion in the A&R module meeting
https://devtalk.blender.org/t/2024-05-14-animation-rigging-module-meeting/34614#ux-quirks-in-the-pose-library-shelf-5

Pull Request: https://projects.blender.org/blender/blender/pulls/121857
This commit is contained in:
Christoph Lendenfeld
2024-05-21 11:08:22 +02:00
committed by Christoph Lendenfeld
parent 58f5b128c9
commit 3a40d2813f
2 changed files with 13 additions and 10 deletions

View File

@@ -52,7 +52,8 @@ class VIEW3D_AST_pose_library(bpy.types.AssetShelf):
layout.operator("poselib.apply_pose_asset", text="Apply Pose Flipped").flipped = True
with operator_context(layout, 'INVOKE_DEFAULT'):
layout.operator("poselib.blend_pose_asset", text="Blend Pose")
layout.operator("poselib.blend_pose_asset", text="Blend Pose").flipped = False
layout.operator("poselib.blend_pose_asset", text="Blend Pose Flipped").flipped = True
layout.separator()
props = layout.operator("poselib.pose_asset_select_bones", text="Select Pose Bones")
@@ -110,7 +111,8 @@ def pose_library_list_item_context_menu(self: UIList, context: Context) -> None:
layout.operator("poselib.apply_pose_asset", text="Apply Pose Flipped").flipped = True
with operator_context(layout, 'INVOKE_DEFAULT'):
layout.operator("poselib.blend_pose_asset", text="Blend Pose")
layout.operator("poselib.blend_pose_asset", text="Blend Pose").flipped = False
layout.operator("poselib.blend_pose_asset", text="Blend Pose Flipped").flipped = True
layout.separator()
props = layout.operator("poselib.pose_asset_select_bones", text="Select Pose Bones")