diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/include/ED_uvedit.h | 1 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_islands.c | 11 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_unwrap_ops.c | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/editors/include/ED_uvedit.h b/source/blender/editors/include/ED_uvedit.h index a55e97fff72..2066d7da511 100644 --- a/source/blender/editors/include/ED_uvedit.h +++ b/source/blender/editors/include/ED_uvedit.h @@ -241,6 +241,7 @@ struct UVPackIsland_Params { int rotate_align_axis : 2; uint only_selected_uvs : 1; uint only_selected_faces : 1; + uint use_seams : 1; uint correct_aspect : 1; }; void ED_uvedit_pack_islands_multi(const Scene *scene, diff --git a/source/blender/editors/uvedit/uvedit_islands.c b/source/blender/editors/uvedit/uvedit_islands.c index ddca05bedc5..8a8259d335a 100644 --- a/source/blender/editors/uvedit/uvedit_islands.c +++ b/source/blender/editors/uvedit/uvedit_islands.c @@ -249,11 +249,19 @@ struct FaceIsland { struct SharedUVLoopData { uint cd_loop_uv_offset; + bool use_seams; }; static bool bm_loop_uv_shared_edge_check(const BMLoop *l_a, const BMLoop *l_b, void *user_data) { const struct SharedUVLoopData *data = user_data; + + if (data->use_seams) { + if (BM_elem_flag_test(l_a->e, BM_ELEM_SEAM)) { + return false; + } + } + return BM_loop_uv_share_edge_check((BMLoop *)l_a, (BMLoop *)l_b, data->cd_loop_uv_offset); } @@ -265,6 +273,7 @@ static int bm_mesh_calc_uv_islands(const Scene *scene, ListBase *island_list, const bool only_selected_faces, const bool only_selected_uvs, + const bool use_seams, const float aspect_y, const uint cd_loop_uv_offset) { @@ -273,6 +282,7 @@ static int bm_mesh_calc_uv_islands(const Scene *scene, struct SharedUVLoopData user_data = { .cd_loop_uv_offset = cd_loop_uv_offset, + .use_seams = use_seams, }; int *groups_array = MEM_mallocN(sizeof(*groups_array) * (size_t)bm->totface, __func__); @@ -377,6 +387,7 @@ void ED_uvedit_pack_islands_multi(const Scene *scene, &island_list, params->only_selected_faces, params->only_selected_uvs, + params->use_seams, aspect_y, cd_loop_uv_offset); } diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 6989f0afbe8..108eca209b9 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -2174,6 +2174,7 @@ static int smart_project_exec(bContext *C, wmOperator *op) .rotate_align_axis = 1, .only_selected_faces = true, .correct_aspect = true, + .use_seams = true, }); uv_map_clip_correct_multi(objects_changed, object_changed_len, op); |