[Bf-blender-cvs] [26e476b] master: Fix T41788: bmesh.utils.loop_separate, face_vert_separate() always return None

Campbell Barton noreply at git.blender.org
Fri Sep 12 02:18:21 CEST 2014


Commit: 26e476b7e13b6e7c6c4b1ce017e00fb3c9cc9de5
Author: Campbell Barton
Date:   Fri Sep 12 10:16:50 2014 +1000
Branches: master
https://developer.blender.org/rB26e476b7e13b6e7c6c4b1ce017e00fb3c9cc9de5

Fix T41788: bmesh.utils.loop_separate, face_vert_separate() always return None

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

M	source/blender/python/bmesh/bmesh_py_utils.c

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

diff --git a/source/blender/python/bmesh/bmesh_py_utils.c b/source/blender/python/bmesh/bmesh_py_utils.c
index 88e369a..7088036 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 {




More information about the Bf-blender-cvs mailing list