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?
This commit is contained in:
Howard Trickey 2018-11-27 09:54:49 -05:00
parent 1d4ad68198
commit 365a5b75c1
2 changed files with 4 additions and 1 deletions

View File

@ -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'}},
},

View File

@ -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);
}
}