diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-08-22 08:11:21 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-08-22 08:15:21 +0300 |
commit | d9de8c469b404819806a63749a0e4e7cbd209044 (patch) | |
tree | 95021f21e04624804521a555936f2e580b2f7c77 /source/blender/editors/mesh/editmesh_loopcut.c | |
parent | f047224458774871f8bf946b86e64a6aa9c00db2 (diff) |
BMesh: loop-cut, display deformed coordinates
Previously this used derived mesh, now use evaluated data.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_loopcut.c')
-rw-r--r-- | source/blender/editors/mesh/editmesh_loopcut.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c index 4fc57224580..f239ccc5be1 100644 --- a/source/blender/editors/mesh/editmesh_loopcut.c +++ b/source/blender/editors/mesh/editmesh_loopcut.c @@ -38,6 +38,8 @@ #include "BLT_translation.h" +#include "DNA_mesh_types.h" + #include "BKE_context.h" #include "BKE_modifier.h" #include "BKE_report.h" @@ -66,6 +68,7 @@ #include "WM_types.h" #include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" #include "mesh_intern.h" /* own include */ @@ -83,6 +86,8 @@ typedef struct RingSelOpData { ViewContext vc; + Depsgraph *depsgraph; + Object **objects; uint objects_len; @@ -142,7 +147,14 @@ static void edgering_select(RingSelOpData *lcd) static void ringsel_find_edge(RingSelOpData *lcd, const int previewlines) { if (lcd->eed) { - EDBM_preselect_edgering_update_from_edge(lcd->presel_edgering, lcd->em->bm, lcd->eed, previewlines); + const float (*coords)[3] = NULL; + { + Mesh *me_eval = (Mesh *)DEG_get_evaluated_id(lcd->depsgraph, lcd->ob->data); + if (me_eval->runtime.edit_data) { + coords = me_eval->runtime.edit_data->vertexCos; + } + } + EDBM_preselect_edgering_update_from_edge(lcd->presel_edgering, lcd->em->bm, lcd->eed, previewlines, coords); } else { EDBM_preselect_edgering_clear(lcd->presel_edgering); @@ -253,6 +265,8 @@ static int ringsel_init(bContext *C, wmOperator *op, bool do_cut) em_setup_viewcontext(C, &lcd->vc); + lcd->depsgraph = CTX_data_depsgraph(C); + /* assign the drawing handle for drawing preview line... */ lcd->ar = CTX_wm_region(C); lcd->draw_handle = ED_region_draw_cb_activate(lcd->ar->type, ringsel_draw, lcd, REGION_DRAW_POST_VIEW); |