Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-05-21 16:30:06 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-05-21 16:30:06 +0400
commitea11bc980ad428950efb430618a6de439ffd5951 (patch)
treefc6820e3af5085289eaf0b1815723f694cecad78 /source/blender/python/bmesh
parent998a850f9f2747065ffe379097907232a85cd2d5 (diff)
debugging check for bmesh (commented since its very slow), but useful for debugging some scripts.
Diffstat (limited to 'source/blender/python/bmesh')
-rw-r--r--source/blender/python/bmesh/bmesh_py_types.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c
index 1c0040aec89..be5b4844ae6 100644
--- a/source/blender/python/bmesh/bmesh_py_types.c
+++ b/source/blender/python/bmesh/bmesh_py_types.c
@@ -3115,6 +3115,21 @@ PyObject *BPy_BMElem_CreatePyObject(BMesh *bm, BMHeader *ele)
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 {