Fix #143699: Pose library asset shelf does not apply poses
This was quite involved to get to work. Basic idea is to make `bl_activate_operator` work for the pose library asset shelf, and introducing a `bl_drag_operator` for blending poses. - Make pose asset operators take an asset reference, which is how `bl_activate_operator` usually gets the asset to operate on. This way poses references can be assigned to a shortcut, identified by asset library and relative asset path within the library. Falls back to getting the asset from context. - Trigger `bl_activate_operator` on every click, instead of only when an un-active item becomes active. Needed so poses can be re-applied as before. - Fix button context not passed to the `bl_activate_operator` when force-activating, e.g. on right-click events. - Allow registering a `bl_drag_operator` in the asset shelf definition. Executed when dragging an asset in the shelf. - When dragging an asset, highlight it as active, without calling the `bl_activate_operator`. This is important feedback to the user. - Activate/select view items on click instead of drag, so dragging is possible. - Let pose applying operators handle the Ctrl key to apply poses flipped. There's no simple way to attach such alternative behaviors to `bl_activate_operator`/`bl_drag_operator` - Remove keymap items that were there for the previous "hacky" solution to apply & blend poses. Pull Request: https://projects.blender.org/blender/blender/pulls/144023
This commit is contained in:
committed by
Julian Eisel
parent
5d72498154
commit
450f428434
@@ -1042,7 +1042,7 @@ def km_user_interface(_params):
|
||||
("ui.view_scroll", {"type": 'WHEELUPMOUSE', "value": 'ANY'}, None),
|
||||
("ui.view_scroll", {"type": 'WHEELDOWNMOUSE', "value": 'ANY'}, None),
|
||||
("ui.view_scroll", {"type": 'TRACKPADPAN', "value": 'ANY'}, None),
|
||||
("ui.view_item_select", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
|
||||
("ui.view_item_select", {"type": 'LEFTMOUSE', "value": 'CLICK'}, None),
|
||||
("ui.view_item_select", {"type": 'LEFTMOUSE', "value": 'PRESS', "ctrl": True},
|
||||
{"properties": [("extend", True)]}),
|
||||
("ui.view_item_select", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True},
|
||||
|
||||
@@ -420,7 +420,7 @@ def km_user_interface(params):
|
||||
("anim.driver_button_remove", {"type": 'D', "value": 'PRESS', "alt": True}, None),
|
||||
("anim.keyingset_button_add", {"type": 'K', "value": 'PRESS'}, None),
|
||||
("anim.keyingset_button_remove", {"type": 'K', "value": 'PRESS', "alt": True}, None),
|
||||
("ui.view_item_select", {"type": 'LEFTMOUSE', "value": 'PRESS'}, None),
|
||||
("ui.view_item_select", {"type": 'LEFTMOUSE', "value": 'CLICK'}, None),
|
||||
])
|
||||
|
||||
return keymap
|
||||
|
||||
Reference in New Issue
Block a user