diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-12-17 06:55:41 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-12-17 06:55:41 +0300 |
commit | aa1af7f8e40e9f67f40bb4bf96756b83d2b0189a (patch) | |
tree | f700ae1b68dcf9f55d92b0cf1a85190ccf560cb7 /source/blender/windowmanager/intern/wm_event_system.c | |
parent | 2564e2a2ad9605398322e3ac2c7c49cc78e0a8f0 (diff) |
Fix T72416: Tool settings ignored when activated from gizmo
Diffstat (limited to 'source/blender/windowmanager/intern/wm_event_system.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 01f80ab9297..4117c036dcb 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -2265,9 +2265,18 @@ static int wm_handler_operator_call(bContext *C, bool use_last_properties = true; PointerRNA tool_properties = {0}; - bToolRef *keymap_tool = ((handler_base->type == WM_HANDLER_TYPE_KEYMAP) ? - ((wmEventHandler_Keymap *)handler_base)->keymap_tool : - NULL); + bToolRef *keymap_tool = NULL; + if (handler_base->type == WM_HANDLER_TYPE_KEYMAP) { + keymap_tool = ((wmEventHandler_Keymap *)handler_base)->keymap_tool; + } + else if (handler_base->type == WM_HANDLER_TYPE_GIZMO) { + wmGizmoMap *gizmo_map = ((wmEventHandler_Gizmo *)handler_base)->gizmo_map; + wmGizmo *gz = wm_gizmomap_highlight_get(gizmo_map); + if (gz && (gz->flag & WM_GIZMO_OPERATOR_TOOL_INIT)) { + keymap_tool = WM_toolsystem_ref_from_context(C); + } + } + const bool is_tool = (keymap_tool != NULL); const bool use_tool_properties = is_tool; |