diff options
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r-- | source/blender/editors/mesh/editmesh_knife_project.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/source/blender/editors/mesh/editmesh_knife_project.c b/source/blender/editors/mesh/editmesh_knife_project.c index ba030c42a04..5a61c5aab48 100644 --- a/source/blender/editors/mesh/editmesh_knife_project.c +++ b/source/blender/editors/mesh/editmesh_knife_project.c @@ -62,27 +62,28 @@ static LinkNode *knifeproject_poly_from_object(const bContext *C, Scene *scene, { Depsgraph *depsgraph = CTX_data_depsgraph(C); ARegion *ar = CTX_wm_region(C); - DerivedMesh *dm; - bool dm_needsFree; + struct Mesh *me_eval; + bool me_eval_needs_free; if (ob->type == OB_MESH || ob->derivedFinal) { - dm = ob->derivedFinal ? ob->derivedFinal : mesh_get_derived_final(depsgraph, scene, ob, CD_MASK_BAREMESH); - dm_needsFree = false; + me_eval = (ob->runtime.mesh_eval ? + ob->runtime.mesh_eval : mesh_get_eval_final(depsgraph, scene, ob, CD_MASK_BAREMESH)); + me_eval_needs_free = false; } else if (ELEM(ob->type, OB_FONT, OB_CURVE, OB_SURF)) { - dm = CDDM_from_curve(ob); - dm_needsFree = true; + me_eval = BKE_mesh_new_nomain_from_curve(ob); + me_eval_needs_free = true; } else { - dm = NULL; + me_eval = NULL; } - if (dm) { + if (me_eval) { ListBase nurbslist = {NULL, NULL}; float projmat[4][4]; - BKE_mesh_to_curve_nurblist(dm, &nurbslist, 0); /* wire */ - BKE_mesh_to_curve_nurblist(dm, &nurbslist, 1); /* boundary */ + BKE_mesh_to_curve_nurblist(me_eval, &nurbslist, 0); /* wire */ + BKE_mesh_to_curve_nurblist(me_eval, &nurbslist, 1); /* boundary */ ED_view3d_ob_project_mat_get(ar->regiondata, ob, projmat); @@ -109,12 +110,11 @@ static LinkNode *knifeproject_poly_from_object(const bContext *C, Scene *scene, BKE_nurbList_free(&nurbslist); - if (dm_needsFree) { - dm->release(dm); + if (me_eval_needs_free) { + BKE_mesh_free(me_eval); } } - return polys; } |