diff options
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r-- | source/blender/editors/mesh/editmesh_knife.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index f961b6aefe9..32d17f6c599 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -348,12 +348,17 @@ static KnifeVert *new_knife_vert(KnifeTool_OpData *kcd, const float co[3], const static KnifeVert *get_bm_knife_vert(KnifeTool_OpData *kcd, BMVert *v) { KnifeVert *kfv = BLI_ghash_lookup(kcd->origvertmap, v); + const float *cageco; if (!kfv) { BMIter bmiter; BMFace *f; - kfv = new_knife_vert(kcd, v->co, kcd->cagecos[BM_elem_index_get(v)]); + if (BM_elem_index_get(v) >= 0) + cageco = kcd->cagecos[BM_elem_index_get(v)]; + else + cageco = v->co; + kfv = new_knife_vert(kcd, v->co, cageco); kfv->v = v; BLI_ghash_insert(kcd->origvertmap, v, kfv); BM_ITER_ELEM (f, &bmiter, v, BM_FACES_OF_VERT) { |