Fix T82540: Smart UV project ignores seams
The seam check was missed in 9296ba8674
which calculates islands from the BMesh.
This commit is contained in:
@@ -241,6 +241,7 @@ struct UVPackIsland_Params {
|
|||||||
int rotate_align_axis : 2;
|
int rotate_align_axis : 2;
|
||||||
uint only_selected_uvs : 1;
|
uint only_selected_uvs : 1;
|
||||||
uint only_selected_faces : 1;
|
uint only_selected_faces : 1;
|
||||||
|
uint use_seams : 1;
|
||||||
uint correct_aspect : 1;
|
uint correct_aspect : 1;
|
||||||
};
|
};
|
||||||
void ED_uvedit_pack_islands_multi(const Scene *scene,
|
void ED_uvedit_pack_islands_multi(const Scene *scene,
|
||||||
|
|||||||
@@ -249,11 +249,19 @@ struct FaceIsland {
|
|||||||
|
|
||||||
struct SharedUVLoopData {
|
struct SharedUVLoopData {
|
||||||
uint cd_loop_uv_offset;
|
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)
|
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;
|
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);
|
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,
|
ListBase *island_list,
|
||||||
const bool only_selected_faces,
|
const bool only_selected_faces,
|
||||||
const bool only_selected_uvs,
|
const bool only_selected_uvs,
|
||||||
|
const bool use_seams,
|
||||||
const float aspect_y,
|
const float aspect_y,
|
||||||
const uint cd_loop_uv_offset)
|
const uint cd_loop_uv_offset)
|
||||||
{
|
{
|
||||||
@@ -273,6 +282,7 @@ static int bm_mesh_calc_uv_islands(const Scene *scene,
|
|||||||
|
|
||||||
struct SharedUVLoopData user_data = {
|
struct SharedUVLoopData user_data = {
|
||||||
.cd_loop_uv_offset = cd_loop_uv_offset,
|
.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__);
|
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,
|
&island_list,
|
||||||
params->only_selected_faces,
|
params->only_selected_faces,
|
||||||
params->only_selected_uvs,
|
params->only_selected_uvs,
|
||||||
|
params->use_seams,
|
||||||
aspect_y,
|
aspect_y,
|
||||||
cd_loop_uv_offset);
|
cd_loop_uv_offset);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2174,6 +2174,7 @@ static int smart_project_exec(bContext *C, wmOperator *op)
|
|||||||
.rotate_align_axis = 1,
|
.rotate_align_axis = 1,
|
||||||
.only_selected_faces = true,
|
.only_selected_faces = true,
|
||||||
.correct_aspect = true,
|
.correct_aspect = true,
|
||||||
|
.use_seams = true,
|
||||||
});
|
});
|
||||||
|
|
||||||
uv_map_clip_correct_multi(objects_changed, object_changed_len, op);
|
uv_map_clip_correct_multi(objects_changed, object_changed_len, op);
|
||||||
|
|||||||
Reference in New Issue
Block a user