diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-09-15 15:34:21 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-09-15 15:34:21 +0300 |
commit | 5c6cc931b2203d97aa9d570ff3b353c2a3dfebed (patch) | |
tree | 458f4ec5ad8cc2c32be83d21c1a557aa0c5ee1f2 /source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c | |
parent | 1bd28a5e0ca6d16c21b6365b389c9c1830635a58 (diff) |
Gizmo: add flag to hide the gizmo group during interaction
This allows a hack to be removed that temporarily overwrote
the 3D views gizmo display flag.
Also reverse change from fb27a9bb983ce74b8d8f5f871cf0706dd1e25051
that runs poll on modal gizmo groups as there is some risk
that the poll function unlinks the gizmo.
Diffstat (limited to 'source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c')
-rw-r--r-- | source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c index 1144cd072e0..295196c701b 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c @@ -387,14 +387,21 @@ static void gizmomap_prepare_drawing(wmGizmoMap *gzmap, LISTBASE_FOREACH (wmGizmoGroup *, gzgroup, &gzmap->groups) { /* check group visibility - drawstep first to avoid unnecessary call of group poll callback */ - if (!wm_gizmogroup_is_visible_in_drawstep(gzgroup, drawstep) || - !WM_gizmo_group_type_poll(C, gzgroup->type)) { + if (!wm_gizmogroup_is_visible_in_drawstep(gzgroup, drawstep)) { continue; } - /* When modal only show other gizmo groups tagged with #WM_GIZMOGROUPTYPE_DRAW_MODAL_ALL. */ - if (gz_modal && (gzgroup != gz_modal->parent_gzgroup)) { - if ((gzgroup->type->flag & WM_GIZMOGROUPTYPE_DRAW_MODAL_ALL) == 0) { + if (gz_modal && (gzgroup == gz_modal->parent_gzgroup)) { + if (gzgroup->type->flag & WM_GIZMOGROUPTYPE_DRAW_MODAL_EXCLUDE) { + continue; + } + } + else { /* Don't poll modal gizmo since some poll functions unlink. */ + if (!WM_gizmo_group_type_poll(C, gzgroup->type)) { + continue; + } + /* When modal only show other gizmo groups tagged with #WM_GIZMOGROUPTYPE_DRAW_MODAL_ALL. */ + if (gz_modal && ((gzgroup->type->flag & WM_GIZMOGROUPTYPE_DRAW_MODAL_ALL) == 0)) { continue; } } |