Merge branch 'blender-v3.3-release'
This commit is contained in:
@@ -59,13 +59,11 @@ static void extract_edituv_tris_iter_looptri_mesh(const MeshRenderData *mr,
|
||||
void *_data)
|
||||
{
|
||||
MeshExtract_EditUvElem_Data *data = static_cast<MeshExtract_EditUvElem_Data *>(_data);
|
||||
const MPoly *mp = &mr->mpoly[mlt->poly];
|
||||
edituv_tri_add(data,
|
||||
mr->hide_poly && mr->hide_poly[mlt->poly],
|
||||
(mp->flag & ME_FACE_SEL) != 0,
|
||||
mlt->tri[0],
|
||||
mlt->tri[1],
|
||||
mlt->tri[2]);
|
||||
const BMFace *efa = bm_original_face_get(mr, mlt->poly);
|
||||
const bool mp_hidden = (efa) ? BM_elem_flag_test_bool(efa, BM_ELEM_HIDDEN) : true;
|
||||
const bool mp_select = (efa) ? BM_elem_flag_test_bool(efa, BM_ELEM_SELECT) : false;
|
||||
|
||||
edituv_tri_add(data, mp_hidden, mp_select, mlt->tri[0], mlt->tri[1], mlt->tri[2]);
|
||||
}
|
||||
|
||||
static void extract_edituv_tris_finish(const MeshRenderData *UNUSED(mr),
|
||||
@@ -125,13 +123,12 @@ static void extract_edituv_tris_iter_subdiv_mesh(const DRWSubdivCache *UNUSED(su
|
||||
MeshExtract_EditUvElem_Data *data = static_cast<MeshExtract_EditUvElem_Data *>(_data);
|
||||
const uint loop_idx = subdiv_quad_index * 4;
|
||||
|
||||
const bool hidden = mr->hide_poly && mr->hide_poly[coarse_quad - mr->mpoly];
|
||||
const BMFace *efa = bm_original_face_get(mr, coarse_quad - mr->mpoly);
|
||||
const bool mp_hidden = (efa) ? BM_elem_flag_test_bool(efa, BM_ELEM_HIDDEN) : true;
|
||||
const bool mp_select = (efa) ? BM_elem_flag_test_bool(efa, BM_ELEM_SELECT) : false;
|
||||
|
||||
edituv_tri_add(
|
||||
data, hidden, (coarse_quad->flag & ME_FACE_SEL) != 0, loop_idx, loop_idx + 1, loop_idx + 2);
|
||||
|
||||
edituv_tri_add(
|
||||
data, hidden, (coarse_quad->flag & ME_FACE_SEL) != 0, loop_idx, loop_idx + 2, loop_idx + 3);
|
||||
edituv_tri_add(data, mp_hidden, mp_select, loop_idx, loop_idx + 1, loop_idx + 2);
|
||||
edituv_tri_add(data, mp_hidden, mp_select, loop_idx, loop_idx + 2, loop_idx + 3);
|
||||
}
|
||||
|
||||
static void extract_edituv_tris_finish_subdiv(const struct DRWSubdivCache *UNUSED(subdiv_cache),
|
||||
@@ -208,14 +205,17 @@ static void extract_edituv_lines_iter_poly_bm(const MeshRenderData *UNUSED(mr),
|
||||
|
||||
static void extract_edituv_lines_iter_poly_mesh(const MeshRenderData *mr,
|
||||
const MPoly *mp,
|
||||
const int UNUSED(mp_index),
|
||||
const int mp_index,
|
||||
void *_data)
|
||||
{
|
||||
MeshExtract_EditUvElem_Data *data = static_cast<MeshExtract_EditUvElem_Data *>(_data);
|
||||
const bool hidden = mr->hide_poly && mr->hide_poly[mp - mr->mpoly];
|
||||
|
||||
const MLoop *mloop = mr->mloop;
|
||||
const int ml_index_end = mp->loopstart + mp->totloop;
|
||||
|
||||
const BMFace *efa = bm_original_face_get(mr, mp_index);
|
||||
const bool mp_hidden = (efa) ? BM_elem_flag_test_bool(efa, BM_ELEM_HIDDEN) : true;
|
||||
const bool mp_select = (efa) ? BM_elem_flag_test_bool(efa, BM_ELEM_SELECT) : false;
|
||||
|
||||
for (int ml_index = mp->loopstart; ml_index < ml_index_end; ml_index += 1) {
|
||||
const MLoop *ml = &mloop[ml_index];
|
||||
|
||||
@@ -223,8 +223,7 @@ static void extract_edituv_lines_iter_poly_mesh(const MeshRenderData *mr,
|
||||
const int ml_index_next = (ml_index == ml_index_last) ? mp->loopstart : (ml_index + 1);
|
||||
const bool real_edge = (mr->e_origindex == nullptr ||
|
||||
mr->e_origindex[ml->e] != ORIGINDEX_NONE);
|
||||
edituv_edge_add(
|
||||
data, hidden || !real_edge, (mp->flag & ME_FACE_SEL) != 0, ml_index, ml_index_next);
|
||||
edituv_edge_add(data, mp_hidden || !real_edge, mp_select, ml_index, ml_index_next);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,6 +258,9 @@ static void extract_edituv_lines_iter_subdiv_bm(const DRWSubdivCache *subdiv_cac
|
||||
MeshExtract_EditUvElem_Data *data = static_cast<MeshExtract_EditUvElem_Data *>(_data);
|
||||
int *subdiv_loop_edge_index = (int *)GPU_vertbuf_get_data(subdiv_cache->edges_orig_index);
|
||||
|
||||
const bool mp_hidden = BM_elem_flag_test_bool(coarse_poly, BM_ELEM_HIDDEN);
|
||||
const bool mp_select = BM_elem_flag_test_bool(coarse_poly, BM_ELEM_SELECT);
|
||||
|
||||
uint start_loop_idx = subdiv_quad_index * 4;
|
||||
uint end_loop_idx = (subdiv_quad_index + 1) * 4;
|
||||
for (uint loop_idx = start_loop_idx; loop_idx < end_loop_idx; loop_idx++) {
|
||||
@@ -267,8 +269,8 @@ static void extract_edituv_lines_iter_subdiv_bm(const DRWSubdivCache *subdiv_cac
|
||||
(mr->e_origindex == nullptr ||
|
||||
mr->e_origindex[edge_origindex] != ORIGINDEX_NONE));
|
||||
edituv_edge_add(data,
|
||||
BM_elem_flag_test_bool(coarse_poly, BM_ELEM_HIDDEN) != 0 || !real_edge,
|
||||
BM_elem_flag_test_bool(coarse_poly, BM_ELEM_SELECT) != 0,
|
||||
mp_hidden || !real_edge,
|
||||
mp_select,
|
||||
loop_idx,
|
||||
(loop_idx + 1 == end_loop_idx) ? start_loop_idx : (loop_idx + 1));
|
||||
}
|
||||
@@ -281,10 +283,12 @@ static void extract_edituv_lines_iter_subdiv_mesh(const DRWSubdivCache *subdiv_c
|
||||
const MPoly *coarse_poly)
|
||||
{
|
||||
MeshExtract_EditUvElem_Data *data = static_cast<MeshExtract_EditUvElem_Data *>(_data);
|
||||
const bool hidden = mr->hide_poly && mr->hide_poly[coarse_poly - mr->mpoly];
|
||||
|
||||
int *subdiv_loop_edge_index = (int *)GPU_vertbuf_get_data(subdiv_cache->edges_orig_index);
|
||||
|
||||
const BMFace *efa = bm_original_face_get(mr, coarse_poly - mr->mpoly);
|
||||
const bool mp_hidden = (efa) ? BM_elem_flag_test_bool(efa, BM_ELEM_HIDDEN) : true;
|
||||
const bool mp_select = (efa) ? BM_elem_flag_test_bool(efa, BM_ELEM_SELECT) : false;
|
||||
|
||||
uint start_loop_idx = subdiv_quad_index * 4;
|
||||
uint end_loop_idx = (subdiv_quad_index + 1) * 4;
|
||||
for (uint loop_idx = start_loop_idx; loop_idx < end_loop_idx; loop_idx++) {
|
||||
@@ -293,8 +297,8 @@ static void extract_edituv_lines_iter_subdiv_mesh(const DRWSubdivCache *subdiv_c
|
||||
(mr->e_origindex == nullptr ||
|
||||
mr->e_origindex[edge_origindex] != ORIGINDEX_NONE));
|
||||
edituv_edge_add(data,
|
||||
hidden || !real_edge,
|
||||
(coarse_poly->flag & ME_FACE_SEL) != 0,
|
||||
mp_hidden || !real_edge,
|
||||
mp_select,
|
||||
loop_idx,
|
||||
(loop_idx + 1 == end_loop_idx) ? start_loop_idx : (loop_idx + 1));
|
||||
}
|
||||
@@ -373,11 +377,14 @@ static void extract_edituv_points_iter_poly_bm(const MeshRenderData *UNUSED(mr),
|
||||
|
||||
static void extract_edituv_points_iter_poly_mesh(const MeshRenderData *mr,
|
||||
const MPoly *mp,
|
||||
const int UNUSED(mp_index),
|
||||
const int mp_index,
|
||||
void *_data)
|
||||
{
|
||||
MeshExtract_EditUvElem_Data *data = static_cast<MeshExtract_EditUvElem_Data *>(_data);
|
||||
const bool hidden = mr->hide_poly && mr->hide_poly[mp - mr->mpoly];
|
||||
|
||||
const BMFace *efa = bm_original_face_get(mr, mp_index);
|
||||
const bool mp_hidden = (efa) ? BM_elem_flag_test_bool(efa, BM_ELEM_HIDDEN) : true;
|
||||
const bool mp_select = (efa) ? BM_elem_flag_test_bool(efa, BM_ELEM_SELECT) : false;
|
||||
|
||||
const MLoop *mloop = mr->mloop;
|
||||
const int ml_index_end = mp->loopstart + mp->totloop;
|
||||
@@ -385,7 +392,7 @@ static void extract_edituv_points_iter_poly_mesh(const MeshRenderData *mr,
|
||||
const MLoop *ml = &mloop[ml_index];
|
||||
|
||||
const bool real_vert = !mr->v_origindex || mr->v_origindex[ml->v] != ORIGINDEX_NONE;
|
||||
edituv_point_add(data, hidden || !real_vert, (mp->flag & ME_FACE_SEL) != 0, ml_index);
|
||||
edituv_point_add(data, mp_hidden || !real_vert, mp_select, ml_index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -438,16 +445,19 @@ static void extract_edituv_points_iter_subdiv_mesh(const DRWSubdivCache *subdiv_
|
||||
const MPoly *coarse_quad)
|
||||
{
|
||||
MeshExtract_EditUvElem_Data *data = static_cast<MeshExtract_EditUvElem_Data *>(_data);
|
||||
const bool hidden = mr->hide_poly && mr->hide_poly[coarse_quad - mr->mpoly];
|
||||
int *subdiv_loop_vert_index = (int *)GPU_vertbuf_get_data(subdiv_cache->verts_orig_index);
|
||||
|
||||
const BMFace *efa = bm_original_face_get(mr, coarse_quad - mr->mpoly);
|
||||
const bool mp_hidden = (efa) ? BM_elem_flag_test_bool(efa, BM_ELEM_HIDDEN) : true;
|
||||
const bool mp_select = (efa) ? BM_elem_flag_test_bool(efa, BM_ELEM_SELECT) : false;
|
||||
|
||||
uint start_loop_idx = subdiv_quad_index * 4;
|
||||
uint end_loop_idx = (subdiv_quad_index + 1) * 4;
|
||||
for (uint i = start_loop_idx; i < end_loop_idx; i++) {
|
||||
const int vert_origindex = subdiv_loop_vert_index[i];
|
||||
const bool real_vert = !mr->v_origindex || (vert_origindex != -1 &&
|
||||
mr->v_origindex[vert_origindex] != ORIGINDEX_NONE);
|
||||
edituv_point_add(data, hidden || !real_vert, (coarse_quad->flag & ME_FACE_SEL) != 0, i);
|
||||
edituv_point_add(data, mp_hidden || !real_vert, mp_select, i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -527,7 +537,10 @@ static void extract_edituv_fdots_iter_poly_mesh(const MeshRenderData *mr,
|
||||
void *_data)
|
||||
{
|
||||
MeshExtract_EditUvElem_Data *data = static_cast<MeshExtract_EditUvElem_Data *>(_data);
|
||||
const bool hidden = mr->hide_poly && mr->hide_poly[mp - mr->mpoly];
|
||||
|
||||
const BMFace *efa = bm_original_face_get(mr, mp_index);
|
||||
const bool mp_hidden = (efa) ? BM_elem_flag_test_bool(efa, BM_ELEM_HIDDEN) : true;
|
||||
const bool mp_select = (efa) ? BM_elem_flag_test_bool(efa, BM_ELEM_SELECT) : false;
|
||||
|
||||
if (mr->use_subsurf_fdots) {
|
||||
const BLI_bitmap *facedot_tags = mr->me->runtime.subsurf_face_dot_tags;
|
||||
@@ -539,13 +552,12 @@ static void extract_edituv_fdots_iter_poly_mesh(const MeshRenderData *mr,
|
||||
|
||||
const bool real_fdot = !mr->p_origindex || (mr->p_origindex[mp_index] != ORIGINDEX_NONE);
|
||||
const bool subd_fdot = BLI_BITMAP_TEST(facedot_tags, ml->v);
|
||||
edituv_facedot_add(
|
||||
data, hidden || !real_fdot || !subd_fdot, (mp->flag & ME_FACE_SEL) != 0, mp_index);
|
||||
edituv_facedot_add(data, mp_hidden || !real_fdot || !subd_fdot, mp_select, mp_index);
|
||||
}
|
||||
}
|
||||
else {
|
||||
const bool real_fdot = !mr->p_origindex || (mr->p_origindex[mp_index] != ORIGINDEX_NONE);
|
||||
edituv_facedot_add(data, hidden || !real_fdot, (mp->flag & ME_FACE_SEL) != 0, mp_index);
|
||||
edituv_facedot_add(data, mp_hidden || !real_fdot, mp_select, mp_index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user