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:
Diffstat (limited to 'source/blender/editors/uvedit/uvedit_ops.c')
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index 4844ff22b68..74a9989f550 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;
}
@@ -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},
};