Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-09-15 15:34:21 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-09-15 15:34:21 +0300
commit5c6cc931b2203d97aa9d570ff3b353c2a3dfebed (patch)
tree458f4ec5ad8cc2c32be83d21c1a557aa0c5ee1f2 /source/blender/editors/mesh
parent1bd28a5e0ca6d16c21b6365b389c9c1830635a58 (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/editors/mesh')
-rw-r--r--source/blender/editors/mesh/editmesh_bevel.c10
-rw-r--r--source/blender/editors/mesh/editmesh_bisect.c11
-rw-r--r--source/blender/editors/mesh/editmesh_inset.c10
3 files changed, 2 insertions, 29 deletions
diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c
index cdbbdd820b7..0d74187b50e 100644
--- a/source/blender/editors/mesh/editmesh_bevel.c
+++ b/source/blender/editors/mesh/editmesh_bevel.c
@@ -97,7 +97,6 @@ typedef struct {
int launch_event;
float mcenter[2];
void *draw_handle_pixel;
- short gizmo_flag;
short value_mode; /* Which value does mouse movement and numeric input affect? */
float segments; /* Segments as float so smooth mouse pan works in small increments */
@@ -307,11 +306,6 @@ static bool edbm_bevel_init(bContext *C, wmOperator *op, const bool is_modal)
opdata->draw_handle_pixel = ED_region_draw_cb_activate(
region->type, ED_region_draw_mouse_line_cb, opdata->mcenter, REGION_DRAW_POST_PIXEL);
G.moving = G_TRANSFORM_EDIT;
-
- if (v3d) {
- opdata->gizmo_flag = v3d->gizmo_flag;
- v3d->gizmo_flag |= V3D_GIZMO_HIDE_DEFAULT_MODAL;
- }
}
return true;
@@ -433,15 +427,11 @@ static void edbm_bevel_exit(bContext *C, wmOperator *op)
}
if (opdata->is_modal) {
- View3D *v3d = CTX_wm_view3d(C);
ARegion *region = CTX_wm_region(C);
for (uint ob_index = 0; ob_index < opdata->ob_store_len; ob_index++) {
EDBM_redo_state_free(&opdata->ob_store[ob_index].mesh_backup);
}
ED_region_draw_cb_exit(region->type, opdata->draw_handle_pixel);
- if (v3d) {
- v3d->gizmo_flag = opdata->gizmo_flag;
- }
G.moving = 0;
}
MEM_SAFE_FREE(opdata->ob_store);
diff --git a/source/blender/editors/mesh/editmesh_bisect.c b/source/blender/editors/mesh/editmesh_bisect.c
index f525f2c2e91..5cb57594ec3 100644
--- a/source/blender/editors/mesh/editmesh_bisect.c
+++ b/source/blender/editors/mesh/editmesh_bisect.c
@@ -72,7 +72,6 @@ typedef struct {
bool is_dirty;
} * backup;
int backup_len;
- short gizmo_flag;
} BisectData;
static void mesh_bisect_interactive_calc(bContext *C,
@@ -157,8 +156,6 @@ static int mesh_bisect_invoke(bContext *C, wmOperator *op, const wmEvent *event)
}
if (ret & OPERATOR_RUNNING_MODAL) {
- View3D *v3d = CTX_wm_view3d(C);
-
wmGesture *gesture = op->customdata;
BisectData *opdata;
@@ -181,8 +178,6 @@ static int mesh_bisect_invoke(bContext *C, wmOperator *op, const wmEvent *event)
/* Misc other vars. */
G.moving = G_TRANSFORM_EDIT;
- opdata->gizmo_flag = v3d->gizmo_flag;
- v3d->gizmo_flag |= V3D_GIZMO_HIDE_DEFAULT_MODAL;
/* Initialize modal callout. */
ED_workspace_status_text(C, TIP_("LMB: Click and drag to draw cut line"));
@@ -191,10 +186,8 @@ static int mesh_bisect_invoke(bContext *C, wmOperator *op, const wmEvent *event)
return ret;
}
-static void edbm_bisect_exit(bContext *C, BisectData *opdata)
+static void edbm_bisect_exit(BisectData *opdata)
{
- View3D *v3d = CTX_wm_view3d(C);
- v3d->gizmo_flag = opdata->gizmo_flag;
G.moving = 0;
for (int ob_index = 0; ob_index < opdata->backup_len; ob_index++) {
@@ -225,7 +218,7 @@ static int mesh_bisect_modal(bContext *C, wmOperator *op, const wmEvent *event)
}
if (ret & (OPERATOR_FINISHED | OPERATOR_CANCELLED)) {
- edbm_bisect_exit(C, &opdata_back);
+ edbm_bisect_exit(&opdata_back);
#ifdef USE_GIZMO
/* Setup gizmos */
diff --git a/source/blender/editors/mesh/editmesh_inset.c b/source/blender/editors/mesh/editmesh_inset.c
index 159e84db4ef..7be169f70f4 100644
--- a/source/blender/editors/mesh/editmesh_inset.c
+++ b/source/blender/editors/mesh/editmesh_inset.c
@@ -76,7 +76,6 @@ typedef struct {
int launch_event;
float mcenter[2];
void *draw_handle_pixel;
- short gizmo_flag;
} InsetData;
static void edbm_inset_update_header(wmOperator *op, bContext *C)
@@ -177,7 +176,6 @@ static bool edbm_inset_init(bContext *C, wmOperator *op, const bool is_modal)
opdata->num_input.unit_type[1] = B_UNIT_LENGTH;
if (is_modal) {
- View3D *v3d = CTX_wm_view3d(C);
ARegion *region = CTX_wm_region(C);
for (uint ob_index = 0; ob_index < opdata->ob_store_len; ob_index++) {
@@ -189,10 +187,6 @@ static bool edbm_inset_init(bContext *C, wmOperator *op, const bool is_modal)
opdata->draw_handle_pixel = ED_region_draw_cb_activate(
region->type, ED_region_draw_mouse_line_cb, opdata->mcenter, REGION_DRAW_POST_PIXEL);
G.moving = G_TRANSFORM_EDIT;
- if (v3d) {
- opdata->gizmo_flag = v3d->gizmo_flag;
- v3d->gizmo_flag |= V3D_GIZMO_HIDE_DEFAULT_MODAL;
- }
}
return true;
@@ -206,15 +200,11 @@ static void edbm_inset_exit(bContext *C, wmOperator *op)
opdata = op->customdata;
if (opdata->is_modal) {
- View3D *v3d = CTX_wm_view3d(C);
ARegion *region = CTX_wm_region(C);
for (uint ob_index = 0; ob_index < opdata->ob_store_len; ob_index++) {
EDBM_redo_state_free(&opdata->ob_store[ob_index].mesh_backup);
}
ED_region_draw_cb_exit(region->type, opdata->draw_handle_pixel);
- if (v3d) {
- v3d->gizmo_flag = opdata->gizmo_flag;
- }
G.moving = 0;
}