[Bf-blender-cvs] [365a5b75c11] blender2.8: Partial fix for T57868, crash when using bevel from Python.

Howard Trickey noreply at git.blender.org
Tue Nov 27 15:59:19 CET 2018


Commit: 365a5b75c11e2ab7b43edf4100e74c61cb66a7c1
Author: Howard Trickey
Date:   Tue Nov 27 09:54:49 2018 -0500
Branches: blender2.8
https://developer.blender.org/rB365a5b75c11e2ab7b43edf4100e74c61cb66a7c1

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?

===================================================================

M	source/blender/bmesh/intern/bmesh_opdefines.c
M	source/blender/bmesh/operators/bmo_bevel.c

===================================================================

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



More information about the Bf-blender-cvs mailing list