diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-12-06 08:52:49 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-12-06 08:52:49 +0300 |
commit | aeffaf75aba037271e843373a52a8022dceece65 (patch) | |
tree | d4de94711e72f0d3c861a6d1434364a897c9b247 /source/blender/editors/mesh/editmesh_knife.c | |
parent | 6c19412ad119f1e0487956f68a2d50c434017dda (diff) |
Fix knife project, add to mesh menu
Diffstat (limited to 'source/blender/editors/mesh/editmesh_knife.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_knife.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index 2e442d97fad..7313469eda9 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -54,8 +54,6 @@ #include "BKE_editmesh_bvh.h" #include "BKE_report.h" -#include "DEG_depsgraph.h" - #include "GPU_immediate.h" #include "GPU_matrix.h" #include "GPU_state.h" @@ -76,6 +74,9 @@ #include "RNA_access.h" #include "RNA_define.h" +#include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" + #include "mesh_intern.h" /* own include */ /* detect isolated holes and fill them */ @@ -2601,7 +2602,12 @@ static void knifetool_init_bmbvh(KnifeTool_OpData *kcd) { BM_mesh_elem_index_ensure(kcd->em->bm, BM_VERT); - kcd->cagecos = (const float (*)[3])BKE_editmesh_vertexCos_get(kcd->vc.depsgraph, kcd->em, kcd->scene, NULL); + Scene *scene_eval = (Scene *)DEG_get_evaluated_id(kcd->vc.depsgraph, &kcd->scene->id); + Object *obedit_eval = (Object *)DEG_get_evaluated_id(kcd->vc.depsgraph, &kcd->em->ob->id); + BMEditMesh *em_eval = BKE_editmesh_from_object(obedit_eval); + + kcd->cagecos = (const float (*)[3])BKE_editmesh_vertexCos_get( + kcd->vc.depsgraph, em_eval, scene_eval, NULL); kcd->bmbvh = BKE_bmbvh_new_from_editmesh( kcd->em, |