[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52912] trunk/blender/source/blender/ python/bmesh/bmesh_py_api.c: add destructive argument to bmesh. update_edit_mesh()

Campbell Barton ideasman42 at gmail.com
Wed Dec 12 07:57:42 CET 2012


Revision: 52912
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52912
Author:   campbellbarton
Date:     2012-12-12 06:57:41 +0000 (Wed, 12 Dec 2012)
Log Message:
-----------
add destructive argument to bmesh.update_edit_mesh()

Modified Paths:
--------------
    trunk/blender/source/blender/python/bmesh/bmesh_py_api.c

Modified: trunk/blender/source/blender/python/bmesh/bmesh_py_api.c
===================================================================
--- trunk/blender/source/blender/python/bmesh/bmesh_py_api.c	2012-12-12 06:53:39 UTC (rev 52911)
+++ trunk/blender/source/blender/python/bmesh/bmesh_py_api.c	2012-12-12 06:57:41 UTC (rev 52912)
@@ -98,7 +98,7 @@
 }
 
 PyDoc_STRVAR(bpy_bm_update_edit_mesh_doc,
-".. method:: update_edit_mesh(mesh, tessface=True)\n"
+".. method:: update_edit_mesh(mesh, tessface=True, destructive=True)\n"
 "\n"
 "   Update the mesh after changes to the BMesh in editmode, \n"
 "   optionally recalculating n-gon tessellation.\n"
@@ -107,14 +107,17 @@
 "   :type mesh: :class:`bpy.types.Mesh`\n"
 "   :arg tessface: Option to recalculate n-gon tessellation.\n"
 "   :type tessface: boolean\n"
+"   :arg destructive: Use when grometry has been added or removed.\n"
+"   :type destructive: boolean\n"
 );
 static PyObject *bpy_bm_update_edit_mesh(PyObject *UNUSED(self), PyObject *args)
 {
 	PyObject *py_me;
 	Mesh *me;
 	int do_tessface = TRUE;
+	int is_destructive = TRUE;
 
-	if (!PyArg_ParseTuple(args, "O|i:update_edit_mesh", &py_me, &do_tessface)) {
+	if (!PyArg_ParseTuple(args, "O|ii:update_edit_mesh", &py_me, &do_tessface, &is_destructive)) {
 		return NULL;
 	}
 
@@ -134,10 +137,11 @@
 		/* XXX, not great - infact this function could just not use the context at all
 		 * postpone that change until after release: BMESH_TODO - campbell */
 		extern struct bContext *BPy_GetContext(void);
-		extern void EDBM_update_generic(struct bContext *C, BMEditMesh *em, const short do_tessface);
+		extern void EDBM_update_generic(struct bContext *C, BMEditMesh *em,
+		                                const short do_tessface, const short is_destructive);
 
 		struct bContext *C = BPy_GetContext();
-		EDBM_update_generic(C, me->edit_btmesh, do_tessface);
+		EDBM_update_generic(C, me->edit_btmesh, do_tessface, is_destructive);
 	}
 
 	Py_RETURN_NONE;




More information about the Bf-blender-cvs mailing list