svn merge ^/trunk/blender -r42655:42660
authorCampbell Barton <ideasman42@gmail.com>
Fri, 16 Dec 2011 04:16:52 +0000 (04:16 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 16 Dec 2011 04:16:52 +0000 (04:16 +0000)
source/blender/editors/mesh/meshtools.c
source/blender/editors/transform/transform_ops.c
source/blender/python/intern/bpy_app.c
source/blender/python/intern/bpy_app_handlers.c
source/blender/python/intern/bpy_driver.c

index 5e9762d16e70b239344966f2b11c2825ce2ce55d..1cfa369e5c12bd46dd086b02d08e16aca61bad7e 100644 (file)
@@ -926,7 +926,8 @@ static int MirrTopo_item_sort(const void *v1, const void *v2)
 }
 
 static long *mesh_topo_lookup = NULL;
-static int  mesh_topo_lookup_tot = -1;
+static int  mesh_topo_lookup_vert_tot = -1;
+static int  mesh_topo_lookup_edge_tot = -1;
 static int  mesh_topo_lookup_mode = -1;
 
 /* mode is 's' start, or 'e' end, or 'u' use */
@@ -937,8 +938,10 @@ long mesh_mirrtopo_table(Object *ob, char mode)
                Mesh *me= ob->data;
                if(     (mesh_topo_lookup==NULL) ||
                        (mesh_topo_lookup_mode != ob->mode) ||
-                       (me->edit_btmesh && me->edit_btmesh->bm->totvert != mesh_topo_lookup_tot) ||
-                       (me->edit_btmesh==NULL && me->totvert != mesh_topo_lookup_tot)
+                       (me->edit_btmesh && me->edit_btmesh->bm->totvert != mesh_topo_lookup_vert_tot) ||
+                       (me->edit_btmesh && me->edit_btmesh->bm->totedge != mesh_topo_lookup_edge_tot) ||
+                       (me->edit_btmesh==NULL && me->totvert != mesh_topo_lookup_vert_tot) ||
+                       (me->edit_btmesh==NULL && me->totedge != mesh_topo_lookup_edge_tot)
                ) {
                        mesh_mirrtopo_table(ob, 's');
                }
@@ -951,7 +954,8 @@ long mesh_mirrtopo_table(Object *ob, char mode)
                MIRRHASH_TYPE *MirrTopoHash = NULL;
                MIRRHASH_TYPE *MirrTopoHash_Prev = NULL;
                MirrTopoPair *MirrTopoPairs;
-               int a, last, totvert;
+               int a, last;
+               int totvert, totedge;
                int totUnique= -1, totUniqueOld= -1;
 
                mesh_topo_lookup_mode= ob->mode;
@@ -975,12 +979,15 @@ long mesh_mirrtopo_table(Object *ob, char mode)
 
                /* Initialize the vert-edge-user counts used to detect unique topology */
                if(em) {
+                       totedge= me->edit_btmesh->bm->totedge;
                        BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
                                MirrTopoHash[BM_GetIndex(eed->v1)]++;
                                MirrTopoHash[BM_GetIndex(eed->v2)]++;
                        }
                } else {
-                       for(a=0, medge=me->medge; a<me->totedge; a++, medge++) {
+                       totedge= me->totedge;
+
+                       for(a=0, medge=me->medge; a < me->totedge; a++, medge++) {
                                MirrTopoHash[medge->v1]++;
                                MirrTopoHash[medge->v2]++;
                        }
@@ -1078,14 +1085,16 @@ long mesh_mirrtopo_table(Object *ob, char mode)
                MEM_freeN( MirrTopoHash );
                MEM_freeN( MirrTopoHash_Prev );
 
-               mesh_topo_lookup_tot = totvert;
+               mesh_topo_lookup_vert_tot = totvert;
+               mesh_topo_lookup_edge_tot = totedge;
 
        } else if(mode=='e') { /* end table */
                if (mesh_topo_lookup) {
                        MEM_freeN(mesh_topo_lookup);
                }
                mesh_topo_lookup = NULL;
-               mesh_topo_lookup_tot= -1;
+               mesh_topo_lookup_vert_tot= -1;
+               mesh_topo_lookup_edge_tot= -1;
        }
        return 0;
 }
index 7951fe0ee029baaeb946a08a1e87a0640188c186..90f95bea6966a6a3626e10bfced5b4f29aba9ab8 100644 (file)
@@ -632,7 +632,7 @@ void TRANSFORM_OT_warp(struct wmOperatorType *ot)
        ot->cancel  = transform_cancel;
        ot->poll   = ED_operator_screenactive;
 
-       RNA_def_float_rotation(ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Angle", "", 0, 1);
+       RNA_def_float_rotation(ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI*2, M_PI*2);
 
        Transform_Properties(ot, P_PROPORTIONAL|P_MIRROR|P_SNAP);
        // XXX Warp axis?
index 1f99503202a33fd14612033e4df14f6d3edf1e5f..a10be098a614585591628f26e8c10ae66a80ffed 100644 (file)
@@ -260,6 +260,7 @@ PyObject *BPY_app_struct(void)
        /* prevent user from creating new instances */
        BlenderAppType.tp_init= NULL;
        BlenderAppType.tp_new= NULL;
+       BlenderAppType.tp_hash= (hashfunc)_Py_HashPointer; /* without this we can't do set(sys.modules) [#29635] */
 
        /* kindof a hack ontop of PyStructSequence */
        py_struct_seq_getset_init();
index edab92b295beea7d1304af215a687c7f77c7e4c6..dd512791e850b07a0cb6cd1f045f870521b12848 100644 (file)
@@ -210,6 +210,7 @@ PyObject *BPY_app_handlers_struct(void)
        /* prevent user from creating new instances */
        BlenderAppCbType.tp_init= NULL;
        BlenderAppCbType.tp_new= NULL;
+       BlenderAppCbType.tp_hash= (hashfunc)_Py_HashPointer; /* without this we can't do set(sys.modules) [#29635] */
 
        /* assign the C callbacks */
        if (ret) {
index db408374b7fc10221699fb890e9a3630953ee328..e628cb891d8a0d70cff4609738fec99afda89573 100644 (file)
@@ -94,13 +94,12 @@ int bpy_pydriver_create_dict(void)
 
 /* note, this function should do nothing most runs, only when changing frame */
 static PyObject *bpy_pydriver_InternStr__frame= NULL;
+/* not thread safe but neither is python */
+static float bpy_pydriver_evaltime_prev= FLT_MAX;
 
 static void bpy_pydriver_update_dict(const float evaltime)
 {
-       /* not thread safe but neither is python */
-       static float evaltime_prev= FLT_MAX;
-
-       if (evaltime_prev != evaltime) {
+       if (bpy_pydriver_evaltime_prev != evaltime) {
 
                /* currently only update the frame */
                if (bpy_pydriver_InternStr__frame == NULL) {
@@ -111,7 +110,7 @@ static void bpy_pydriver_update_dict(const float evaltime)
                               bpy_pydriver_InternStr__frame,
                               PyFloat_FromDouble(evaltime));
 
-               evaltime_prev= evaltime;
+               bpy_pydriver_evaltime_prev= evaltime;
        }
 }
 
@@ -137,6 +136,7 @@ void BPY_driver_reset(void)
        if (bpy_pydriver_InternStr__frame) {
                Py_DECREF(bpy_pydriver_InternStr__frame);
                bpy_pydriver_InternStr__frame= NULL;
+               bpy_pydriver_evaltime_prev= FLT_MAX;
        }
 
        if (use_gil)