diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_wm_gizmo.c | 7 | ||||
-rw-r--r-- | source/blender/windowmanager/gizmo/WM_gizmo_types.h | 16 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 2 |
3 files changed, 17 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_wm_gizmo.c b/source/blender/makesrna/intern/rna_wm_gizmo.c index d4ac7f64941..742d3da27ac 100644 --- a/source/blender/makesrna/intern/rna_wm_gizmo.c +++ b/source/blender/makesrna/intern/rna_wm_gizmo.c @@ -401,6 +401,7 @@ RNA_GIZMO_GENERIC_FLAG_RW_DEF(flag_use_draw_offset_scale, flag, WM_GIZMO_DRAW_OF RNA_GIZMO_GENERIC_FLAG_NEG_RW_DEF(flag_use_draw_scale, flag, WM_GIZMO_DRAW_OFFSET_SCALE); RNA_GIZMO_GENERIC_FLAG_RW_DEF(flag_hide, flag, WM_GIZMO_HIDDEN); RNA_GIZMO_GENERIC_FLAG_RW_DEF(flag_hide_select, flag, WM_GIZMO_HIDDEN_SELECT); +RNA_GIZMO_GENERIC_FLAG_RW_DEF(flag_hide_keymap, flag, WM_GIZMO_HIDDEN_KEYMAP); RNA_GIZMO_GENERIC_FLAG_RW_DEF(flag_use_grab_cursor, flag, WM_GIZMO_MOVE_CURSOR); RNA_GIZMO_GENERIC_FLAG_RW_DEF(flag_use_select_background, flag, WM_GIZMO_SELECT_BACKGROUND); RNA_GIZMO_GENERIC_FLAG_RW_DEF(flag_use_operator_tool_properties, @@ -1203,6 +1204,12 @@ static void rna_def_gizmo(BlenderRNA *brna, PropertyRNA *cprop) prop, "rna_Gizmo_flag_hide_select_get", "rna_Gizmo_flag_hide_select_set"); RNA_def_property_ui_text(prop, "Hide Select", ""); RNA_def_property_update(prop, 0, "rna_Gizmo_update_redraw"); + /* WM_GIZMO_HIDDEN_KEYMAP */ + prop = RNA_def_property(srna, "hide_keymap", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs( + prop, "rna_Gizmo_flag_hide_keymap_get", "rna_Gizmo_flag_hide_keymap_set"); + RNA_def_property_ui_text(prop, "Hide Keymap", "Ignore the key-map for this gizmo"); + RNA_def_property_update(prop, 0, "rna_Gizmo_update_redraw"); /* WM_GIZMO_MOVE_CURSOR */ prop = RNA_def_property(srna, "use_grab_cursor", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs( diff --git a/source/blender/windowmanager/gizmo/WM_gizmo_types.h b/source/blender/windowmanager/gizmo/WM_gizmo_types.h index e79031193c2..346ed131c59 100644 --- a/source/blender/windowmanager/gizmo/WM_gizmo_types.h +++ b/source/blender/windowmanager/gizmo/WM_gizmo_types.h @@ -67,31 +67,33 @@ typedef enum eWM_GizmoFlag { WM_GIZMO_DRAW_VALUE = (1 << 2), WM_GIZMO_HIDDEN = (1 << 3), WM_GIZMO_HIDDEN_SELECT = (1 << 4), + /** Ignore the key-map for this gizmo. */ + WM_GIZMO_HIDDEN_KEYMAP = (1 << 5), /** * When set 'scale_final' value also scales the offset. * Use when offset is to avoid screen-space overlap instead of absolute positioning. */ - WM_GIZMO_DRAW_OFFSET_SCALE = (1 << 5), + WM_GIZMO_DRAW_OFFSET_SCALE = (1 << 6), /** * User should still use 'scale_final' for any handles and UI elements. * This simply skips scale when calculating the final matrix. * Needed when the gizmo needs to align with the interface underneath it. */ - WM_GIZMO_DRAW_NO_SCALE = (1 << 6), + WM_GIZMO_DRAW_NO_SCALE = (1 << 7), /** * Hide the cursor and lock it's position while interacting with this gizmo. */ - WM_GIZMO_MOVE_CURSOR = (1 << 7), + WM_GIZMO_MOVE_CURSOR = (1 << 8), /** Don't write into the depth buffer when selecting. */ - WM_GIZMO_SELECT_BACKGROUND = (1 << 8), + WM_GIZMO_SELECT_BACKGROUND = (1 << 9), /** Use the active tools operator properties when running as an operator. */ - WM_GIZMO_OPERATOR_TOOL_INIT = (1 << 9), + WM_GIZMO_OPERATOR_TOOL_INIT = (1 << 10), /** Don't pass through events to other handlers * (allows click/drag not to have it's events stolen by press events in other keymaps). */ - WM_GIZMO_EVENT_HANDLE_ALL = (1 << 10), + WM_GIZMO_EVENT_HANDLE_ALL = (1 << 11), /** Don't use tool-tips for this gizmo (can be distracting). */ - WM_GIZMO_NO_TOOLTIP = (1 << 11), + WM_GIZMO_NO_TOOLTIP = (1 << 12), } eWM_GizmoFlag; /** diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 54498b21369..e5f288b1963 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -2602,7 +2602,7 @@ static int wm_handlers_do_gizmo_handler(bContext *C, if (handle_keymap) { /* Handle highlight gizmo. */ - if (gz != NULL) { + if ((gz != NULL) && (gz->flag & WM_GIZMO_HIDDEN_KEYMAP) == 0) { bool keymap_poll = false; wmGizmoGroup *gzgroup = gz->parent_gzgroup; wmKeyMap *keymap = WM_keymap_active(wm, gz->keymap ? gz->keymap : gzgroup->type->keymap); |