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-03-11 09:58:22 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-03-11 09:58:22 +0400
commit7fa7e4ba1faf7a122f99a683c04935e01725061c (patch)
tree7d55eacad074fd83c744de19cae006a7d9f86eac /source/blender/bmesh/intern/bmesh_mesh.c
parent050439fd9dcf3b7e79bae1fd409364cb1220e598 (diff)
bmesh python api additions:
- BMesh.is_wrapped - BMesh.copy() - BMesh.clear() - BMesh.free() - BMesh.from_object(obj, apply_modifiers=True) - BMEdge.calc_length() - BMLoop.calc_normal() - BMLoop.calc_tangent()
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_mesh.c')
-rw-r--r--source/blender/bmesh/intern/bmesh_mesh.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c
index 63719e778f7..392887e3aec 100644
--- a/source/blender/bmesh/intern/bmesh_mesh.c
+++ b/source/blender/bmesh/intern/bmesh_mesh.c
@@ -154,13 +154,6 @@ void BM_mesh_data_free(BMesh *bm)
BLI_freelistN(&bm->selected);
- if (bm->py_handle) {
- extern void bpy_bm_generic_invalidate(void *self);
-
- bpy_bm_generic_invalidate(bm->py_handle);
- bm->py_handle = NULL;
- }
-
BMO_error_clear(bm);
}
@@ -195,6 +188,16 @@ void BM_mesh_clear(BMesh *bm)
void BM_mesh_free(BMesh *bm)
{
BM_mesh_data_free(bm);
+
+ if (bm->py_handle) {
+ /* keep this out of 'BM_mesh_data_free' because we wan't python
+ * to be able to clear the mesh and maintain access. */
+ extern void bpy_bm_generic_invalidate(void *self);
+
+ bpy_bm_generic_invalidate(bm->py_handle);
+ bm->py_handle = NULL;
+ }
+
MEM_freeN(bm);
}