Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/transform/transform_snap_object.cc
| Show First 20 Lines • Show All 890 Lines • ▼ Show 20 Lines | if (sctx->callbacks.edit_mesh.test_face_fn) { | ||||
| BLI_bitmap *elem_mask = BLI_BITMAP_NEW(em->tottri, __func__); | BLI_bitmap *elem_mask = BLI_BITMAP_NEW(em->tottri, __func__); | ||||
| int looptri_num_active = BM_iter_mesh_bitmap_from_filter_tessface( | int looptri_num_active = BM_iter_mesh_bitmap_from_filter_tessface( | ||||
| bm, | bm, | ||||
| elem_mask, | elem_mask, | ||||
| sctx->callbacks.edit_mesh.test_face_fn, | sctx->callbacks.edit_mesh.test_face_fn, | ||||
| sctx->callbacks.edit_mesh.user_data); | sctx->callbacks.edit_mesh.user_data); | ||||
| bvhtree_from_editmesh_looptri_ex(treedata, | bvhtree_from_editmesh_looptri_ex(treedata, em, elem_mask, looptri_num_active, 0.0f, 4, 6, false); | ||||
| em, | |||||
| elem_mask, | |||||
| looptri_num_active, | |||||
| 0.0f, | |||||
| 4, | |||||
| 6, | |||||
| BVHTREE_FROM_EM_LOOPTRI, | |||||
| nullptr, | |||||
| nullptr); | |||||
| MEM_freeN(elem_mask); | MEM_freeN(elem_mask); | ||||
| } | } | ||||
| else { | else { | ||||
| /* Only cache if bvhtree is created without a mask. | /* Only cache if bvhtree is created without a mask. | ||||
| * This helps keep a standardized bvhtree in cache. */ | * This helps keep a standardized bvhtree in cache. */ | ||||
| BKE_bvhtree_from_editmesh_get(treedata, | BKE_bvhtree_from_editmesh_get(treedata, | ||||
| em, | em, | ||||
| ▲ Show 20 Lines • Show All 1,647 Lines • ▼ Show 20 Lines | if (treedata.tree == nullptr) { | ||||
| verts_mask = BLI_BITMAP_NEW(em->bm->totvert, __func__); | verts_mask = BLI_BITMAP_NEW(em->bm->totvert, __func__); | ||||
| verts_num_active = BM_iter_mesh_bitmap_from_filter( | verts_num_active = BM_iter_mesh_bitmap_from_filter( | ||||
| BM_VERTS_OF_MESH, | BM_VERTS_OF_MESH, | ||||
| em->bm, | em->bm, | ||||
| verts_mask, | verts_mask, | ||||
| (bool (*)(BMElem *, void *))sctx->callbacks.edit_mesh.test_vert_fn, | (bool (*)(BMElem *, void *))sctx->callbacks.edit_mesh.test_vert_fn, | ||||
| sctx->callbacks.edit_mesh.user_data); | sctx->callbacks.edit_mesh.user_data); | ||||
| bvhtree_from_editmesh_verts_ex(&treedata, | bvhtree_from_editmesh_verts_ex(&treedata, em, verts_mask, verts_num_active, 0.0f, 2, 6, false); | ||||
| em, | |||||
| verts_mask, | |||||
| verts_num_active, | |||||
| 0.0f, | |||||
| 2, | |||||
| 6, | |||||
| BVHTREE_FROM_VERTS, | |||||
| nullptr, | |||||
| nullptr); | |||||
| MEM_freeN(verts_mask); | MEM_freeN(verts_mask); | ||||
| } | } | ||||
| else { | else { | ||||
| BKE_bvhtree_from_editmesh_get(&treedata, | BKE_bvhtree_from_editmesh_get(&treedata, | ||||
| em, | em, | ||||
| 2, | 2, | ||||
| BVHTREE_FROM_EM_VERTS, | BVHTREE_FROM_EM_VERTS, | ||||
| &sod->mesh_runtime->bvh_cache, | &sod->mesh_runtime->bvh_cache, | ||||
| Show All 15 Lines | if (treedata.tree == nullptr) { | ||||
| edges_mask = BLI_BITMAP_NEW(em->bm->totedge, __func__); | edges_mask = BLI_BITMAP_NEW(em->bm->totedge, __func__); | ||||
| edges_num_active = BM_iter_mesh_bitmap_from_filter( | edges_num_active = BM_iter_mesh_bitmap_from_filter( | ||||
| BM_EDGES_OF_MESH, | BM_EDGES_OF_MESH, | ||||
| em->bm, | em->bm, | ||||
| edges_mask, | edges_mask, | ||||
| (bool (*)(BMElem *, void *))sctx->callbacks.edit_mesh.test_edge_fn, | (bool (*)(BMElem *, void *))sctx->callbacks.edit_mesh.test_edge_fn, | ||||
| sctx->callbacks.edit_mesh.user_data); | sctx->callbacks.edit_mesh.user_data); | ||||
| bvhtree_from_editmesh_edges_ex(&treedata, | bvhtree_from_editmesh_edges_ex(&treedata, em, edges_mask, edges_num_active, 0.0f, 2, 6, false); | ||||
| em, | |||||
| edges_mask, | |||||
| edges_num_active, | |||||
| 0.0f, | |||||
| 2, | |||||
| 6, | |||||
| BVHTREE_FROM_VERTS, | |||||
| nullptr, | |||||
| nullptr); | |||||
| MEM_freeN(edges_mask); | MEM_freeN(edges_mask); | ||||
| } | } | ||||
| else { | else { | ||||
| BKE_bvhtree_from_editmesh_get(&treedata, | BKE_bvhtree_from_editmesh_get(&treedata, | ||||
| em, | em, | ||||
| 2, | 2, | ||||
| BVHTREE_FROM_EM_EDGES, | BVHTREE_FROM_EM_EDGES, | ||||
| &sod->mesh_runtime->bvh_cache, | &sod->mesh_runtime->bvh_cache, | ||||
| ▲ Show 20 Lines • Show All 693 Lines • Show Last 20 Lines | |||||