Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/mesh/editmesh_knife.c')
-rw-r--r--source/blender/editors/mesh/editmesh_knife.c31
1 files changed, 3 insertions, 28 deletions
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index 022e753dd40..040a40c470a 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -2954,20 +2954,6 @@ static void knifetool_exit(bContext *C, wmOperator *op)
op->customdata = NULL;
}
-static void cage_mapped_verts_callback(void *userData, int index, const float co[3],
- const float UNUSED(no_f[3]), const short UNUSED(no_s[3]))
-{
- void **data = userData;
- BMEditMesh *em = data[0];
- float (*cagecos)[3] = data[1];
- SmallHash *hash = data[2];
-
- if (index >= 0 && index < em->bm->totvert && !BLI_smallhash_haskey(hash, index)) {
- BLI_smallhash_insert(hash, index, NULL);
- copy_v3_v3(cagecos[index], co);
- }
-}
-
static void knifetool_update_mval(KnifeTool_OpData *kcd, const float mval[2])
{
knife_recalc_projmat(kcd);
@@ -2990,9 +2976,6 @@ static void knifetool_init(bContext *C, KnifeTool_OpData *kcd,
{
Scene *scene = CTX_data_scene(C);
Object *obedit = CTX_data_edit_object(C);
- DerivedMesh *cage, *final;
- SmallHash shash;
- void *data[3];
/* assign the drawing handle for drawing preview line... */
kcd->ob = obedit;
@@ -3004,20 +2987,12 @@ static void knifetool_init(bContext *C, KnifeTool_OpData *kcd,
BM_mesh_elem_index_ensure(kcd->em->bm, BM_VERT);
- cage = editbmesh_get_derived_cage_and_final(scene, obedit, kcd->em, &final, CD_MASK_DERIVEDMESH);
- kcd->cagecos = MEM_callocN(sizeof(float) * 3 * kcd->em->bm->totvert, "knife cagecos");
- data[0] = kcd->em;
- data[1] = kcd->cagecos;
- data[2] = &shash;
-
- BLI_smallhash_init(&shash);
- cage->foreachMappedVert(cage, cage_mapped_verts_callback, data);
- BLI_smallhash_release(&shash);
+ kcd->cagecos = BKE_editmesh_vertexCos_get(kcd->em, scene, NULL);
kcd->bmbvh = BKE_bmbvh_new(kcd->em,
- (BMBVH_USE_CAGE | BMBVH_RETURN_ORIG) |
+ BMBVH_RETURN_ORIG |
(only_select ? BMBVH_RESPECT_SELECT : BMBVH_RESPECT_HIDDEN),
- scene);
+ kcd->cagecos, false);
kcd->arena = BLI_memarena_new(1 << 15, "knife");
kcd->vthresh = KMAXDIST - 1;