Differential D15895 Diff 55356 source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_edituv.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_edituv.cc
| Show First 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | static void extract_edituv_lines_iter_poly_mesh(const MeshRenderData *mr, | ||||
| const MPoly *mp, | const MPoly *mp, | ||||
| const int mp_index, | const int mp_index, | ||||
| void *_data) | void *_data) | ||||
| { | { | ||||
| MeshExtract_EditUvElem_Data *data = static_cast<MeshExtract_EditUvElem_Data *>(_data); | MeshExtract_EditUvElem_Data *data = static_cast<MeshExtract_EditUvElem_Data *>(_data); | ||||
| const MLoop *mloop = mr->mloop; | const MLoop *mloop = mr->mloop; | ||||
| const int ml_index_end = mp->loopstart + mp->totloop; | const int ml_index_end = mp->loopstart + mp->totloop; | ||||
| bool mp_hidden, mp_select; | |||||
| if (mr->bm) { | |||||
| const BMFace *efa = bm_original_face_get(mr, mp_index); | 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; | 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; | mp_select = (efa) ? BM_elem_flag_test_bool(efa, BM_ELEM_SELECT) : false; | ||||
| } | |||||
| else { | |||||
| mp_hidden = (mp->flag & ME_HIDE) != 0; | |||||
| mp_select = (mp->flag & ME_FACE_SEL) != 0; | |||||
| } | |||||
| for (int ml_index = mp->loopstart; ml_index < ml_index_end; ml_index += 1) { | for (int ml_index = mp->loopstart; ml_index < ml_index_end; ml_index += 1) { | ||||
| const MLoop *ml = &mloop[ml_index]; | const MLoop *ml = &mloop[ml_index]; | ||||
| const int ml_index_last = mp->totloop + mp->loopstart - 1; | const int ml_index_last = mp->totloop + mp->loopstart - 1; | ||||
| const int ml_index_next = (ml_index == ml_index_last) ? mp->loopstart : (ml_index + 1); | const int ml_index_next = (ml_index == ml_index_last) ? mp->loopstart : (ml_index + 1); | ||||
| const bool real_edge = (mr->e_origindex == nullptr || | const bool real_edge = (mr->e_origindex == nullptr || | ||||
| mr->e_origindex[ml->e] != ORIGINDEX_NONE); | mr->e_origindex[ml->e] != ORIGINDEX_NONE); | ||||
| ▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | static void extract_edituv_lines_iter_subdiv_mesh(const DRWSubdivCache *subdiv_cache, | ||||
| const MeshRenderData *mr, | const MeshRenderData *mr, | ||||
| void *_data, | void *_data, | ||||
| uint subdiv_quad_index, | uint subdiv_quad_index, | ||||
| const MPoly *coarse_poly) | const MPoly *coarse_poly) | ||||
| { | { | ||||
| MeshExtract_EditUvElem_Data *data = static_cast<MeshExtract_EditUvElem_Data *>(_data); | 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); | int *subdiv_loop_edge_index = (int *)GPU_vertbuf_get_data(subdiv_cache->edges_orig_index); | ||||
| bool mp_hidden, mp_select; | |||||
| if (mr->bm) { | |||||
| const BMFace *efa = bm_original_face_get(mr, coarse_poly - mr->mpoly); | 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; | 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; | mp_select = (efa) ? BM_elem_flag_test_bool(efa, BM_ELEM_SELECT) : false; | ||||
| } | |||||
| else { | |||||
| mp_hidden = (coarse_poly->flag & ME_HIDE) != 0; | |||||
| mp_select = (coarse_poly->flag & ME_FACE_SEL) != 0; | |||||
| } | |||||
| uint start_loop_idx = subdiv_quad_index * 4; | uint start_loop_idx = subdiv_quad_index * 4; | ||||
| uint end_loop_idx = (subdiv_quad_index + 1) * 4; | uint end_loop_idx = (subdiv_quad_index + 1) * 4; | ||||
| for (uint loop_idx = start_loop_idx; loop_idx < end_loop_idx; loop_idx++) { | for (uint loop_idx = start_loop_idx; loop_idx < end_loop_idx; loop_idx++) { | ||||
| const int edge_origindex = subdiv_loop_edge_index[loop_idx]; | const int edge_origindex = subdiv_loop_edge_index[loop_idx]; | ||||
| const bool real_edge = (edge_origindex != -1 && | const bool real_edge = (edge_origindex != -1 && | ||||
| (mr->e_origindex == nullptr || | (mr->e_origindex == nullptr || | ||||
| mr->e_origindex[edge_origindex] != ORIGINDEX_NONE)); | mr->e_origindex[edge_origindex] != ORIGINDEX_NONE)); | ||||
| ▲ Show 20 Lines • Show All 296 Lines • Show Last 20 Lines | |||||