diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-15 15:24:10 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-15 15:35:33 +0300 |
commit | b457cae397054a1be4e60f3007995f97c198b2b6 (patch) | |
tree | 317196bf7f809b153c7656ebe9ff310783e1bdb2 /source/blender/editors/mesh | |
parent | b5451a642f2c08519e2ce46e16d3274e1f5dcbd3 (diff) |
Cleanup: use variable names based on term gizmo
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r-- | source/blender/editors/mesh/editmesh_add_gizmo.c | 100 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_bevel.c | 8 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_bisect.c | 110 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_extrude.c | 58 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_extrude_spin.c | 118 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_inset.c | 8 |
6 files changed, 201 insertions, 201 deletions
diff --git a/source/blender/editors/mesh/editmesh_add_gizmo.c b/source/blender/editors/mesh/editmesh_add_gizmo.c index be5c01e08df..6fa0eb33b89 100644 --- a/source/blender/editors/mesh/editmesh_add_gizmo.c +++ b/source/blender/editors/mesh/editmesh_add_gizmo.c @@ -160,14 +160,14 @@ static void gizmo_mesh_placement_update_from_op(GizmoPlacementGroup *man) /* translate callbacks */ static void gizmo_placement_prop_matrix_get( - const wmGizmo *mpr, wmGizmoProperty *mpr_prop, + const wmGizmo *gz, wmGizmoProperty *gz_prop, void *value_p) { - GizmoPlacementGroup *man = mpr->parent_mgroup->customdata; + GizmoPlacementGroup *man = gz->parent_gzgroup->customdata; wmOperator *op = man->data.op; float *value = value_p; - BLI_assert(mpr_prop->type->array_length == 16); - UNUSED_VARS_NDEBUG(mpr_prop); + BLI_assert(gz_prop->type->array_length == 16); + UNUSED_VARS_NDEBUG(gz_prop); if (value_p != man->cage->matrix_offset) { mul_m4_m4m4(value_p, man->cage->matrix_basis, man->cage->matrix_offset); @@ -176,14 +176,14 @@ static void gizmo_placement_prop_matrix_get( } static void gizmo_placement_prop_matrix_set( - const wmGizmo *mpr, wmGizmoProperty *mpr_prop, + const wmGizmo *gz, wmGizmoProperty *gz_prop, const void *value) { - GizmoPlacementGroup *man = mpr->parent_mgroup->customdata; + GizmoPlacementGroup *man = gz->parent_gzgroup->customdata; wmOperator *op = man->data.op; - BLI_assert(mpr_prop->type->array_length == 16); - UNUSED_VARS_NDEBUG(mpr_prop); + BLI_assert(gz_prop->type->array_length == 16); + UNUSED_VARS_NDEBUG(gz_prop); float mat[4][4]; mul_m4_m4m4(mat, man->cage->matrix_basis, value); @@ -197,38 +197,38 @@ static void gizmo_placement_prop_matrix_set( gizmo_placement_exec(man); } -static bool gizmo_mesh_placement_poll(const bContext *C, wmGizmoGroupType *wgt) +static bool gizmo_mesh_placement_poll(const bContext *C, wmGizmoGroupType *gzgt) { wmOperator *op = WM_operator_last_redo(C); if (op == NULL || !STREQ(op->type->idname, "MESH_OT_primitive_cube_add_gizmo")) { - WM_gizmo_group_type_unlink_delayed_ptr(wgt); + WM_gizmo_group_type_unlink_delayed_ptr(gzgt); return false; } return true; } static void gizmo_mesh_placement_modal_from_setup( - const bContext *C, wmGizmoGroup *mgroup) + const bContext *C, wmGizmoGroup *gzgroup) { - GizmoPlacementGroup *man = mgroup->customdata; + GizmoPlacementGroup *man = gzgroup->customdata; /* Initial size. */ { - wmGizmo *mpr = man->cage; - zero_m4(mpr->matrix_offset); - - /* TODO: support zero scaled matrix in 'GIZMO_WT_cage_3d'. */ - mpr->matrix_offset[0][0] = 0.01; - mpr->matrix_offset[1][1] = 0.01; - mpr->matrix_offset[2][2] = 0.01; - mpr->matrix_offset[3][3] = 1.0f; + wmGizmo *gz = man->cage; + zero_m4(gz->matrix_offset); + + /* TODO: support zero scaled matrix in 'GIZMO_GT_cage_3d'. */ + gz->matrix_offset[0][0] = 0.01; + gz->matrix_offset[1][1] = 0.01; + gz->matrix_offset[2][2] = 0.01; + gz->matrix_offset[3][3] = 1.0f; } /* Start off dragging. */ { wmWindow *win = CTX_wm_window(C); ARegion *ar = CTX_wm_region(C); - wmGizmo *mpr = man->cage; + wmGizmo *gz = man->cage; { float mat3[3][3]; @@ -239,19 +239,19 @@ static void gizmo_mesh_placement_modal_from_setup( win->eventstate->y - ar->winrct.ymin, }, location, mat3); - copy_m4_m3(mpr->matrix_basis, mat3); - copy_v3_v3(mpr->matrix_basis[3], location); + copy_m4_m3(gz->matrix_basis, mat3); + copy_v3_v3(gz->matrix_basis[3], location); } if (1) { - wmGizmoMap *mmap = mgroup->parent_mmap; + wmGizmoMap *gzmap = gzgroup->parent_gzmap; WM_gizmo_modal_set_from_setup( - mmap, (bContext *)C, man->cage, ED_GIZMO_CAGE3D_PART_SCALE_MAX_X_MAX_Y_MAX_Z, win->eventstate); + gzmap, (bContext *)C, man->cage, ED_GIZMO_CAGE3D_PART_SCALE_MAX_X_MAX_Y_MAX_Z, win->eventstate); } } } -static void gizmo_mesh_placement_setup(const bContext *C, wmGizmoGroup *mgroup) +static void gizmo_mesh_placement_setup(const bContext *C, wmGizmoGroup *gzgroup) { wmOperator *op = WM_operator_last_redo(C); @@ -260,11 +260,11 @@ static void gizmo_mesh_placement_setup(const bContext *C, wmGizmoGroup *mgroup) } struct GizmoPlacementGroup *man = MEM_callocN(sizeof(GizmoPlacementGroup), __func__); - mgroup->customdata = man; + gzgroup->customdata = man; - const wmGizmoType *wt_cage = WM_gizmotype_find("GIZMO_WT_cage_3d", true); + const wmGizmoType *gzt_cage = WM_gizmotype_find("GIZMO_GT_cage_3d", true); - man->cage = WM_gizmo_new_ptr(wt_cage, mgroup, NULL); + man->cage = WM_gizmo_new_ptr(gzt_cage, gzgroup, NULL); UI_GetThemeColor3fv(TH_GIZMO_PRIMARY, man->cage->color); @@ -293,32 +293,32 @@ static void gizmo_mesh_placement_setup(const bContext *C, wmGizmoGroup *mgroup) }); } - gizmo_mesh_placement_modal_from_setup(C, mgroup); + gizmo_mesh_placement_modal_from_setup(C, gzgroup); } static void gizmo_mesh_placement_draw_prepare( - const bContext *UNUSED(C), wmGizmoGroup *mgroup) + const bContext *UNUSED(C), wmGizmoGroup *gzgroup) { - GizmoPlacementGroup *man = mgroup->customdata; + GizmoPlacementGroup *man = gzgroup->customdata; if (man->data.op->next) { man->data.op = WM_operator_last_redo((bContext *)man->data.context); } gizmo_mesh_placement_update_from_op(man); } -static void MESH_WGT_add_bounds(struct wmGizmoGroupType *wgt) +static void MESH_GGT_add_bounds(struct wmGizmoGroupType *gzgt) { - wgt->name = "Mesh Add Bounds"; - wgt->idname = "MESH_WGT_add_bounds"; + gzgt->name = "Mesh Add Bounds"; + gzgt->idname = "MESH_GGT_add_bounds"; - wgt->flag = WM_GIZMOGROUPTYPE_3D; + gzgt->flag = WM_GIZMOGROUPTYPE_3D; - wgt->mmap_params.spaceid = SPACE_VIEW3D; - wgt->mmap_params.regionid = RGN_TYPE_WINDOW; + gzgt->gzmap_params.spaceid = SPACE_VIEW3D; + gzgt->gzmap_params.regionid = RGN_TYPE_WINDOW; - wgt->poll = gizmo_mesh_placement_poll; - wgt->setup = gizmo_mesh_placement_setup; - wgt->draw_prepare = gizmo_mesh_placement_draw_prepare; + gzgt->poll = gizmo_mesh_placement_poll; + gzgt->setup = gizmo_mesh_placement_setup; + gzgt->draw_prepare = gizmo_mesh_placement_draw_prepare; } /** \} */ @@ -379,18 +379,18 @@ static int add_primitive_cube_gizmo_invoke(bContext *C, wmOperator *op, const wm int ret = add_primitive_cube_gizmo_exec(C, op); if (ret & OPERATOR_FINISHED) { /* Setup gizmos */ - if (v3d && ((v3d->mpr_flag & V3D_GIZMO_HIDE) == 0)) { + if (v3d && ((v3d->gizmo_flag & V3D_GIZMO_HIDE) == 0)) { ARegion *ar = CTX_wm_region(C); - wmGizmoMap *mmap = ar->gizmo_map; - wmGizmoGroupType *wgt = WM_gizmogrouptype_find("MESH_WGT_add_bounds", false); - wmGizmoGroup *mgroup = WM_gizmomap_group_find_ptr(mmap, wgt); - if (mgroup != NULL) { - GizmoPlacementGroup *man = mgroup->customdata; + wmGizmoMap *gzmap = ar->gizmo_map; + wmGizmoGroupType *gzgt = WM_gizmogrouptype_find("MESH_GGT_add_bounds", false); + wmGizmoGroup *gzgroup = WM_gizmomap_group_find_ptr(gzmap, gzgt); + if (gzgroup != NULL) { + GizmoPlacementGroup *man = gzgroup->customdata; man->data.op = op; - gizmo_mesh_placement_modal_from_setup(C, mgroup); + gizmo_mesh_placement_modal_from_setup(C, gzgroup); } else { - WM_gizmo_group_type_ensure_ptr(wgt); + WM_gizmo_group_type_ensure_ptr(gzgt); } } } @@ -420,7 +420,7 @@ void MESH_OT_primitive_cube_add_gizmo(wmOperatorType *ot) PropertyRNA *prop = RNA_def_float_matrix(ot->srna, "matrix", 4, 4, NULL, 0.0f, 0.0f, "Matrix", "", 0.0f, 0.0f); RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); - WM_gizmogrouptype_append(MESH_WGT_add_bounds); + WM_gizmogrouptype_append(MESH_GGT_add_bounds); } /** \} */ diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c index b73ce410626..66e40df2527 100644 --- a/source/blender/editors/mesh/editmesh_bevel.c +++ b/source/blender/editors/mesh/editmesh_bevel.c @@ -95,7 +95,7 @@ typedef struct { /* modal only */ float mcenter[2]; void *draw_handle_pixel; - short mpr_flag; + 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 */ } BevelData; @@ -201,8 +201,8 @@ static bool edbm_bevel_init(bContext *C, wmOperator *op, const bool is_modal) G.moving = G_TRANSFORM_EDIT; if (v3d) { - opdata->mpr_flag = v3d->mpr_flag; - v3d->mpr_flag = V3D_GIZMO_HIDE; + opdata->gizmo_flag = v3d->gizmo_flag; + v3d->gizmo_flag = V3D_GIZMO_HIDE; } } @@ -284,7 +284,7 @@ static void edbm_bevel_exit(bContext *C, wmOperator *op) } ED_region_draw_cb_exit(ar->type, opdata->draw_handle_pixel); if (v3d) { - v3d->mpr_flag = opdata->mpr_flag; + v3d->gizmo_flag = opdata->gizmo_flag; } G.moving = 0; } diff --git a/source/blender/editors/mesh/editmesh_bisect.c b/source/blender/editors/mesh/editmesh_bisect.c index a9e11b7b411..9416d889a3b 100644 --- a/source/blender/editors/mesh/editmesh_bisect.c +++ b/source/blender/editors/mesh/editmesh_bisect.c @@ -70,7 +70,7 @@ typedef struct { /* modal only */ BMBackup mesh_backup; bool is_first; - short mpr_flag; + short gizmo_flag; } BisectData; static bool mesh_bisect_interactive_calc( @@ -156,8 +156,8 @@ static int mesh_bisect_invoke(bContext *C, wmOperator *op, const wmEvent *event) /* misc other vars */ G.moving = G_TRANSFORM_EDIT; - opdata->mpr_flag = v3d->mpr_flag; - v3d->mpr_flag = V3D_GIZMO_HIDE; + opdata->gizmo_flag = v3d->gizmo_flag; + v3d->gizmo_flag = V3D_GIZMO_HIDE; /* initialize modal callout */ ED_workspace_status_text(C, IFACE_("LMB: Click and drag to draw cut line")); @@ -169,7 +169,7 @@ static void edbm_bisect_exit(bContext *C, BisectData *opdata) { View3D *v3d = CTX_wm_view3d(C); EDBM_redo_state_free(&opdata->mesh_backup, NULL, false); - v3d->mpr_flag = opdata->mpr_flag; + v3d->gizmo_flag = opdata->gizmo_flag; G.moving = 0; } @@ -199,8 +199,8 @@ static int mesh_bisect_modal(bContext *C, wmOperator *op, const wmEvent *event) /* Setup gizmos */ { View3D *v3d = CTX_wm_view3d(C); - if (v3d && (v3d->mpr_flag & V3D_GIZMO_HIDE) == 0) { - WM_gizmo_group_type_ensure("MESH_WGT_bisect"); + if (v3d && (v3d->gizmo_flag & V3D_GIZMO_HIDE) == 0) { + WM_gizmo_group_type_ensure("MESH_GGT_bisect"); } } #endif @@ -334,7 +334,7 @@ static int mesh_bisect_exec(bContext *C, wmOperator *op) } #ifdef USE_GIZMO -static void MESH_WGT_bisect(struct wmGizmoGroupType *wgt); +static void MESH_GGT_bisect(struct wmGizmoGroupType *gzgt); #endif void MESH_OT_bisect(struct wmOperatorType *ot) @@ -374,7 +374,7 @@ void MESH_OT_bisect(struct wmOperatorType *ot) WM_operator_properties_gesture_straightline(ot, CURSOR_EDIT); #ifdef USE_GIZMO - WM_gizmogrouptype_append(MESH_WGT_bisect); + WM_gizmogrouptype_append(MESH_GGT_bisect); #endif } @@ -459,40 +459,40 @@ static void gizmo_mesh_bisect_update_from_op(GizmoGroup *man) /* depth callbacks */ static void gizmo_bisect_prop_depth_get( - const wmGizmo *mpr, wmGizmoProperty *mpr_prop, + const wmGizmo *gz, wmGizmoProperty *gz_prop, void *value_p) { - GizmoGroup *man = mpr->parent_mgroup->customdata; + GizmoGroup *man = gz->parent_gzgroup->customdata; wmOperator *op = man->data.op; float *value = value_p; - BLI_assert(mpr_prop->type->array_length == 1); - UNUSED_VARS_NDEBUG(mpr_prop); + BLI_assert(gz_prop->type->array_length == 1); + UNUSED_VARS_NDEBUG(gz_prop); float plane_co[3], plane_no[3]; RNA_property_float_get_array(op->ptr, man->data.prop_plane_co, plane_co); RNA_property_float_get_array(op->ptr, man->data.prop_plane_no, plane_no); - value[0] = dot_v3v3(plane_no, plane_co) - dot_v3v3(plane_no, mpr->matrix_basis[3]); + value[0] = dot_v3v3(plane_no, plane_co) - dot_v3v3(plane_no, gz->matrix_basis[3]); } static void gizmo_bisect_prop_depth_set( - const wmGizmo *mpr, wmGizmoProperty *mpr_prop, + const wmGizmo *gz, wmGizmoProperty *gz_prop, const void *value_p) { - GizmoGroup *man = mpr->parent_mgroup->customdata; + GizmoGroup *man = gz->parent_gzgroup->customdata; wmOperator *op = man->data.op; const float *value = value_p; - BLI_assert(mpr_prop->type->array_length == 1); - UNUSED_VARS_NDEBUG(mpr_prop); + BLI_assert(gz_prop->type->array_length == 1); + UNUSED_VARS_NDEBUG(gz_prop); float plane_co[3], plane[4]; RNA_property_float_get_array(op->ptr, man->data.prop_plane_co, plane_co); RNA_property_float_get_array(op->ptr, man->data.prop_plane_no, plane); normalize_v3(plane); - plane[3] = -value[0] - dot_v3v3(plane, mpr->matrix_basis[3]); + plane[3] = -value[0] - dot_v3v3(plane, gz->matrix_basis[3]); /* Keep our location, may be offset simply to be inside the viewport. */ closest_to_plane_normalized_v3(plane_co, plane, plane_co); @@ -504,27 +504,27 @@ static void gizmo_bisect_prop_depth_set( /* translate callbacks */ static void gizmo_bisect_prop_translate_get( - const wmGizmo *mpr, wmGizmoProperty *mpr_prop, + const wmGizmo *gz, wmGizmoProperty *gz_prop, void *value_p) { - GizmoGroup *man = mpr->parent_mgroup->customdata; + GizmoGroup *man = gz->parent_gzgroup->customdata; wmOperator *op = man->data.op; - BLI_assert(mpr_prop->type->array_length == 3); - UNUSED_VARS_NDEBUG(mpr_prop); + BLI_assert(gz_prop->type->array_length == 3); + UNUSED_VARS_NDEBUG(gz_prop); RNA_property_float_get_array(op->ptr, man->data.prop_plane_co, value_p); } static void gizmo_bisect_prop_translate_set( - const wmGizmo *mpr, wmGizmoProperty *mpr_prop, + const wmGizmo *gz, wmGizmoProperty *gz_prop, const void *value_p) { - GizmoGroup *man = mpr->parent_mgroup->customdata; + GizmoGroup *man = gz->parent_gzgroup->customdata; wmOperator *op = man->data.op; - BLI_assert(mpr_prop->type->array_length == 3); - UNUSED_VARS_NDEBUG(mpr_prop); + BLI_assert(gz_prop->type->array_length == 3); + UNUSED_VARS_NDEBUG(gz_prop); RNA_property_float_set_array(op->ptr, man->data.prop_plane_co, value_p); @@ -533,15 +533,15 @@ static void gizmo_bisect_prop_translate_set( /* angle callbacks */ static void gizmo_bisect_prop_angle_get( - const wmGizmo *mpr, wmGizmoProperty *mpr_prop, + const wmGizmo *gz, wmGizmoProperty *gz_prop, void *value_p) { - GizmoGroup *man = mpr->parent_mgroup->customdata; + GizmoGroup *man = gz->parent_gzgroup->customdata; wmOperator *op = man->data.op; float *value = value_p; - BLI_assert(mpr_prop->type->array_length == 1); - UNUSED_VARS_NDEBUG(mpr_prop); + BLI_assert(gz_prop->type->array_length == 1); + UNUSED_VARS_NDEBUG(gz_prop); float plane_no[4]; RNA_property_float_get_array(op->ptr, man->data.prop_plane_no, plane_no); @@ -560,15 +560,15 @@ static void gizmo_bisect_prop_angle_get( } static void gizmo_bisect_prop_angle_set( - const wmGizmo *mpr, wmGizmoProperty *mpr_prop, + const wmGizmo *gz, wmGizmoProperty *gz_prop, const void *value_p) { - GizmoGroup *man = mpr->parent_mgroup->customdata; + GizmoGroup *man = gz->parent_gzgroup->customdata; wmOperator *op = man->data.op; const float *value = value_p; - BLI_assert(mpr_prop->type->array_length == 1); - UNUSED_VARS_NDEBUG(mpr_prop); + BLI_assert(gz_prop->type->array_length == 1); + UNUSED_VARS_NDEBUG(gz_prop); float plane_no[4]; RNA_property_float_get_array(op->ptr, man->data.prop_plane_no, plane_no); @@ -593,17 +593,17 @@ static void gizmo_bisect_prop_angle_set( } } -static bool gizmo_mesh_bisect_poll(const bContext *C, wmGizmoGroupType *wgt) +static bool gizmo_mesh_bisect_poll(const bContext *C, wmGizmoGroupType *gzgt) { wmOperator *op = WM_operator_last_redo(C); if (op == NULL || !STREQ(op->type->idname, "MESH_OT_bisect")) { - WM_gizmo_group_type_unlink_delayed_ptr(wgt); + WM_gizmo_group_type_unlink_delayed_ptr(gzgt); return false; } return true; } -static void gizmo_mesh_bisect_setup(const bContext *C, wmGizmoGroup *mgroup) +static void gizmo_mesh_bisect_setup(const bContext *C, wmGizmoGroup *gzgroup) { wmOperator *op = WM_operator_last_redo(C); @@ -612,15 +612,15 @@ static void gizmo_mesh_bisect_setup(const bContext *C, wmGizmoGroup *mgroup) } struct GizmoGroup *man = MEM_callocN(sizeof(GizmoGroup), __func__); - mgroup->customdata = man; + gzgroup->customdata = man; - const wmGizmoType *wt_arrow = WM_gizmotype_find("GIZMO_WT_arrow_3d", true); - const wmGizmoType *wt_grab = WM_gizmotype_find("GIZMO_WT_grab_3d", true); - const wmGizmoType *wt_dial = WM_gizmotype_find("GIZMO_WT_dial_3d", true); + const wmGizmoType *gzt_arrow = WM_gizmotype_find("GIZMO_GT_arrow_3d", true); + const wmGizmoType *gzt_grab = WM_gizmotype_find("GIZMO_GT_grab_3d", true); + const wmGizmoType *gzt_dial = WM_gizmotype_find("GIZMO_GT_dial_3d", true); - man->translate_z = WM_gizmo_new_ptr(wt_arrow, mgroup, NULL); - man->translate_c = WM_gizmo_new_ptr(wt_grab, mgroup, NULL); - man->rotate_c = WM_gizmo_new_ptr(wt_dial, mgroup, NULL); + man->translate_z = WM_gizmo_new_ptr(gzt_arrow, gzgroup, NULL); + man->translate_c = WM_gizmo_new_ptr(gzt_grab, gzgroup, NULL); + man->rotate_c = WM_gizmo_new_ptr(gzt_dial, gzgroup, NULL); UI_GetThemeColor3fv(TH_GIZMO_PRIMARY, man->translate_z->color); UI_GetThemeColor3fv(TH_GIZMO_PRIMARY, man->translate_c->color); @@ -673,28 +673,28 @@ static void gizmo_mesh_bisect_setup(const bContext *C, wmGizmoGroup *mgroup) } static void gizmo_mesh_bisect_draw_prepare( - const bContext *UNUSED(C), wmGizmoGroup *mgroup) + const bContext *UNUSED(C), wmGizmoGroup *gzgroup) { - GizmoGroup *man = mgroup->customdata; + GizmoGroup *man = gzgroup->customdata; if (man->data.op->next) { man->data.op = WM_operator_last_redo((bContext *)man->data.context); } gizmo_mesh_bisect_update_from_op(man); } -static void MESH_WGT_bisect(struct wmGizmoGroupType *wgt) +static void MESH_GGT_bisect(struct wmGizmoGroupType *gzgt) { - wgt->name = "Mesh Bisect"; - wgt->idname = "MESH_WGT_bisect"; + gzgt->name = "Mesh Bisect"; + gzgt->idname = "MESH_GGT_bisect"; - wgt->flag = WM_GIZMOGROUPTYPE_3D; + gzgt->flag = WM_GIZMOGROUPTYPE_3D; - wgt->mmap_params.spaceid = SPACE_VIEW3D; - wgt->mmap_params.regionid = RGN_TYPE_WINDOW; + gzgt->gzmap_params.spaceid = SPACE_VIEW3D; + gzgt->gzmap_params.regionid = RGN_TYPE_WINDOW; - wgt->poll = gizmo_mesh_bisect_poll; - wgt->setup = gizmo_mesh_bisect_setup; - wgt->draw_prepare = gizmo_mesh_bisect_draw_prepare; + gzgt->poll = gizmo_mesh_bisect_poll; + gzgt->setup = gizmo_mesh_bisect_setup; + gzgt->draw_prepare = gizmo_mesh_bisect_draw_prepare; } /** \} */ diff --git a/source/blender/editors/mesh/editmesh_extrude.c b/source/blender/editors/mesh/editmesh_extrude.c index dd167c1fc15..061cc3ebc32 100644 --- a/source/blender/editors/mesh/editmesh_extrude.c +++ b/source/blender/editors/mesh/editmesh_extrude.c @@ -417,31 +417,31 @@ static void gizmo_mesh_extrude_orientation_matrix_set( } } -static bool gizmo_mesh_extrude_poll(const bContext *C, wmGizmoGroupType *wgt) +static bool gizmo_mesh_extrude_poll(const bContext *C, wmGizmoGroupType *gzgt) { ScrArea *sa = CTX_wm_area(C); bToolRef_Runtime *tref_rt = sa->runtime.tool ? sa->runtime.tool->runtime : NULL; if ((tref_rt == NULL) || - !STREQ(wgt->idname, tref_rt->gizmo_group) || + !STREQ(gzgt->idname, tref_rt->gizmo_group) || !ED_operator_editmesh_view3d((bContext *)C)) { - WM_gizmo_group_type_unlink_delayed_ptr(wgt); + WM_gizmo_group_type_unlink_delayed_ptr(gzgt); return false; } return true; } -static void gizmo_mesh_extrude_setup(const bContext *UNUSED(C), wmGizmoGroup *mgroup) +static void gizmo_mesh_extrude_setup(const bContext *UNUSED(C), wmGizmoGroup *gzgroup) { struct GizmoExtrudeGroup *man = MEM_callocN(sizeof(GizmoExtrudeGroup), __func__); - mgroup->customdata = man; + gzgroup->customdata = man; - const wmGizmoType *wt_arrow = WM_gizmotype_find("GIZMO_WT_arrow_3d", true); - const wmGizmoType *wt_grab = WM_gizmotype_find("GIZMO_WT_button_2d", true); + const wmGizmoType *gzt_arrow = WM_gizmotype_find("GIZMO_GT_arrow_3d", true); + const wmGizmoType *gzt_grab = WM_gizmotype_find("GIZMO_GT_button_2d", true); for (int i = 0; i < 4; i++) { - man->adjust_xyz_no[i] = WM_gizmo_new_ptr(wt_arrow, mgroup, NULL); - man->invoke_xyz_no[i] = WM_gizmo_new_ptr(wt_grab, mgroup, NULL); + man->adjust_xyz_no[i] = WM_gizmo_new_ptr(gzt_arrow, gzgroup, NULL); + man->invoke_xyz_no[i] = WM_gizmo_new_ptr(gzt_grab, gzgroup, NULL); man->invoke_xyz_no[i]->flag |= WM_GIZMO_DRAW_OFFSET_SCALE; } @@ -503,9 +503,9 @@ static void gizmo_mesh_extrude_setup(const bContext *UNUSED(C), wmGizmoGroup *mg } } -static void gizmo_mesh_extrude_refresh(const bContext *C, wmGizmoGroup *mgroup) +static void gizmo_mesh_extrude_refresh(const bContext *C, wmGizmoGroup *gzgroup) { - GizmoExtrudeGroup *man = mgroup->customdata; + GizmoExtrudeGroup *man = gzgroup->customdata; for (int i = 0; i < 4; i++) { WM_gizmo_set_flag(man->invoke_xyz_no[i], WM_GIZMO_HIDDEN, true); @@ -623,9 +623,9 @@ static void gizmo_mesh_extrude_refresh(const bContext *C, wmGizmoGroup *mgroup) } } -static void gizmo_mesh_extrude_draw_prepare(const bContext *C, wmGizmoGroup *mgroup) +static void gizmo_mesh_extrude_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup) { - GizmoExtrudeGroup *man = mgroup->customdata; + GizmoExtrudeGroup *man = gzgroup->customdata; switch (man->data.orientation_type) { case V3D_MANIP_VIEW: { @@ -640,38 +640,38 @@ static void gizmo_mesh_extrude_draw_prepare(const bContext *C, wmGizmoGroup *mgr } static void gizmo_mesh_extrude_message_subscribe( - const bContext *C, wmGizmoGroup *mgroup, struct wmMsgBus *mbus) + const bContext *C, wmGizmoGroup *gzgroup, struct wmMsgBus *mbus) { ARegion *ar = CTX_wm_region(C); /* Subscribe to view properties */ - wmMsgSubscribeValue msg_sub_value_mpr_tag_refresh = { + wmMsgSubscribeValue msg_sub_value_gz_tag_refresh = { .owner = ar, - .user_data = mgroup->parent_mmap, + .user_data = gzgroup->parent_gzmap, .notify = WM_gizmo_do_msg_notify_tag_refresh, }; { - WM_msg_subscribe_rna_anon_prop(mbus, Scene, transform_orientation, &msg_sub_value_mpr_tag_refresh); + WM_msg_subscribe_rna_anon_prop(mbus, Scene, transform_orientation, &msg_sub_value_gz_tag_refresh); } } -static void MESH_WGT_extrude(struct wmGizmoGroupType *wgt) +static void MESH_GGT_extrude(struct wmGizmoGroupType *gzgt) { - wgt->name = "Mesh Extrude"; - wgt->idname = "MESH_WGT_extrude"; + gzgt->name = "Mesh Extrude"; + gzgt->idname = "MESH_GGT_extrude"; - wgt->flag = WM_GIZMOGROUPTYPE_3D; + gzgt->flag = WM_GIZMOGROUPTYPE_3D; - wgt->mmap_params.spaceid = SPACE_VIEW3D; - wgt->mmap_params.regionid = RGN_TYPE_WINDOW; + gzgt->gzmap_params.spaceid = SPACE_VIEW3D; + gzgt->gzmap_params.regionid = RGN_TYPE_WINDOW; - wgt->poll = gizmo_mesh_extrude_poll; - wgt->setup = gizmo_mesh_extrude_setup; - wgt->refresh = gizmo_mesh_extrude_refresh; - wgt->draw_prepare = gizmo_mesh_extrude_draw_prepare; - wgt->message_subscribe = gizmo_mesh_extrude_message_subscribe; + gzgt->poll = gizmo_mesh_extrude_poll; + gzgt->setup = gizmo_mesh_extrude_setup; + gzgt->refresh = gizmo_mesh_extrude_refresh; + gzgt->draw_prepare = gizmo_mesh_extrude_draw_prepare; + gzgt->message_subscribe = gizmo_mesh_extrude_message_subscribe; } #endif /* USE_GIZMO */ @@ -826,7 +826,7 @@ void MESH_OT_extrude_context(wmOperatorType *ot) Transform_Properties(ot, P_NO_DEFAULTS | P_MIRROR_DUMMY); #ifdef USE_GIZMO - WM_gizmogrouptype_append(MESH_WGT_extrude); + WM_gizmogrouptype_append(MESH_GGT_extrude); #endif } diff --git a/source/blender/editors/mesh/editmesh_extrude_spin.c b/source/blender/editors/mesh/editmesh_extrude_spin.c index 3864bd63036..adb7ee71ee0 100644 --- a/source/blender/editors/mesh/editmesh_extrude_spin.c +++ b/source/blender/editors/mesh/editmesh_extrude_spin.c @@ -143,40 +143,40 @@ static void gizmo_mesh_spin_update_from_op(GizmoSpinGroup *man) /* depth callbacks */ static void gizmo_spin_prop_depth_get( - const wmGizmo *mpr, wmGizmoProperty *mpr_prop, + const wmGizmo *gz, wmGizmoProperty *gz_prop, void *value_p) { - GizmoSpinGroup *man = mpr->parent_mgroup->customdata; + GizmoSpinGroup *man = gz->parent_gzgroup->customdata; wmOperator *op = man->data.op; float *value = value_p; - BLI_assert(mpr_prop->type->array_length == 1); - UNUSED_VARS_NDEBUG(mpr_prop); + BLI_assert(gz_prop->type->array_length == 1); + UNUSED_VARS_NDEBUG(gz_prop); float plane_co[3], plane_no[3]; RNA_property_float_get_array(op->ptr, man->data.prop_axis_co, plane_co); RNA_property_float_get_array(op->ptr, man->data.prop_axis_no, plane_no); - value[0] = dot_v3v3(plane_no, plane_co) - dot_v3v3(plane_no, mpr->matrix_basis[3]); + value[0] = dot_v3v3(plane_no, plane_co) - dot_v3v3(plane_no, gz->matrix_basis[3]); } static void gizmo_spin_prop_depth_set( - const wmGizmo *mpr, wmGizmoProperty *mpr_prop, + const wmGizmo *gz, wmGizmoProperty *gz_prop, const void *value_p) { - GizmoSpinGroup *man = mpr->parent_mgroup->customdata; + GizmoSpinGroup *man = gz->parent_gzgroup->customdata; wmOperator *op = man->data.op; const float *value = value_p; - BLI_assert(mpr_prop->type->array_length == 1); - UNUSED_VARS_NDEBUG(mpr_prop); + BLI_assert(gz_prop->type->array_length == 1); + UNUSED_VARS_NDEBUG(gz_prop); float plane_co[3], plane[4]; RNA_property_float_get_array(op->ptr, man->data.prop_axis_co, plane_co); RNA_property_float_get_array(op->ptr, man->data.prop_axis_no, plane); normalize_v3(plane); - plane[3] = -value[0] - dot_v3v3(plane, mpr->matrix_basis[3]); + plane[3] = -value[0] - dot_v3v3(plane, gz->matrix_basis[3]); /* Keep our location, may be offset simply to be inside the viewport. */ closest_to_plane_normalized_v3(plane_co, plane, plane_co); @@ -188,28 +188,28 @@ static void gizmo_spin_prop_depth_set( /* translate callbacks */ static void gizmo_spin_prop_translate_get( - const wmGizmo *mpr, wmGizmoProperty *mpr_prop, + const wmGizmo *gz, wmGizmoProperty *gz_prop, void *value_p) { - GizmoSpinGroup *man = mpr->parent_mgroup->customdata; + GizmoSpinGroup *man = gz->parent_gzgroup->customdata; wmOperator *op = man->data.op; float *value = value_p; - BLI_assert(mpr_prop->type->array_length == 3); - UNUSED_VARS_NDEBUG(mpr_prop); + BLI_assert(gz_prop->type->array_length == 3); + UNUSED_VARS_NDEBUG(gz_prop); RNA_property_float_get_array(op->ptr, man->data.prop_axis_co, value); } static void gizmo_spin_prop_translate_set( - const wmGizmo *mpr, wmGizmoProperty *mpr_prop, + const wmGizmo *gz, wmGizmoProperty *gz_prop, const void *value) { - GizmoSpinGroup *man = mpr->parent_mgroup->customdata; + GizmoSpinGroup *man = gz->parent_gzgroup->customdata; wmOperator *op = man->data.op; - BLI_assert(mpr_prop->type->array_length == 3); - UNUSED_VARS_NDEBUG(mpr_prop); + BLI_assert(gz_prop->type->array_length == 3); + UNUSED_VARS_NDEBUG(gz_prop); RNA_property_float_set_array(op->ptr, man->data.prop_axis_co, value); @@ -218,15 +218,15 @@ static void gizmo_spin_prop_translate_set( /* angle callbacks */ static void gizmo_spin_prop_axis_angle_get( - const wmGizmo *mpr, wmGizmoProperty *mpr_prop, + const wmGizmo *gz, wmGizmoProperty *gz_prop, void *value_p) { - GizmoSpinGroup *man = mpr->parent_mgroup->customdata; + GizmoSpinGroup *man = gz->parent_gzgroup->customdata; wmOperator *op = man->data.op; float *value = value_p; - BLI_assert(mpr_prop->type->array_length == 1); - UNUSED_VARS_NDEBUG(mpr_prop); + BLI_assert(gz_prop->type->array_length == 1); + UNUSED_VARS_NDEBUG(gz_prop); float plane_no[4]; RNA_property_float_get_array(op->ptr, man->data.prop_axis_no, plane_no); @@ -245,15 +245,15 @@ static void gizmo_spin_prop_axis_angle_get( } static void gizmo_spin_prop_axis_angle_set( - const wmGizmo *mpr, wmGizmoProperty *mpr_prop, + const wmGizmo *gz, wmGizmoProperty *gz_prop, const void *value_p) { - GizmoSpinGroup *man = mpr->parent_mgroup->customdata; + GizmoSpinGroup *man = gz->parent_gzgroup->customdata; wmOperator *op = man->data.op; const float *value = value_p; - BLI_assert(mpr_prop->type->array_length == 1); - UNUSED_VARS_NDEBUG(mpr_prop); + BLI_assert(gz_prop->type->array_length == 1); + UNUSED_VARS_NDEBUG(gz_prop); float plane_no[4]; RNA_property_float_get_array(op->ptr, man->data.prop_axis_no, plane_no); @@ -280,43 +280,43 @@ static void gizmo_spin_prop_axis_angle_set( /* angle callbacks */ static void gizmo_spin_prop_angle_get( - const wmGizmo *mpr, wmGizmoProperty *mpr_prop, + const wmGizmo *gz, wmGizmoProperty *gz_prop, void *value_p) { - GizmoSpinGroup *man = mpr->parent_mgroup->customdata; + GizmoSpinGroup *man = gz->parent_gzgroup->customdata; wmOperator *op = man->data.op; float *value = value_p; - BLI_assert(mpr_prop->type->array_length == 1); - UNUSED_VARS_NDEBUG(mpr_prop); + BLI_assert(gz_prop->type->array_length == 1); + UNUSED_VARS_NDEBUG(gz_prop); value[0] = RNA_property_float_get(op->ptr, man->data.prop_angle); } static void gizmo_spin_prop_angle_set( - const wmGizmo *mpr, wmGizmoProperty *mpr_prop, + const wmGizmo *gz, wmGizmoProperty *gz_prop, const void *value_p) { - GizmoSpinGroup *man = mpr->parent_mgroup->customdata; + GizmoSpinGroup *man = gz->parent_gzgroup->customdata; wmOperator *op = man->data.op; - BLI_assert(mpr_prop->type->array_length == 1); - UNUSED_VARS_NDEBUG(mpr_prop); + BLI_assert(gz_prop->type->array_length == 1); + UNUSED_VARS_NDEBUG(gz_prop); const float *value = value_p; RNA_property_float_set(op->ptr, man->data.prop_angle, value[0]); gizmo_spin_exec(man); } -static bool gizmo_mesh_spin_poll(const bContext *C, wmGizmoGroupType *wgt) +static bool gizmo_mesh_spin_poll(const bContext *C, wmGizmoGroupType *gzgt) { wmOperator *op = WM_operator_last_redo(C); if (op == NULL || !STREQ(op->type->idname, "MESH_OT_spin")) { - WM_gizmo_group_type_unlink_delayed_ptr(wgt); + WM_gizmo_group_type_unlink_delayed_ptr(gzgt); return false; } return true; } -static void gizmo_mesh_spin_setup(const bContext *C, wmGizmoGroup *mgroup) +static void gizmo_mesh_spin_setup(const bContext *C, wmGizmoGroup *gzgroup) { wmOperator *op = WM_operator_last_redo(C); @@ -325,16 +325,16 @@ static void gizmo_mesh_spin_setup(const bContext *C, wmGizmoGroup *mgroup) } struct GizmoSpinGroup *man = MEM_callocN(sizeof(GizmoSpinGroup), __func__); - mgroup->customdata = man; + gzgroup->customdata = man; - const wmGizmoType *wt_arrow = WM_gizmotype_find("GIZMO_WT_arrow_3d", true); - const wmGizmoType *wt_grab = WM_gizmotype_find("GIZMO_WT_grab_3d", true); - const wmGizmoType *wt_dial = WM_gizmotype_find("GIZMO_WT_dial_3d", true); + const wmGizmoType *gzt_arrow = WM_gizmotype_find("GIZMO_GT_arrow_3d", true); + const wmGizmoType *gzt_grab = WM_gizmotype_find("GIZMO_GT_grab_3d", true); + const wmGizmoType *gzt_dial = WM_gizmotype_find("GIZMO_GT_dial_3d", true); - man->translate_z = WM_gizmo_new_ptr(wt_arrow, mgroup, NULL); - man->translate_c = WM_gizmo_new_ptr(wt_grab, mgroup, NULL); - man->rotate_c = WM_gizmo_new_ptr(wt_dial, mgroup, NULL); - man->angle_z = WM_gizmo_new_ptr(wt_dial, mgroup, NULL); + man->translate_z = WM_gizmo_new_ptr(gzt_arrow, gzgroup, NULL); + man->translate_c = WM_gizmo_new_ptr(gzt_grab, gzgroup, NULL); + man->rotate_c = WM_gizmo_new_ptr(gzt_dial, gzgroup, NULL); + man->angle_z = WM_gizmo_new_ptr(gzt_dial, gzgroup, NULL); UI_GetThemeColor3fv(TH_GIZMO_PRIMARY, man->translate_z->color); UI_GetThemeColor3fv(TH_GIZMO_PRIMARY, man->translate_c->color); @@ -403,28 +403,28 @@ static void gizmo_mesh_spin_setup(const bContext *C, wmGizmoGroup *mgroup) } static void gizmo_mesh_spin_draw_prepare( - const bContext *UNUSED(C), wmGizmoGroup *mgroup) + const bContext *UNUSED(C), wmGizmoGroup *gzgroup) { - GizmoSpinGroup *man = mgroup->customdata; + GizmoSpinGroup *man = gzgroup->customdata; if (man->data.op->next) { man->data.op = WM_operator_last_redo((bContext *)man->data.context); } gizmo_mesh_spin_update_from_op(man); } -static void MESH_WGT_spin(struct wmGizmoGroupType *wgt) +static void MESH_GGT_spin(struct wmGizmoGroupType *gzgt) { - wgt->name = "Mesh Spin"; - wgt->idname = "MESH_WGT_spin"; + gzgt->name = "Mesh Spin"; + gzgt->idname = "MESH_GGT_spin"; - wgt->flag = WM_GIZMOGROUPTYPE_3D; + gzgt->flag = WM_GIZMOGROUPTYPE_3D; - wgt->mmap_params.spaceid = SPACE_VIEW3D; - wgt->mmap_params.regionid = RGN_TYPE_WINDOW; + gzgt->gzmap_params.spaceid = SPACE_VIEW3D; + gzgt->gzmap_params.regionid = RGN_TYPE_WINDOW; - wgt->poll = gizmo_mesh_spin_poll; - wgt->setup = gizmo_mesh_spin_setup; - wgt->draw_prepare = gizmo_mesh_spin_draw_prepare; + gzgt->poll = gizmo_mesh_spin_poll; + gzgt->setup = gizmo_mesh_spin_setup; + gzgt->draw_prepare = gizmo_mesh_spin_draw_prepare; } /** \} */ @@ -511,8 +511,8 @@ static int edbm_spin_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(e #ifdef USE_GIZMO if (ret & OPERATOR_FINISHED) { /* Setup gizmos */ - if (v3d && ((v3d->mpr_flag & V3D_GIZMO_HIDE) == 0)) { - WM_gizmo_group_type_ensure("MESH_WGT_spin"); + if (v3d && ((v3d->gizmo_flag & V3D_GIZMO_HIDE) == 0)) { + WM_gizmo_group_type_ensure("MESH_GGT_spin"); } } #endif @@ -549,6 +549,6 @@ void MESH_OT_spin(wmOperatorType *ot) RNA_def_float_vector(ot->srna, "axis", 3, NULL, -1.0f, 1.0f, "Axis", "Axis in global view space", -1.0f, 1.0f); #ifdef USE_GIZMO - WM_gizmogrouptype_append(MESH_WGT_spin); + WM_gizmogrouptype_append(MESH_GGT_spin); #endif } diff --git a/source/blender/editors/mesh/editmesh_inset.c b/source/blender/editors/mesh/editmesh_inset.c index 1be180b852c..486203462a0 100644 --- a/source/blender/editors/mesh/editmesh_inset.c +++ b/source/blender/editors/mesh/editmesh_inset.c @@ -78,7 +78,7 @@ typedef struct { /* modal only */ float mcenter[2]; void *draw_handle_pixel; - short mpr_flag; + short gizmo_flag; } InsetData; @@ -173,8 +173,8 @@ static bool edbm_inset_init(bContext *C, wmOperator *op, const bool is_modal) ar->type, ED_region_draw_mouse_line_cb, opdata->mcenter, REGION_DRAW_POST_PIXEL); G.moving = G_TRANSFORM_EDIT; if (v3d) { - opdata->mpr_flag = v3d->mpr_flag; - v3d->mpr_flag = V3D_GIZMO_HIDE; + opdata->gizmo_flag = v3d->gizmo_flag; + v3d->gizmo_flag = V3D_GIZMO_HIDE; } } @@ -196,7 +196,7 @@ static void edbm_inset_exit(bContext *C, wmOperator *op) } ED_region_draw_cb_exit(ar->type, opdata->draw_handle_pixel); if (v3d) { - v3d->mpr_flag = opdata->mpr_flag; + v3d->gizmo_flag = opdata->gizmo_flag; } G.moving = 0; } |