diff options
Diffstat (limited to 'source/blender/editors/uvedit/uvedit_ops.c')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_ops.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 652d07f02db..956c094c19b 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -998,9 +998,7 @@ static int uv_remove_doubles_exec(bContext *C, wmOperator *op) if (RNA_boolean_get(op->ptr, "use_unselected")) { return uv_remove_doubles_to_unselected(C, op); } - else { - return uv_remove_doubles_to_selected(C, op); - } + return uv_remove_doubles_to_selected(C, op); } static void UV_OT_remove_doubles(wmOperatorType *ot) @@ -1845,7 +1843,6 @@ static int uv_seams_from_islands_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); - const float limit[2] = {STD_UV_CONNECT_LIMIT, STD_UV_CONNECT_LIMIT}; const bool mark_seams = RNA_boolean_get(op->ptr, "mark_seams"); const bool mark_sharp = RNA_boolean_get(op->ptr, "mark_sharp"); bool changed_multi = false; @@ -1886,23 +1883,10 @@ static int uv_seams_from_islands_exec(bContext *C, wmOperator *op) continue; } - const MLoopUV *luv_curr = BM_ELEM_CD_GET_VOID_P(l_iter, cd_loop_uv_offset); - const MLoopUV *luv_next = BM_ELEM_CD_GET_VOID_P(l_iter->next, cd_loop_uv_offset); - bool mark = false; BMLoop *l_other = l_iter->radial_next; do { - const MLoopUV *luv_other_curr = BM_ELEM_CD_GET_VOID_P(l_other, cd_loop_uv_offset); - const MLoopUV *luv_other_next = BM_ELEM_CD_GET_VOID_P(l_other->next, cd_loop_uv_offset); - if (l_iter->v != l_other->v) { - SWAP(const MLoopUV *, luv_other_curr, luv_other_next); - } - - if (!compare_ff(luv_curr->uv[0], luv_other_curr->uv[0], limit[0]) || - !compare_ff(luv_curr->uv[1], luv_other_curr->uv[1], limit[1]) || - - !compare_ff(luv_next->uv[0], luv_other_next->uv[0], limit[0]) || - !compare_ff(luv_next->uv[1], luv_other_next->uv[1], limit[1])) { + if (!BM_loop_uv_share_edge_check(l_iter, l_other, cd_loop_uv_offset)) { mark = true; break; } @@ -2073,6 +2057,7 @@ void ED_operatortypes_uvedit(void) WM_operatortype_append(UV_OT_select_all); WM_operatortype_append(UV_OT_select); WM_operatortype_append(UV_OT_select_loop); + WM_operatortype_append(UV_OT_select_edge_ring); WM_operatortype_append(UV_OT_select_linked); WM_operatortype_append(UV_OT_select_linked_pick); WM_operatortype_append(UV_OT_select_split); @@ -2089,7 +2074,10 @@ void ED_operatortypes_uvedit(void) WM_operatortype_append(UV_OT_align); + WM_operatortype_append(UV_OT_rip); WM_operatortype_append(UV_OT_stitch); + WM_operatortype_append(UV_OT_shortest_path_pick); + WM_operatortype_append(UV_OT_shortest_path_select); WM_operatortype_append(UV_OT_seams_from_islands); WM_operatortype_append(UV_OT_mark_seam); @@ -2106,6 +2094,7 @@ void ED_operatortypes_uvedit(void) WM_operatortype_append(UV_OT_reset); WM_operatortype_append(UV_OT_sphere_project); WM_operatortype_append(UV_OT_unwrap); + WM_operatortype_append(UV_OT_smart_project); WM_operatortype_append(UV_OT_reveal); WM_operatortype_append(UV_OT_hide); @@ -2113,6 +2102,21 @@ void ED_operatortypes_uvedit(void) WM_operatortype_append(UV_OT_cursor_set); } +void ED_operatormacros_uvedit(void) +{ + wmOperatorType *ot; + wmOperatorTypeMacro *otmacro; + + ot = WM_operatortype_append_macro("UV_OT_rip_move", + "UV Rip Move", + "Unstitch UV's and move the result", + OPTYPE_UNDO | OPTYPE_REGISTER); + WM_operatortype_macro_define(ot, "UV_OT_rip"); + otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false); + RNA_boolean_set(otmacro->ptr, "mirror", false); +} + void ED_keymap_uvedit(wmKeyConfig *keyconf) { wmKeyMap *keymap; |