Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/mesh_extractors/extract_mesh.cc
| Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | |||||
| /** \} */ | /** \} */ | ||||
| /* ---------------------------------------------------------------------- */ | /* ---------------------------------------------------------------------- */ | ||||
| /** \name Extract Edit Flag Utils | /** \name Extract Edit Flag Utils | ||||
| * \{ */ | * \{ */ | ||||
| void mesh_render_data_face_flag(const MeshRenderData *mr, | void mesh_render_data_face_flag(const MeshRenderData *mr, | ||||
| const BMFace *efa, | const BMFace *efa, | ||||
| const int cd_ofs, | const BMUVOffsets offsets, | ||||
| EditLoopData *eattr) | EditLoopData *eattr) | ||||
| { | { | ||||
| if (efa == mr->efa_act) { | if (efa == mr->efa_act) { | ||||
| eattr->v_flag |= VFLAG_FACE_ACTIVE; | eattr->v_flag |= VFLAG_FACE_ACTIVE; | ||||
| } | } | ||||
| if (BM_elem_flag_test(efa, BM_ELEM_SELECT)) { | if (BM_elem_flag_test(efa, BM_ELEM_SELECT)) { | ||||
| eattr->v_flag |= VFLAG_FACE_SELECTED; | eattr->v_flag |= VFLAG_FACE_SELECTED; | ||||
| } | } | ||||
| if (efa == mr->efa_act_uv) { | if (efa == mr->efa_act_uv) { | ||||
| eattr->v_flag |= VFLAG_FACE_UV_ACTIVE; | eattr->v_flag |= VFLAG_FACE_UV_ACTIVE; | ||||
| } | } | ||||
| if ((cd_ofs != -1) && uvedit_face_select_test_ex(mr->toolsettings, (BMFace *)efa, cd_ofs)) { | if ((offsets.uv != -1) && uvedit_face_select_test_ex(mr->toolsettings, (BMFace *)efa, offsets)) { | ||||
| eattr->v_flag |= VFLAG_FACE_UV_SELECT; | eattr->v_flag |= VFLAG_FACE_UV_SELECT; | ||||
| } | } | ||||
| #ifdef WITH_FREESTYLE | #ifdef WITH_FREESTYLE | ||||
| if (mr->freestyle_face_ofs != -1) { | if (mr->freestyle_face_ofs != -1) { | ||||
| const FreestyleFace *ffa = (const FreestyleFace *)BM_ELEM_CD_GET_VOID_P( | const FreestyleFace *ffa = (const FreestyleFace *)BM_ELEM_CD_GET_VOID_P( | ||||
| efa, mr->freestyle_face_ofs); | efa, mr->freestyle_face_ofs); | ||||
| if (ffa->flag & FREESTYLE_FACE_MARK) { | if (ffa->flag & FREESTYLE_FACE_MARK) { | ||||
| eattr->v_flag |= VFLAG_FACE_FREESTYLE; | eattr->v_flag |= VFLAG_FACE_FREESTYLE; | ||||
| } | } | ||||
| } | } | ||||
| #endif | #endif | ||||
| } | } | ||||
| void mesh_render_data_loop_flag(const MeshRenderData *mr, | void mesh_render_data_loop_flag(const MeshRenderData *mr, | ||||
| BMLoop *l, | BMLoop *l, | ||||
| const int cd_ofs, | const BMUVOffsets offsets, | ||||
| EditLoopData *eattr) | EditLoopData *eattr) | ||||
| { | { | ||||
| if (cd_ofs == -1) { | if (offsets.uv == -1) { | ||||
| return; | return; | ||||
| } | } | ||||
| MLoopUV *luv = (MLoopUV *)BM_ELEM_CD_GET_VOID_P(l, cd_ofs); | if (BM_ELEM_CD_GET_BOOL(l, offsets.pin)) { | ||||
| if (luv != nullptr && (luv->flag & MLOOPUV_PINNED)) { | |||||
| eattr->v_flag |= VFLAG_VERT_UV_PINNED; | eattr->v_flag |= VFLAG_VERT_UV_PINNED; | ||||
| } | } | ||||
| if (uvedit_uv_select_test_ex(mr->toolsettings, l, cd_ofs)) { | if (uvedit_uv_select_test_ex(mr->toolsettings, l, offsets)) { | ||||
| eattr->v_flag |= VFLAG_VERT_UV_SELECT; | eattr->v_flag |= VFLAG_VERT_UV_SELECT; | ||||
| } | } | ||||
| } | } | ||||
| void mesh_render_data_loop_edge_flag(const MeshRenderData *mr, | void mesh_render_data_loop_edge_flag(const MeshRenderData *mr, | ||||
| BMLoop *l, | BMLoop *l, | ||||
| const int cd_ofs, | const BMUVOffsets offsets, | ||||
| EditLoopData *eattr) | EditLoopData *eattr) | ||||
| { | { | ||||
| if (cd_ofs == -1) { | if (offsets.uv == -1) { | ||||
| return; | return; | ||||
| } | } | ||||
| if (uvedit_edge_select_test_ex(mr->toolsettings, l, cd_ofs)) { | if (uvedit_edge_select_test_ex(mr->toolsettings, l, offsets)) { | ||||
| eattr->v_flag |= VFLAG_EDGE_UV_SELECT; | eattr->v_flag |= VFLAG_EDGE_UV_SELECT; | ||||
| eattr->v_flag |= VFLAG_VERT_UV_SELECT; | eattr->v_flag |= VFLAG_VERT_UV_SELECT; | ||||
| } | } | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||