diff options
author | Howard Trickey <howard.trickey@gmail.com> | 2018-11-27 17:54:49 +0300 |
---|---|---|
committer | Howard Trickey <howard.trickey@gmail.com> | 2018-11-27 17:59:03 +0300 |
commit | 365a5b75c11e2ab7b43edf4100e74c61cb66a7c1 (patch) | |
tree | 2b7b05b2964e72c99641ae27e83aa4efef51fae7 /source/blender/bmesh | |
parent | 1d4ad6819857c2af3b3c6a2e287e120dc7125e6e (diff) |
Partial fix for T57868, crash when using bevel from Python.
These changes are necessary. Need to mark vertices of edges passed
in geom; also the normals.out slot has a custom element type, not
ELEM, so need to prevent attempt by python code to convert it to
an elem. But this leaves a memory leak. I will rework code to not
use normals.out slot at all, but that's a bigger fix.
Now there is a crash in a different place (GPU code). Think that if
using Op on its own (instead of from edbm_bevel_calc, there needs to
be a dependency graph update and maybe more?
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_opdefines.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_bevel.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c index 778ca89d70c..b7df6d8f90b 100644 --- a/source/blender/bmesh/intern/bmesh_opdefines.c +++ b/source/blender/bmesh/intern/bmesh_opdefines.c @@ -1769,7 +1769,7 @@ static BMOpDefine bmo_bevel_def = { {{"faces.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_FACE}}, /* output faces */ {"edges.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* output edges */ {"verts.out", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* output verts */ - {"normals.out", BMO_OP_SLOT_MAPPING, {(int)BMO_OP_SLOT_SUBTYPE_MAP_ELEM}}, /* output normals per vertex for beveled edges */ + {"normals.out", BMO_OP_SLOT_MAPPING, {(int)BMO_OP_SLOT_SUBTYPE_MAP_INTERNAL}}, /* output normals per vertex for beveled edges */ {{'\0'}}, }, diff --git a/source/blender/bmesh/operators/bmo_bevel.c b/source/blender/bmesh/operators/bmo_bevel.c index 8bc219d8421..656a446d5ab 100644 --- a/source/blender/bmesh/operators/bmo_bevel.c +++ b/source/blender/bmesh/operators/bmo_bevel.c @@ -63,6 +63,9 @@ void bmo_bevel_exec(BMesh *bm, BMOperator *op) BMO_ITER (e, &siter, op->slots_in, "geom", BM_EDGE) { if (BM_edge_is_manifold(e)) { BM_elem_flag_enable(e, BM_ELEM_TAG); + /* in case verts were not also included in the geom */ + BM_elem_flag_enable(e->v1, BM_ELEM_TAG); + BM_elem_flag_enable(e->v2, BM_ELEM_TAG); } } |