Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_iterators.c
| Show All 33 Lines | |||||
| #include "BKE_DerivedMesh.h" | #include "BKE_DerivedMesh.h" | ||||
| #include "BKE_action.h" | #include "BKE_action.h" | ||||
| #include "BKE_armature.h" | #include "BKE_armature.h" | ||||
| #include "BKE_curve.h" | #include "BKE_curve.h" | ||||
| #include "BKE_displist.h" | #include "BKE_displist.h" | ||||
| #include "BKE_editmesh.h" | #include "BKE_editmesh.h" | ||||
| #include "BKE_mesh_iterators.h" | #include "BKE_mesh_iterators.h" | ||||
| #include "BKE_mesh_runtime.h" | #include "BKE_mesh_runtime.h" | ||||
| #include "BKE_mesh_wrapper.h" | |||||
| #include "BKE_modifier.h" | #include "BKE_modifier.h" | ||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| #include "DEG_depsgraph_query.h" | #include "DEG_depsgraph_query.h" | ||||
| #include "bmesh.h" | #include "bmesh.h" | ||||
| #include "ED_armature.h" | #include "ED_armature.h" | ||||
| ▲ Show 20 Lines • Show All 293 Lines • ▼ Show 20 Lines | void mesh_foreachScreenVert( | ||||
| void (*func)(void *userData, BMVert *eve, const float screen_co[2], int index), | void (*func)(void *userData, BMVert *eve, const float screen_co[2], int index), | ||||
| void *userData, | void *userData, | ||||
| eV3DProjTest clip_flag) | eV3DProjTest clip_flag) | ||||
| { | { | ||||
| foreachScreenVert_userData data; | foreachScreenVert_userData data; | ||||
| Mesh *me = editbmesh_get_eval_cage_from_orig( | Mesh *me = editbmesh_get_eval_cage_from_orig( | ||||
| vc->depsgraph, vc->scene, vc->obedit, &CD_MASK_BAREMESH); | vc->depsgraph, vc->scene, vc->obedit, &CD_MASK_BAREMESH); | ||||
| me = BKE_mesh_wrapper_ensure_subdivision(vc->obedit, me); | |||||
campbellbarton: While `obact` works, use `vc->obedit` instead (which is also passed to… | |||||
| ED_view3d_check_mats_rv3d(vc->rv3d); | ED_view3d_check_mats_rv3d(vc->rv3d); | ||||
| data.vc = *vc; | data.vc = *vc; | ||||
| data.func = func; | data.func = func; | ||||
| data.userData = userData; | data.userData = userData; | ||||
| data.clip_flag = clip_flag; | data.clip_flag = clip_flag; | ||||
| ▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | void mesh_foreachScreenEdge(ViewContext *vc, | ||||
| int index), | int index), | ||||
| void *userData, | void *userData, | ||||
| eV3DProjTest clip_flag) | eV3DProjTest clip_flag) | ||||
| { | { | ||||
| foreachScreenEdge_userData data; | foreachScreenEdge_userData data; | ||||
| Mesh *me = editbmesh_get_eval_cage_from_orig( | Mesh *me = editbmesh_get_eval_cage_from_orig( | ||||
| vc->depsgraph, vc->scene, vc->obedit, &CD_MASK_BAREMESH); | vc->depsgraph, vc->scene, vc->obedit, &CD_MASK_BAREMESH); | ||||
| me = BKE_mesh_wrapper_ensure_subdivision(vc->obedit, me); | |||||
| ED_view3d_check_mats_rv3d(vc->rv3d); | ED_view3d_check_mats_rv3d(vc->rv3d); | ||||
| data.vc = *vc; | data.vc = *vc; | ||||
| data.win_rect.xmin = 0; | data.win_rect.xmin = 0; | ||||
| data.win_rect.ymin = 0; | data.win_rect.ymin = 0; | ||||
| data.win_rect.xmax = vc->region->winx; | data.win_rect.xmax = vc->region->winx; | ||||
| ▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | void mesh_foreachScreenEdge_clip_bb_segment(ViewContext *vc, | ||||
| int index), | int index), | ||||
| void *userData, | void *userData, | ||||
| eV3DProjTest clip_flag) | eV3DProjTest clip_flag) | ||||
| { | { | ||||
| foreachScreenEdge_userData data; | foreachScreenEdge_userData data; | ||||
| Mesh *me = editbmesh_get_eval_cage_from_orig( | Mesh *me = editbmesh_get_eval_cage_from_orig( | ||||
| vc->depsgraph, vc->scene, vc->obedit, &CD_MASK_BAREMESH); | vc->depsgraph, vc->scene, vc->obedit, &CD_MASK_BAREMESH); | ||||
| me = BKE_mesh_wrapper_ensure_subdivision(vc->obedit, me); | |||||
| ED_view3d_check_mats_rv3d(vc->rv3d); | ED_view3d_check_mats_rv3d(vc->rv3d); | ||||
| data.vc = *vc; | data.vc = *vc; | ||||
| data.win_rect.xmin = 0; | data.win_rect.xmin = 0; | ||||
| data.win_rect.ymin = 0; | data.win_rect.ymin = 0; | ||||
| data.win_rect.xmax = vc->region->winx; | data.win_rect.xmax = vc->region->winx; | ||||
| ▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | void mesh_foreachScreenFace( | ||||
| void *userData, | void *userData, | ||||
| const eV3DProjTest clip_flag) | const eV3DProjTest clip_flag) | ||||
| { | { | ||||
| BLI_assert((clip_flag & V3D_PROJ_TEST_CLIP_CONTENT) == 0); | BLI_assert((clip_flag & V3D_PROJ_TEST_CLIP_CONTENT) == 0); | ||||
| foreachScreenFace_userData data; | foreachScreenFace_userData data; | ||||
| Mesh *me = editbmesh_get_eval_cage_from_orig( | Mesh *me = editbmesh_get_eval_cage_from_orig( | ||||
| vc->depsgraph, vc->scene, vc->obedit, &CD_MASK_BAREMESH); | vc->depsgraph, vc->scene, vc->obedit, &CD_MASK_BAREMESH); | ||||
| me = BKE_mesh_wrapper_ensure_subdivision(vc->obedit, me); | |||||
| ED_view3d_check_mats_rv3d(vc->rv3d); | ED_view3d_check_mats_rv3d(vc->rv3d); | ||||
| data.vc = *vc; | data.vc = *vc; | ||||
| data.func = func; | data.func = func; | ||||
| data.userData = userData; | data.userData = userData; | ||||
| data.clip_flag = clip_flag; | data.clip_flag = clip_flag; | ||||
| BM_mesh_elem_table_ensure(vc->em->bm, BM_FACE); | BM_mesh_elem_table_ensure(vc->em->bm, BM_FACE); | ||||
| ▲ Show 20 Lines • Show All 307 Lines • Show Last 20 Lines | |||||
While obact works, use vc->obedit instead (which is also passed to editbmesh_get_eval_cage_from_orig).