From 26e476b7e13b6e7c6c4b1ce017e00fb3c9cc9de5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 12 Sep 2014 10:16:50 +1000 Subject: [PATCH] Fix T41788: bmesh.utils.loop_separate, face_vert_separate() always return None --- source/blender/python/bmesh/bmesh_py_utils.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/source/blender/python/bmesh/bmesh_py_utils.c b/source/blender/python/bmesh/bmesh_py_utils.c index 88e369af8bb..7088036245a 100644 --- a/source/blender/python/bmesh/bmesh_py_utils.c +++ b/source/blender/python/bmesh/bmesh_py_utils.c @@ -679,7 +679,7 @@ static PyObject *bpy_bm_utils_face_vert_separate(PyObject *UNUSED(self), PyObjec BMesh *bm; BMLoop *l; - BMVert *v_new; + BMVert *v_old, *v_new; if (!PyArg_ParseTuple(args, "O!O!:face_vert_separate", &BPy_BMFace_Type, &py_face, @@ -701,9 +701,10 @@ static PyObject *bpy_bm_utils_face_vert_separate(PyObject *UNUSED(self), PyObjec return NULL; } + v_old = l->v; v_new = BM_face_loop_separate(bm, l); - if (v_new != l->v) { + if (v_new != v_old) { return BPy_BMVert_CreatePyObject(bm, v_new); } else { @@ -751,7 +752,8 @@ PyDoc_STRVAR(bpy_bm_utils_loop_separate_doc, static PyObject *bpy_bm_utils_loop_separate(PyObject *UNUSED(self), BPy_BMLoop *value) { BMesh *bm; - BMVert *v_new; + BMLoop *l; + BMVert *v_old, *v_new; if (!BPy_BMLoop_Check(value)) { PyErr_Format(PyExc_TypeError, @@ -763,10 +765,12 @@ static PyObject *bpy_bm_utils_loop_separate(PyObject *UNUSED(self), BPy_BMLoop * BPY_BM_CHECK_OBJ(value); bm = value->bm; + l = value->l; - v_new = BM_face_loop_separate(bm, value->l); + v_old = l->v; + v_new = BM_face_loop_separate(bm, l); - if (v_new != value->l->v) { + if (v_new != v_old) { return BPy_BMVert_CreatePyObject(bm, v_new); } else {