Revision: 46840
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46840
Author:   campbellbarton
Date:     2012-05-21 12:30:06 +0000 (Mon, 21 May 2012)
Log Message:
-----------
debugging check for bmesh (commented since its very slow), but useful for 
debugging some scripts.

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

Modified: trunk/blender/source/blender/python/bmesh/bmesh_py_types.c
===================================================================
--- trunk/blender/source/blender/python/bmesh/bmesh_py_types.c  2012-05-21 
11:09:53 UTC (rev 46839)
+++ trunk/blender/source/blender/python/bmesh/bmesh_py_types.c  2012-05-21 
12:30:06 UTC (rev 46840)
@@ -3115,6 +3115,21 @@
 int bpy_bm_generic_valid_check(BPy_BMGeneric *self)
 {
        if (LIKELY(self->bm)) {
+
+               /* far too slow to enable by default but handy
+                * to uncomment for debugging tricky errors,
+                * note that this will throw error on entering a
+                * function where the actual error will be caused by
+                * the previous action. */
+#if 0
+               if (BM_mesh_validate(self->bm) == FALSE) {
+                       PyErr_Format(PyExc_ReferenceError,
+                                    "BMesh used by %.200s has become invalid",
+                                    Py_TYPE(self)->tp_name);
+                       return -1;
+               }
+#endif
+
                return 0;
        }
        else {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to