- fix for python freeing its own bmesh clearing the global mirror cache.
authorCampbell Barton <ideasman42@gmail.com>
Mon, 23 Apr 2012 04:24:11 +0000 (04:24 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 23 Apr 2012 04:24:11 +0000 (04:24 +0000)
- fix for own mistake (Ctrl+T didnt set beauty peroperty).
- remove bad level includes in bmesh.

12 files changed:
source/blender/bmesh/CMakeLists.txt
source/blender/bmesh/SConscript
source/blender/bmesh/intern/bmesh_mesh.c
source/blender/bmesh/intern/bmesh_operators.h
source/blender/bmesh/intern/bmesh_polygon.c
source/blender/bmesh/operators/bmo_primitive.c
source/blender/bmesh/operators/bmo_subdivide.c
source/blender/editors/include/ED_mesh.h
source/blender/editors/mesh/editmesh_utils.c
source/blender/editors/mesh/mesh_ops.c
source/blender/makesrna/intern/rna_object_api.c
source/blender/makesrna/intern/rna_sequencer_api.c

index 016d2802094cd3b533e4cf9f9c6060f5d67c6317..1cf2b9113b2a8805ceb08e2cc61286c5619a05a4 100644 (file)
@@ -28,7 +28,6 @@ set(INC
        .
        ../blenkernel
        ../blenlib
-       ../editors/include
        ../makesdna
        ../../../intern/guardedalloc
 )
index e06f43bd85d8496fc30b18fcda22d4f58f4ee4c4..fb00aef4d78236aab16a996ff132f7f32a27bbc0 100644 (file)
@@ -8,13 +8,11 @@ sources += env.Glob('operators/*.c')
 sources += env.Glob('tools/*.c')
 
 incs = [
-       '#/intern/guardedalloc',
+       './',
        '../blenlib',
-       '../blenloader',
        '../makesdna',
        '../blenkernel',
-       './',
-       '../editors/include',
+       '#/intern/guardedalloc',
        ]
 
 defs = []
index 6c208b46244ab06ff04e372e8bd43868fb17f3d6..bd6eb7ae14929aad67d38dd58a78d00c0e2baf6e 100644 (file)
@@ -39,8 +39,6 @@
 #include "BKE_tessmesh.h"
 #include "BKE_multires.h"
 
-#include "ED_mesh.h"
-
 #include "intern/bmesh_private.h"
 
 /* used as an extern, defined in bmesh.h */
@@ -142,12 +140,6 @@ void BM_mesh_data_free(BMesh *bm)
        BLI_mempool_destroy(bm->looplistpool);
 #endif
 
-       /* These tables aren't used yet, so it's not strictly necessary
-        * to 'end' them (with 'e' param) but if someone tries to start
-        * using them, having these in place will save a lot of pain */
-       mesh_octree_table(NULL, NULL, NULL, 'e');
-       mesh_mirrtopo_table(NULL, 'e');
-
        BLI_freelistN(&bm->selected);
 
        BMO_error_clear(bm);
index 52e2018eeefa6008605a61d74f0fb0e2e339a132..f4db13e2777a307802cf51dfb996519f1b885065 100644 (file)
@@ -39,6 +39,13 @@ enum {
        SUBD_STRAIGHT_CUT
 };
 
+enum {
+       SUBDIV_SELECT_ORIG,
+       SUBDIV_SELECT_INNER,
+       SUBDIV_SELECT_INNER_SEL,
+       SUBDIV_SELECT_LOOPCUT
+};
+
 /* similar face selection slot values */
 enum {
        SIMFACE_MATERIAL = 201,
index 2e41d4b923c9e4554a0d33bbcee7ffe02452c654..fbfc253c36459aca8cab1e2d68a6c28c1abfe550 100644 (file)
@@ -445,6 +445,7 @@ void BM_face_normal_update_vcos(BMesh *bm, BMFace *f, float no[3],
 
        /* must have valid index data */
        BLI_assert((bm->elem_index_dirty & BM_VERT) == 0);
+       (void)bm;
 
        /* common cases first */
        switch (f->len) {
index fc0e34cf2f6bca3bd79bd374f8b412798c4c8486..6fd3c8ce99c17fb16a7cbe17e01a8d1b9139d7ba 100644 (file)
@@ -28,8 +28,6 @@
 
 #include "BLI_math.h"
 
-#include "ED_mesh.h"
-
 #include "bmesh.h"
 #include "intern/bmesh_private.h"
 
index 2f198992eb6b317e84a1db372bf07e9af9d2850d..d5f46ebfc8575f67c640beaa6aa300caf5011af5 100644 (file)
@@ -35,8 +35,6 @@
 
 #include "DNA_object_types.h"
 
-#include "ED_mesh.h"
-
 #include "bmesh.h"
 #include "intern/bmesh_private.h"
 
index 6a6da0cfa2610312fd73c4d1cf275bebae4149f7..10137a5a25954d2389bc50329824a3ecfc05d0eb 100644 (file)
@@ -271,11 +271,6 @@ void ED_mesh_mirrtopo_init(struct Mesh *me, const int ob_mode, MirrTopoStore_t *
                            const short skip_em_vert_array_init);
 void ED_mesh_mirrtopo_free(MirrTopoStore_t *mesh_topo_store);
 
-#define SUBDIV_SELECT_ORIG      0
-#define SUBDIV_SELECT_INNER     1
-#define SUBDIV_SELECT_INNER_SEL 2
-#define SUBDIV_SELECT_LOOPCUT   3
-
 #ifdef __cplusplus
 }
 #endif
index 468f5699bce31749ce2bb1219671cfd01a683981..074c37850f7e97094f28311c6490f2f6fec0aacf 100644 (file)
@@ -150,7 +150,7 @@ int EDBM_op_finish(BMEditMesh *em, BMOperator *bmop, wmOperator *op, const int r
                        BKE_report(op->reports, RPT_ERROR, errmsg);
                }
 
-               BMEdit_Free(em);
+               EDBM_mesh_free(em);
                *em = *emcopy;
 
                MEM_freeN(emcopy);
@@ -284,7 +284,7 @@ void EDBM_mesh_make(ToolSettings *ts, Scene *UNUSED(scene), Object *ob)
 
        if (me->edit_btmesh) {
                /* this happens when switching shape keys */
-               BMEdit_Free(me->edit_btmesh);
+               EDBM_mesh_free(me->edit_btmesh);
                MEM_freeN(me->edit_btmesh);
        }
 
@@ -315,9 +315,18 @@ void EDBM_mesh_load(Object *ob)
 #endif
 }
 
-void EDBM_mesh_free(BMEditMesh *tm)
+/**
+ * Should only be called on the active editmesh, otherwise call #BMEdit_Free
+ */
+void EDBM_mesh_free(BMEditMesh *em)
 {
-       BMEdit_Free(tm);
+       /* These tables aren't used yet, so it's not strictly necessary
+        * to 'end' them (with 'e' param) but if someone tries to start
+        * using them, having these in place will save a lot of pain */
+       mesh_octree_table(NULL, NULL, NULL, 'e');
+       mesh_mirrtopo_table(NULL, 'e');
+
+       BMEdit_Free(em);
 }
 
 void EDBM_index_arrays_init(BMEditMesh *tm, int forvert, int foredge, int forface)
@@ -547,7 +556,7 @@ static void undoMesh_to_editbtMesh(void *umv, void *em_v, void *UNUSED(obdata))
 
        ob->shapenr = em->bm->shapenr;
 
-       BMEdit_Free(em);
+       EDBM_mesh_free(em);
 
        bm = BM_mesh_create(&bm_mesh_allocsize_default);
 
index 7e8c38c9abc67beb30c5e4c58a7eedfd5bfa3aee..4b4fef53275317feccc5bf3bd77b14630aa94e6c 100644 (file)
@@ -314,7 +314,8 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "MESH_OT_fill", FKEY, KM_PRESS, KM_ALT, 0);
        WM_keymap_add_item(keymap, "MESH_OT_beautify_fill", FKEY, KM_PRESS, KM_SHIFT | KM_ALT, 0);
 
-       WM_keymap_add_item(keymap, "MESH_OT_quads_convert_to_tris", TKEY, KM_PRESS, KM_CTRL, 0);
+       kmi = WM_keymap_add_item(keymap, "MESH_OT_quads_convert_to_tris", TKEY, KM_PRESS, KM_CTRL, 0);
+       RNA_boolean_set(kmi->ptr, "use_beauty", TRUE);
        kmi = WM_keymap_add_item(keymap, "MESH_OT_quads_convert_to_tris", TKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
        RNA_boolean_set(kmi->ptr, "use_beauty", FALSE);
 
index 09e7d1d9be5c314e41f8b54710b0d304062bdb35..fb383b1256b978753f7d50b311290c5169fe8969 100644 (file)
 #include "DNA_object_types.h"
 #include "DNA_modifier_types.h"
 
-/* #include "BLO_sys_types.h"  *//* needed for intptr_t used in ED_mesh.h */
-
-/* #include "ED_mesh.h" */
-
-
 #ifdef RNA_RUNTIME
 #include "BLI_math.h"
 
index e47ec23bef5baa9867a1790ce676b065b10b9797..20ceaec89749d0d18184a915670aacc36b9f26a5 100644 (file)
@@ -31,9 +31,6 @@
 #include <string.h>
 
 #include "RNA_define.h"
-
-#include "BLO_sys_types.h" /* needed for intptr_t used in ED_mesh.h */
-
 #include "RNA_access.h"
 #include "RNA_define.h"