3D View: move gizmo draw options out of overlays
Gizmo's now have their own popover in preparation for making transform gizmos accessible without having to use tools See: T63518
This commit is contained in:
@@ -1581,9 +1581,7 @@ void DRW_draw_render_loop_ex(
|
||||
|
||||
if (DST.draw_ctx.evil_C) {
|
||||
/* needed so gizmo isn't obscured */
|
||||
if (((v3d->flag2 & V3D_HIDE_OVERLAYS) == 0) &&
|
||||
((v3d->gizmo_flag & V3D_GIZMO_HIDE) == 0))
|
||||
{
|
||||
if ((v3d->gizmo_flag & V3D_GIZMO_HIDE) == 0) {
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
DRW_draw_gizmo_3d();
|
||||
}
|
||||
@@ -1601,7 +1599,7 @@ void DRW_draw_render_loop_ex(
|
||||
GPU_depth_test(true);
|
||||
}
|
||||
|
||||
if ((v3d->flag2 & V3D_HIDE_OVERLAYS) == 0) {
|
||||
if ((v3d->gizmo_flag & V3D_GIZMO_HIDE) == 0) {
|
||||
/* Draw 2D after region info so we can draw on top of the camera passepartout overlay.
|
||||
* 'DRW_draw_region_info' sets the projection in pixel-space. */
|
||||
GPU_depth_test(false);
|
||||
|
@@ -91,9 +91,7 @@ static bool edbm_preselect_or_active(
|
||||
BMElem **r_ele)
|
||||
{
|
||||
ARegion *ar = CTX_wm_region(C);
|
||||
const bool show_gizmo = !(
|
||||
(v3d->flag2 & V3D_HIDE_OVERLAYS) ||
|
||||
(v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_TOOL)));
|
||||
const bool show_gizmo = !((v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_TOOL)));
|
||||
|
||||
wmGizmoMap *gzmap = show_gizmo ? ar->gizmo_map : NULL;
|
||||
wmGizmoGroup *gzgroup = gzmap ? WM_gizmomap_group_find(gzmap, "VIEW3D_GGT_mesh_preselect_elem") : NULL;
|
||||
|
@@ -1324,7 +1324,6 @@ void view3d_draw_region_info(const bContext *C, ARegion *ar)
|
||||
BLF_batch_draw_begin();
|
||||
|
||||
if ((U.uiflag & USER_SHOW_GIZMO_AXIS) ||
|
||||
(v3d->flag2 & V3D_HIDE_OVERLAYS) ||
|
||||
/* No need to display gizmo and this info. */
|
||||
(v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_NAVIGATE)))
|
||||
{
|
||||
|
@@ -125,9 +125,7 @@ static void gizmo_bbone_offset_set(
|
||||
static bool WIDGETGROUP_armature_spline_poll(const bContext *C, wmGizmoGroupType *UNUSED(gzgt))
|
||||
{
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
if ((v3d->flag2 & V3D_HIDE_OVERLAYS) ||
|
||||
(v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_CONTEXT)))
|
||||
{
|
||||
if (v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_CONTEXT)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -61,9 +61,7 @@ struct CameraWidgetGroup {
|
||||
static bool WIDGETGROUP_camera_poll(const bContext *C, wmGizmoGroupType *UNUSED(gzgt))
|
||||
{
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
if ((v3d->flag2 & V3D_HIDE_OVERLAYS) ||
|
||||
(v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_CONTEXT)))
|
||||
{
|
||||
if (v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_CONTEXT)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -374,9 +372,7 @@ static bool WIDGETGROUP_camera_view_poll(const bContext *C, wmGizmoGroupType *UN
|
||||
}
|
||||
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
if ((v3d->flag2 & V3D_HIDE_OVERLAYS) ||
|
||||
(v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_CONTEXT)))
|
||||
{
|
||||
if (v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_CONTEXT)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -106,9 +106,7 @@ static bool WIDGETGROUP_empty_image_poll(const bContext *C, wmGizmoGroupType *UN
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
RegionView3D *rv3d = CTX_wm_region_view3d(C);
|
||||
|
||||
if ((v3d->flag2 & V3D_HIDE_OVERLAYS) ||
|
||||
(v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_CONTEXT)))
|
||||
{
|
||||
if (v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_CONTEXT)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -49,9 +49,7 @@ static bool WIDGETGROUP_forcefield_poll(const bContext *C, wmGizmoGroupType *UNU
|
||||
{
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
|
||||
if ((v3d->flag2 & V3D_HIDE_OVERLAYS) ||
|
||||
(v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_CONTEXT)))
|
||||
{
|
||||
if (v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_CONTEXT)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -51,9 +51,7 @@
|
||||
static bool WIDGETGROUP_light_spot_poll(const bContext *C, wmGizmoGroupType *UNUSED(gzgt))
|
||||
{
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
if ((v3d->flag2 & V3D_HIDE_OVERLAYS) ||
|
||||
(v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_CONTEXT)))
|
||||
{
|
||||
if (v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_CONTEXT)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -121,13 +121,11 @@ static bool WIDGETGROUP_navigate_poll(const bContext *C, wmGizmoGroupType *UNUSE
|
||||
{
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
if (((U.uiflag & USER_SHOW_GIZMO_AXIS) == 0) ||
|
||||
(v3d->flag2 & V3D_HIDE_OVERLAYS) ||
|
||||
(v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_NAVIGATE)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
static void WIDGETGROUP_navigate_setup(const bContext *UNUSED(C), wmGizmoGroup *gzgroup)
|
||||
|
@@ -1042,9 +1042,7 @@ static int view3d_ruler_add_invoke(bContext *C, wmOperator *op, const wmEvent *e
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
RegionView3D *rv3d = ar->regiondata;
|
||||
|
||||
if ((v3d->flag2 & V3D_HIDE_OVERLAYS) ||
|
||||
(v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_TOOL)))
|
||||
{
|
||||
if (v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_TOOL)) {
|
||||
BKE_report(op->reports, RPT_WARNING, "Gizmos hidden in this view");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
@@ -1107,9 +1105,7 @@ static int view3d_ruler_remove_invoke(bContext *C, wmOperator *op, const wmEvent
|
||||
ARegion *ar = CTX_wm_region(C);
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
|
||||
if ((v3d->flag2 & V3D_HIDE_OVERLAYS) ||
|
||||
(v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_TOOL)))
|
||||
{
|
||||
if (v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_TOOL)) {
|
||||
BKE_report(op->reports, RPT_WARNING, "Gizmos hidden in this view");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
Reference in New Issue
Block a user