diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2018-12-01 14:46:55 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2018-12-01 14:46:55 +0300 |
commit | ee8a2edb967627370ba70c31d7e900dcd4746482 (patch) | |
tree | c2fd47371ec8c3f7367f90c1faad256aec0914e4 /source/blender/editors | |
parent | 47ef301c76f8a5471c962a4453112a0a49a8f975 (diff) |
Fix usage of mesh_get_eval_final in vertex selection.
It's a very bad idea to call this on non-COW instances - see T58150.
Also, when rebuilding mesh it's better to accumulate mask flags to
avoid possible repeated rebuilds from different users.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/mesh/meshtools.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index c9ce8ed54fc..1ba49537afd 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -66,6 +66,7 @@ #include "DEG_depsgraph.h" #include "DEG_depsgraph_build.h" +#include "DEG_depsgraph_query.h" #include "ED_mesh.h" #include "ED_object.h" @@ -1080,11 +1081,12 @@ bool ED_mesh_pick_face_vert(bContext *C, Object *ob, const int mval[2], unsigned BLI_assert(me && GS(me->id.name) == ID_ME); if (ED_mesh_pick_face(C, ob, mval, &poly_index, size)) { - Scene *scene = CTX_data_scene(C); + Scene *scene_eval = DEG_get_evaluated_scene(depsgraph); + Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob); struct ARegion *ar = CTX_wm_region(C); /* derived mesh to find deformed locations */ - Mesh *me_eval = mesh_get_eval_final(depsgraph, scene, ob, CD_MASK_BAREMESH | CD_MASK_ORIGINDEX); + Mesh *me_eval = mesh_get_eval_final(depsgraph, scene_eval, ob_eval, CD_MASK_BAREMESH | CD_MASK_ORIGINDEX); int v_idx_best = ORIGINDEX_NONE; @@ -1209,8 +1211,11 @@ bool ED_mesh_pick_vert(bContext *C, Object *ob, const int mval[2], unsigned int (*index)--; } else { + Scene *scene_eval = DEG_get_evaluated_scene(vc.depsgraph); + Object *ob_eval = DEG_get_evaluated_object(vc.depsgraph, ob); + /* derived mesh to find deformed locations */ - Mesh *me_eval = mesh_get_eval_final(vc.depsgraph, vc.scene, ob, CD_MASK_BAREMESH); + Mesh *me_eval = mesh_get_eval_final(vc.depsgraph, scene_eval, ob_eval, CD_MASK_BAREMESH); ARegion *ar = vc.ar; RegionView3D *rv3d = ar->regiondata; |