diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-10-28 06:05:33 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-10-28 06:05:33 +0400 |
commit | 32644615988277ce60e0447f08d40ef67971bd88 (patch) | |
tree | 8fe967f21a41e097a7e1c2e56b11cab6fdf700dd /source/blender/python | |
parent | 0773fd7b78a4faf0dff69795842c3f1f82a93b9f (diff) |
move bmesh array lookup data and utility functions from editmesh into bmesh,
since enough bmesh operations can also take advantage of direct index lookups on verts/edges/faces.
developers note:
- EDBM_index_arrays_init/ensure/free -> BM_mesh_elem_table_ensure/init/free
- EDBM_vert/edge/face_at_index -> BM_vert/edge/face_at_index
- EDBM_uv_element_map_create/free -> BM_uv_element_map_create/free
- ED_uv_element_get -> BM_uv_element_get
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types.c | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index 92fb506497f..448f02a3772 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -3722,47 +3722,11 @@ char *BPy_BMElem_StringFromHType(const char htype) /* -------------------------------------------------------------------- */ /* keep at bottom */ -/* BAD INCLUDES */ - -#include "BKE_global.h" -#include "BKE_main.h" -#include "BKE_editmesh.h" -#include "DNA_scene_types.h" -#include "DNA_object_types.h" -#include "DNA_mesh_types.h" -#include "MEM_guardedalloc.h" - -/* there are cases where this warning isnt needed, otherwise it could be made into an error */ -static void bm_dealloc_warn(const char *mesh_name) -{ - PySys_WriteStdout("Modified BMesh '%.200s' from a wrapped editmesh is freed without a call " - "to bmesh.update_edit_mesh(mesh, destructive=True), this is will likely cause a crash\n", - mesh_name); -} /* this function is called on free, it should stay quite fast */ static void bm_dealloc_editmode_warn(BPy_BMesh *self) { if (self->flag & BPY_BMFLAG_IS_WRAPPED) { - /* likely editmesh */ - BMesh *bm = self->bm; - Scene *scene; - for (scene = G.main->scene.first; scene; scene = scene->id.next) { - Base *base = scene->basact; - if (base && base->object->type == OB_MESH) { - Mesh *me = base->object->data; - BMEditMesh *em = me->edit_btmesh; - if (em && em->bm == bm) { - /* not foolproof, scripter may have added/removed verts */ - if (((em->vert_index && (MEM_allocN_len(em->vert_index) / sizeof(*em->vert_index)) != bm->totvert)) || - ((em->edge_index && (MEM_allocN_len(em->edge_index) / sizeof(*em->edge_index)) != bm->totedge)) || - ((em->face_index && (MEM_allocN_len(em->face_index) / sizeof(*em->face_index)) != bm->totface))) - { - bm_dealloc_warn(me->id.name + 2); - break; - } - } - } - } + /* currently nop - this works without warnings now */ } } |