diff options
Diffstat (limited to 'source/blender/editors/uvedit')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_ops.c | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 474348e84bc..afe26ed1c4e 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -640,7 +640,7 @@ bool ED_uvedit_minmax(Scene *scene, Image *ima, Object *obedit, float r_min[2], BMIter iter, liter; MTexPoly *tf; MLoopUV *luv; - bool change = false; + bool changed = false; const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV); const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY); @@ -656,12 +656,12 @@ bool ED_uvedit_minmax(Scene *scene, Image *ima, Object *obedit, float r_min[2], if (uvedit_uv_select_test(scene, l, cd_loop_uv_offset)) { luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); minmax_v2v2_v2(r_min, r_max, luv->uv); - change = true; + changed = true; } } } - return change; + return changed; } static bool ED_uvedit_median(Scene *scene, Image *ima, Object *obedit, float co[2]) @@ -699,22 +699,22 @@ static bool ED_uvedit_median(Scene *scene, Image *ima, Object *obedit, float co[ static bool uvedit_center(Scene *scene, Image *ima, Object *obedit, float cent[2], char mode) { - bool change = false; + bool changed = false; if (mode == V3D_CENTER) { /* bounding box */ float min[2], max[2]; if (ED_uvedit_minmax(scene, ima, obedit, min, max)) { mid_v2_v2v2(cent, min, max); - change = true; + changed = true; } } else { if (ED_uvedit_median(scene, ima, obedit, cent)) { - change = true; + changed = true; } } - return change; + return changed; } /************************** find nearest ****************************/ @@ -2461,7 +2461,7 @@ static int uv_select_split_exec(bContext *C, wmOperator *op) BMIter iter, liter; MTexPoly *tf; MLoopUV *luv; - bool change = false; + bool changed = false; const int cd_loop_uv_offset = CustomData_get_offset(&bm->ldata, CD_MLOOPUV); const int cd_poly_tex_offset = CustomData_get_offset(&bm->pdata, CD_MTEXPOLY); @@ -2504,11 +2504,11 @@ static int uv_select_split_exec(bContext *C, wmOperator *op) luv->flag &= ~MLOOPUV_VERTSEL; } - change = true; + changed = true; } } - if (change) { + if (changed) { WM_event_add_notifier(C, NC_SPACE | ND_SPACE_IMAGE, NULL); return OPERATOR_FINISHED; } @@ -2796,7 +2796,7 @@ static int uv_border_select_exec(bContext *C, wmOperator *op) MLoopUV *luv; rcti rect; rctf rectf; - bool change, pinned, select, extend; + bool changed, pinned, select, extend; const bool use_face_center = (ts->uv_flag & UV_SYNC_SELECTION) ? (ts->selectmode == SCE_SELECT_FACE) : (ts->uv_selectmode == UV_SELECT_FACE); @@ -2823,7 +2823,7 @@ static int uv_border_select_exec(bContext *C, wmOperator *op) /* handle face selection mode */ float cent[2]; - change = false; + changed = false; BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) { /* assume not touched */ @@ -2834,19 +2834,19 @@ static int uv_border_select_exec(bContext *C, wmOperator *op) uv_poly_center(efa, cent, cd_loop_uv_offset); if (BLI_rctf_isect_pt_v(&rectf, cent)) { BM_elem_flag_enable(efa, BM_ELEM_TAG); - change = true; + changed = true; } } } /* (de)selects all tagged faces and deals with sticky modes */ - if (change) { + if (changed) { uv_select_flush_from_tag_face(sima, scene, obedit, select); } } else { /* other selection modes */ - change = true; + changed = true; BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) { tf = BM_ELEM_CD_GET_VOID_P(efa, cd_poly_tex_offset); @@ -2871,7 +2871,7 @@ static int uv_border_select_exec(bContext *C, wmOperator *op) } } - if (change) { + if (changed) { uv_select_sync_flush(ts, em, select); if (ts->uv_flag & UV_SYNC_SELECTION) { @@ -2947,7 +2947,7 @@ static int uv_circle_select_exec(bContext *C, wmOperator *op) float zoomx, zoomy, offset[2], ellipse[2]; int gesture_mode = RNA_int_get(op->ptr, "gesture_mode"); const bool select = (gesture_mode == GESTURE_MODAL_SELECT); - bool change = false; + bool changed = false; const bool use_face_center = (ts->uv_flag & UV_SYNC_SELECTION) ? (ts->selectmode == SCE_SELECT_FACE) : (ts->uv_selectmode == UV_SELECT_FACE); @@ -2971,7 +2971,7 @@ static int uv_circle_select_exec(bContext *C, wmOperator *op) /* do selection */ if (use_face_center) { - change = FALSE; + changed = false; BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) { BM_elem_flag_disable(efa, BM_ELEM_TAG); /* assume not touched */ @@ -2980,13 +2980,13 @@ static int uv_circle_select_exec(bContext *C, wmOperator *op) uv_poly_center(efa, cent, cd_loop_uv_offset); if (uv_inside_circle(cent, offset, ellipse)) { BM_elem_flag_enable(efa, BM_ELEM_TAG); - change = TRUE; + changed = true; } } } /* (de)selects all tagged faces and deals with sticky modes */ - if (change) { + if (changed) { uv_select_flush_from_tag_face(sima, scene, obedit, select); } } @@ -2994,12 +2994,12 @@ static int uv_circle_select_exec(bContext *C, wmOperator *op) BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) { BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) { luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); - change |= uv_select_inside_ellipse(em, scene, select, offset, ellipse, l, luv, cd_loop_uv_offset); + changed |= uv_select_inside_ellipse(em, scene, select, offset, ellipse, l, luv, cd_loop_uv_offset); } } } - if (change) { + if (changed) { uv_select_sync_flush(ts, em, select); WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data); @@ -3057,7 +3057,7 @@ static bool do_lasso_select_mesh_uv(bContext *C, const int mcords[][2], short mo BMLoop *l; MTexPoly *tf; int screen_uv[2]; - bool change = false; + bool changed = false; rcti rect; BLI_lasso_boundbox(&rect, mcords, moves); @@ -3074,13 +3074,13 @@ static bool do_lasso_select_mesh_uv(bContext *C, const int mcords[][2], short mo BLI_lasso_is_point_inside(mcords, moves, screen_uv[0], screen_uv[1], V2D_IS_CLIPPED)) { BM_elem_flag_enable(efa, BM_ELEM_TAG); - change = true; + changed = true; } } } /* (de)selects all tagged faces and deals with sticky modes */ - if (change) { + if (changed) { uv_select_flush_from_tag_face(sima, scene, obedit, select); } } @@ -3096,7 +3096,7 @@ static bool do_lasso_select_mesh_uv(bContext *C, const int mcords[][2], short mo BLI_lasso_is_point_inside(mcords, moves, screen_uv[0], screen_uv[1], V2D_IS_CLIPPED)) { uvedit_uv_select_set(em, scene, l, select, false, cd_loop_uv_offset); - change = true; + changed = true; } } } @@ -3104,7 +3104,7 @@ static bool do_lasso_select_mesh_uv(bContext *C, const int mcords[][2], short mo } } - if (change) { + if (changed) { uv_select_sync_flush(scene->toolsettings, em, select); if (ts->uv_flag & UV_SYNC_SELECTION) { @@ -3112,7 +3112,7 @@ static bool do_lasso_select_mesh_uv(bContext *C, const int mcords[][2], short mo } } - return change; + return changed; } static int uv_lasso_select_exec(bContext *C, wmOperator *op) @@ -3122,14 +3122,14 @@ static int uv_lasso_select_exec(bContext *C, wmOperator *op) if (mcords) { bool select; - bool change; + bool changed; select = !RNA_boolean_get(op->ptr, "deselect"); - change = do_lasso_select_mesh_uv(C, mcords, mcords_tot, select); + changed = do_lasso_select_mesh_uv(C, mcords, mcords_tot, select); MEM_freeN((void *)mcords); - return change ? OPERATOR_FINISHED : OPERATOR_CANCELLED; + return changed ? OPERATOR_FINISHED : OPERATOR_CANCELLED; } return OPERATOR_PASS_THROUGH; @@ -3184,19 +3184,19 @@ static int uv_snap_cursor_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); Object *obedit = CTX_data_edit_object(C); Image *ima = CTX_data_edit_image(C); - bool change = false; + bool changed = false; switch (RNA_enum_get(op->ptr, "target")) { case 0: uv_snap_cursor_to_pixels(sima); - change = true; + changed = true; break; case 1: - change = uv_snap_cursor_to_selection(scene, ima, obedit, sima); + changed = uv_snap_cursor_to_selection(scene, ima, obedit, sima); break; } - if (!change) + if (!changed) return OPERATOR_CANCELLED; WM_event_add_notifier(C, NC_SPACE | ND_SPACE_IMAGE, sima); @@ -3235,7 +3235,7 @@ static bool uv_snap_uvs_to_cursor(Scene *scene, Image *ima, Object *obedit, cons BMIter iter, liter; MTexPoly *tface; MLoopUV *luv; - bool change = false; + bool changed = false; const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV); const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY); @@ -3249,12 +3249,12 @@ static bool uv_snap_uvs_to_cursor(Scene *scene, Image *ima, Object *obedit, cons if (uvedit_uv_select_test(scene, l, cd_loop_uv_offset)) { luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); copy_v2_v2 (luv->uv, cursor); - change = true; + changed = true; } } } - return change; + return changed; } static bool uv_snap_uvs_offset(Scene *scene, Image *ima, Object *obedit, const float offset[2]) @@ -3265,7 +3265,7 @@ static bool uv_snap_uvs_offset(Scene *scene, Image *ima, Object *obedit, const f BMIter iter, liter; MTexPoly *tface; MLoopUV *luv; - bool change = false; + bool changed = false; const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV); const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY); @@ -3279,15 +3279,15 @@ static bool uv_snap_uvs_offset(Scene *scene, Image *ima, Object *obedit, const f if (uvedit_uv_select_test(scene, l, cd_loop_uv_offset)) { luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); add_v2_v2(luv->uv, offset); - change = true; + changed = true; } } } - return change; + return changed; } -static int uv_snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object *obedit) +static bool uv_snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object *obedit) { BMEditMesh *em = BKE_editmesh_from_object(obedit); BMesh *bm = em->bm; @@ -3296,7 +3296,7 @@ static int uv_snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object * BMIter iter, liter, lsubiter; MTexPoly *tface; MLoopUV *luv; - bool change = false; + bool changed = false; const int cd_loop_uv_offset = CustomData_get_offset(&bm->ldata, CD_MLOOPUV); const int cd_poly_tex_offset = CustomData_get_offset(&bm->pdata, CD_MTEXPOLY); @@ -3335,14 +3335,14 @@ static int uv_snap_uvs_to_adjacent_unselected(Scene *scene, Image *ima, Object * if (uv_tot) { luv = BM_ELEM_CD_GET_VOID_P(l, cd_loop_uv_offset); mul_v2_v2fl(luv->uv, uv, 1.0f / (float)uv_tot); - change = true; + changed = true; } } } } } - return change; + return changed; } static bool uv_snap_uvs_to_pixels(SpaceImage *sima, Scene *scene, Object *obedit) @@ -3356,7 +3356,7 @@ static bool uv_snap_uvs_to_pixels(SpaceImage *sima, Scene *scene, Object *obedit MLoopUV *luv; int width = 0, height = 0; float w, h; - bool change = false; + bool changed = false; const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV); const int cd_poly_tex_offset = CustomData_get_offset(&em->bm->pdata, CD_MTEXPOLY); @@ -3377,10 +3377,10 @@ static bool uv_snap_uvs_to_pixels(SpaceImage *sima, Scene *scene, Object *obedit } } - change = true; + changed = true; } - return change; + return changed; } static int uv_snap_selection_exec(bContext *C, wmOperator *op) @@ -3389,14 +3389,14 @@ static int uv_snap_selection_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); Object *obedit = CTX_data_edit_object(C); Image *ima = CTX_data_edit_image(C); - bool change = false; + bool changed = false; switch (RNA_enum_get(op->ptr, "target")) { case 0: - change = uv_snap_uvs_to_pixels(sima, scene, obedit); + changed = uv_snap_uvs_to_pixels(sima, scene, obedit); break; case 1: - change = uv_snap_uvs_to_cursor(scene, ima, obedit, sima->cursor); + changed = uv_snap_uvs_to_cursor(scene, ima, obedit, sima->cursor); break; case 2: { @@ -3404,16 +3404,16 @@ static int uv_snap_selection_exec(bContext *C, wmOperator *op) if (uvedit_center(scene, ima, obedit, center, sima->around)) { float offset[2]; sub_v2_v2v2(offset, sima->cursor, center); - change = uv_snap_uvs_offset(scene, ima, obedit, offset); + changed = uv_snap_uvs_offset(scene, ima, obedit, offset); } break; } case 3: - change = uv_snap_uvs_to_adjacent_unselected(scene, ima, obedit); + changed = uv_snap_uvs_to_adjacent_unselected(scene, ima, obedit); break; } - if (!change) + if (!changed) return OPERATOR_CANCELLED; uvedit_live_unwrap_update(sima, scene, obedit); |