From 8f543a73abc42843fb924fc6d849e3055e3ae011 Mon Sep 17 00:00:00 2001 From: Chris Blackbourn Date: Wed, 13 Jul 2022 11:39:06 +1200 Subject: Fix T99659: Improve UV Island calculation with hidden faces. Simplify interface, regularize implementation and some light cleanup. See also: T79304 and D15419. --- source/blender/editors/uvedit/uvedit_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/uvedit/uvedit_ops.c') diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 4844ff22b68..4e99eb3fc0f 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -544,7 +544,7 @@ static bool uvedit_uv_straighten(Scene *scene, BMesh *bm, eUVWeldAlign tool) return false; } - UvElementMap *element_map = BM_uv_element_map_create(bm, scene, false, true, false, true); + UvElementMap *element_map = BM_uv_element_map_create(bm, scene, true, false, true); if (element_map == NULL) { return false; } -- cgit v1.2.3 From 3b7ac10d6252a2a9cecbb9be7850a1dea41e281d Mon Sep 17 00:00:00 2001 From: Tomek Gubala Date: Tue, 19 Jul 2022 19:24:20 +0200 Subject: UV: add Snap Cursor to Origin Similar to snapping to the world origin in the 3D viewport. This can be found in the Shift+S pie menu and UV > Snap menu. Differential Revision: https://developer.blender.org/D15055 --- source/blender/editors/uvedit/uvedit_ops.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source/blender/editors/uvedit/uvedit_ops.c') diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 4e99eb3fc0f..74a9989f550 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -1036,6 +1036,12 @@ static bool uv_snap_cursor_to_selection(Scene *scene, return ED_uvedit_center_multi(scene, objects_edit, objects_len, sima->cursor, sima->around); } +static void uv_snap_cursor_to_origin(float uvco[2]) +{ + uvco[0] = 0; + uvco[1] = 0; +} + static int uv_snap_cursor_exec(bContext *C, wmOperator *op) { SpaceImage *sima = CTX_wm_space_image(C); @@ -1058,6 +1064,10 @@ static int uv_snap_cursor_exec(bContext *C, wmOperator *op) MEM_freeN(objects); break; } + case 2: + uv_snap_cursor_to_origin(sima->cursor); + changed = true; + break; } if (!changed) { @@ -1074,6 +1084,7 @@ static void UV_OT_snap_cursor(wmOperatorType *ot) static const EnumPropertyItem target_items[] = { {0, "PIXELS", 0, "Pixels", ""}, {1, "SELECTED", 0, "Selected", ""}, + {2, "ORIGIN", 0, "Origin", ""}, {0, NULL, 0, NULL, NULL}, }; -- cgit v1.2.3