2.5
authorTon Roosendaal <ton@blender.org>
Thu, 19 Feb 2009 16:22:07 +0000 (16:22 +0000)
committerTon Roosendaal <ton@blender.org>
Thu, 19 Feb 2009 16:22:07 +0000 (16:22 +0000)
Assorted smaller fixes:

- Fix: modal keymaps for editmode in view3d were not set again
  when you copy areas or go fullscreen.

- Improved "redo last op" (F6) to search back in history for
  a redoable operator. Operator also used wrong pupmenu type.

- On creating new FCurve editor, the channel rainbow colors are
  set correct.

- EditMesh: fixed code for Spin/Screw, correct props, init and
  error reporting. (Spin hotkey ALT+R temporary)

- recompiled all to check for uninitialized variable warnings.
  (compile flag should be -O for this). Fixed some proto's.

26 files changed:
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/multires.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/animation/keyframing.c
source/blender/editors/armature/editarmature.c
source/blender/editors/interface/interface_utils.c
source/blender/editors/mesh/editdeform.c
source/blender/editors/mesh/editface.c
source/blender/editors/mesh/editmesh_loop.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/object/object_edit.c
source/blender/editors/screen/area.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/vpaint.c
source/blender/editors/util/editmode_undo.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/makesdna/DNA_view3d_types.h
source/blender/render/intern/source/convertblender.c
source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h
source/gameengine/Converter/KX_ConvertSensors.cpp
source/nan_compile.mk

index 69fb50bcf2b4b6954e1d029535b0b69f9afb8d7a..1b930a74449b7e0353507643de2a48e7b81c87d3 100644 (file)
@@ -1579,7 +1579,7 @@ static void initialize_posetree(struct Object *ob, bPoseChannel *pchan_tip)
        PoseTree *tree;
        PoseTarget *target;
        bConstraint *con;
-       bKinematicConstraint *data;
+       bKinematicConstraint *data= NULL;
        int a, segcount= 0, size, newsize, *oldparent, parent;
        
        /* find IK constraint, and validate it */
index 08a2b1dcecb482979eb344de41fea674736417fd..ab453fb6f44eeb9eb454f446e23c2cd36ff375f9 100644 (file)
@@ -1056,7 +1056,7 @@ static struct ImBuf *brush_gen_radial_control_imbuf(Brush *br)
 void brush_radial_control_invoke(wmOperator *op, Brush *br)
 {
        int mode = RNA_int_get(op->ptr, "mode");
-       float original_value;
+       float original_value= 0;
 
        if(mode == WM_RADIALCONTROL_SIZE)
                original_value = br->size;
index 685bef4fdc129622af72d48e7b67fd61c7035077..360e1905ce81e30d237cba25a7b9a85df464da32 100644 (file)
@@ -1051,7 +1051,7 @@ static void stampdata(Scene *scene, StampData *stamp_data, int do_prefix)
        }
        
        if (scene->r.stamp & R_STAMP_SEQSTRIP) {
-               Sequence *seq; //XXX = get_forground_frame_seq(scene->r.cfra);
+               Sequence *seq= NULL; //XXX = get_forground_frame_seq(scene->r.cfra);
        
                if (seq) strcpy(text, seq->name+2);
                else            strcpy(text, "<none>");
@@ -1800,7 +1800,7 @@ static ImBuf *image_get_ibuf_multilayer(Image *ima, ImageUser *iuser)
 /* always returns a single ibuf, also during render progress */
 static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser)
 {
-       Render *re;
+       Render *re= NULL;
        RenderResult *rr= NULL;
        
        if(iuser->scene) {
index ddbb1c81e12e17a242995191dfc567671ba719b7..dfd83a7b42ef4e88f4b6670046d6076d1190d0a3 100644 (file)
@@ -236,7 +236,7 @@ static void multires_subdisp(DerivedMesh *orig, Mesh *me, DerivedMesh *final, in
 
        for(i = 0; i < me->totface; ++i) {
                const int end = me->mface[i].v4 ? 4 : 3;
-               int x, y, x2, y2, mov;
+               int x, y, x2, y2, mov= 0;
 
                mvd_f1 += 1 + end * (slo2-2); //center+edgecross
                mvd_f3 = mvd_f4 = mvd_f1;
@@ -268,7 +268,7 @@ static void multires_subdisp(DerivedMesh *orig, Mesh *me, DerivedMesh *final, in
 
                                        /* Main face verts */
                                        for(k = 0; k < 4; ++k) {
-                                               int movx, movy;
+                                               int movx= 0, movy= 0;
 
                                                if(k == 0) { movx = -1; movy = -(slo2 - 2); }
                                                else if(k == 1) { movx = slo2 - 2; movy = -1; }
index f3a1e392953142aeaaefefb111dde29e5796a042..47bf64a5743834f974572411dff259104cb874da 100644 (file)
@@ -4462,6 +4462,7 @@ static void direct_link_region(FileData *fd, ARegion *ar, int spacetype)
                        rv3d->ri= NULL;
                        rv3d->sms= NULL;
                        rv3d->smooth_timer= NULL;
+                       rv3d->lastmode= 0;
                }
        }
        
index 6a2c8303edf5ad660c07ea502617d93a0b1ee2f0..d28bae9b12eaab18ff9cea9c2a4c2b540f5e2080 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "BKE_animsys.h"
 #include "BKE_action.h"
+#include "BKE_constraint.h"
 #include "BKE_fcurve.h"
 #include "BKE_utildefines.h"
 #include "BKE_context.h"
index 1778ca8fa453e2d22414df4966e4c1c9cf3b2911..403e57500303e4904a750e9d6da1135cf0a6f31e 100644 (file)
@@ -1299,7 +1299,7 @@ static void selectconnected_posebonechildren (Object *ob, Bone *bone)
 /* previously known as "selectconnected_posearmature" */
 static int pose_select_connected_invoke(bContext *C, wmOperator *op, wmEvent *event)
 {  
-       Bone *bone, *curBone, *next;
+       Bone *bone, *curBone, *next= NULL;
        int shift= 0; // XXX in pose mode, Shift+L is bound to another command
                                  // named "PoseLib Add Current Pose"
        int x, y;
@@ -3045,7 +3045,6 @@ static int armature_bone_primitive_add_exec(bContext *C, wmOperator *op)
 {
        RegionView3D *rv3d= CTX_wm_region_view3d(C);
        Object *obedit = CTX_data_edit_object(C);
-       bArmature *arm= (bArmature *)obedit->data;
        EditBone *bone;
        float obmat[3][3], curs[3], viewmat[3][3], totmat[3][3], imat[3][3];
        char name[32];
index d8f83eca7f07d628477d3c524149654e80ef0f6d..6633e34c06a92c17296a44c3e7118802576cb07e 100644 (file)
@@ -309,7 +309,7 @@ int uiDefAutoButsRNA(uiBlock *block, PointerRNA *ptr)
        PropertyRNA *iterprop, *prop;
        PropertySubType subtype;
        char *name, namebuf[128];
-       int a, length, x= 0, y= 0;
+       int a= 0, length, x= 0, y= 0;
 
        x= 0;
        y= 0;
index 65b0425f3f1200808771adeba29b5338e63726cc..836684007084133b160ead3cc9fcb1980deac601 100644 (file)
@@ -990,7 +990,7 @@ void vgroup_assign_with_menu(Scene *scene, Object *ob)
 {
        VPaint *wp= scene->toolsettings->wpaint;
        int defCount;
-       int mode;
+       int mode= 0;
        
        /* prevent crashes */
        if (wp==NULL || ob==NULL) return;
@@ -1032,7 +1032,7 @@ void vgroup_assign_with_menu(Scene *scene, Object *ob)
 void vgroup_operation_with_menu(Object *ob)
 {
        int defCount;
-       int mode;
+       int mode= 0;
        
        /* prevent crashes and useless cases */
        if (ob==NULL) return;
index 6c17dff34280bcbc7b5c4f9bc7ebc337ae4b0b40..ab6ec464a9bb0cf66cd62bf5d1e4d9491108656a 100644 (file)
@@ -676,7 +676,7 @@ void face_borderselect(Scene *scene, ARegion *ar)
        rcti rect;
        struct ImBuf *ibuf;
        unsigned int *rt;
-       int a, sx, sy, index, val;
+       int a, sx, sy, index, val= 0;
        char *selar;
        
        me= get_mesh(OBACT);
index 2860c915ee439bd30c2ee13b5dc9b4cb2807de89..af85a041b1b4679f15db7ea60458c1882fdd4b61 100644 (file)
@@ -206,7 +206,7 @@ void CutEdgeloop(Object *obedit, wmOperator *op, EditMesh *em, int numcuts)
        float fac;
        int keys = 0, holdnum=0, selectmode, dist;
        short mvalo[2] = {0,0}, mval[2];
-       short event, val, choosing=1, cancel=0, cuthalf = 0, smooth=0;
+       short event=0, val, choosing=1, cancel=0, cuthalf = 0, smooth=0;
        short hasHidden = 0;
        char msg[128];
        
index b329014d543e77b5acf378497bc2b3549beda243..4c886c4b58f03954129aa1e7a935d352b0af182c 100644 (file)
@@ -818,21 +818,22 @@ void MESH_OT_extrude_repeat(wmOperatorType *ot)
        RNA_def_float(ot->srna, "offset", 2.0f, 0.0f, 100.0f, "Offset", "", 0.0f, FLT_MAX);
        RNA_def_int(ot->srna, "steps", 10, 0, 180, "Steps", "", 0, INT_MAX);
 }
+
+/* ************************** spin operator ******************** */
        
-void spin_mesh(bContext *C, wmOperator *op,float *dvec,int steps, float degr,int mode )
+static int spin_mesh(bContext *C, float *dvec, int steps, float degr, int dupli )
 {
        Object *obedit= CTX_data_edit_object(C);
        View3D *v3d = CTX_wm_view3d(C);
        Scene *scene = CTX_data_scene(C);
        EditMesh *em= ((Mesh *)obedit->data)->edit_mesh;
-       
        RegionView3D *rv3d= CTX_wm_region_view3d(C);
        EditVert *eve,*nextve;
-       float nor[3]= {0.0, 0.0, 0.0};
-       float *curs, si,n[3],q[4],cmat[3][3],imat[3][3], tmat[3][3];
-       float cent[3],bmat[3][3];
+       float nor[3]= {0.0f, 0.0f, 0.0f};
+       float *curs, si, n[3], q[4], cmat[3][3], imat[3][3], tmat[3][3];
+       float cent[3], bmat[3][3];
        float phi;
-       short a,ok;
+       short a, ok= 1;
 
        /* imat and center and size */
        Mat3CpyMat4(bmat, obedit->obmat);
@@ -870,16 +871,17 @@ void spin_mesh(bContext *C, wmOperator *op,float *dvec,int steps, float degr,int
        Mat3MulMat3(tmat,cmat,bmat);
        Mat3MulMat3(bmat,imat,tmat);
 
-       if(mode==0) if(scene->toolsettings->editbutflag & B_KEEPORIG) adduplicateflag(em, 1);
-       ok= 1;
+       if(dupli==0) 
+               if(scene->toolsettings->editbutflag & B_KEEPORIG) 
+                       adduplicateflag(em, 1);
 
-       for(a=0;a<steps;a++) {
-               if(mode==0) ok= extrudeflag(obedit, em, SELECT, nor);
+       for(a=0; a<steps; a++) {
+               if(dupli==0) ok= extrudeflag(obedit, em, SELECT, nor);
                else adduplicateflag(em, SELECT);
-               if(ok==0) {
-                       BKE_report(op->reports, RPT_ERROR, "No valid vertices are selected");
+               
+               if(ok==0)
                        break;
-               }
+
                rotateflag(em, SELECT, cent, bmat);
                if(dvec) {
                        Mat3MulVecfl(bmat,dvec);
@@ -899,22 +901,29 @@ void spin_mesh(bContext *C, wmOperator *op,float *dvec,int steps, float degr,int
                        eve= nextve;
                }
        }
-       recalc_editnormals(em);
-
-       EM_fgon_flags(em);
+       else {
+               recalc_editnormals(em);
 
-       //      DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
+               EM_fgon_flags(em);
 
+               DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
+       }
+       
+       return ok;
 }
 
 static int spin_mesh_exec(bContext *C, wmOperator *op)
 {
        Object *obedit= CTX_data_edit_object(C);
-       
-       spin_mesh(C, op,NULL,RNA_int_get(op->ptr,"steps"),RNA_float_get(op->ptr,"degrees"),RNA_int_get(op->ptr,"steps"));
+       int ok;
        
        WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
+       ok= spin_mesh(C, NULL, RNA_int_get(op->ptr,"steps"), RNA_float_get(op->ptr,"degrees"), RNA_boolean_get(op->ptr,"dupli"));
+       if(ok==0) {
+               BKE_report(op->reports, RPT_ERROR, "No valid vertices are selected");
+               return OPERATOR_CANCELLED;
+       }
        return OPERATOR_FINISHED;
 }
 
@@ -932,29 +941,29 @@ void MESH_OT_spin(wmOperatorType *ot)
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /*props */
-       RNA_def_int(ot->srna, "steps", 5, 0, INT_MAX, "Steps", "Steps", 0, INT_MAX);
-       RNA_def_int(ot->srna, "mode", 1, 0, INT_MAX, "Mode", "Mode", 0, INT_MAX);
-       RNA_def_float(ot->srna, "degrees", 5.0f, 0.0f, FLT_MAX, "Degrees", "Degrees", 0.0f, FLT_MAX);
+       RNA_def_int(ot->srna, "steps", 9, 0, INT_MAX, "Steps", "Steps", 0, INT_MAX);
+       RNA_def_boolean(ot->srna, "dupli", 0, "Dupli", "Make Duplicates");
+       RNA_def_float(ot->srna, "degrees", 90.0f, -FLT_MAX, FLT_MAX, "Degrees", "Degrees", -360.0f, 360.0f);
 }
 
-void screw_mesh(bContext *C, wmOperator *op, int steps, int turns)
+static int screw_mesh_exec(bContext *C, wmOperator *op)
 {
        Object *obedit= CTX_data_edit_object(C);
        EditMesh *em= ((Mesh *)obedit->data)->edit_mesh;
-       
        EditVert *eve,*v1=0,*v2=0;
        EditEdge *eed;
        float dvec[3], nor[3];
+       int steps, turns;
 
+       turns= RNA_int_get(op->ptr, "turns");
+       steps= RNA_int_get(op->ptr, "steps");
+       
        /* clear flags */
-       eve= em->verts.first;
-       while(eve) {
+       for(eve= em->verts.first; eve; eve= eve->next)
                eve->f1= 0;
-               eve= eve->next;
-       }
+
        /* edges set flags in verts */
-       eed= em->edges.first;
-       while(eed) {
+       for(eed= em->edges.first; eed; eed= eed->next) {
                if(eed->v1->f & SELECT) {
                        if(eed->v2->f & SELECT) {
                                /* watch: f1 is a byte */
@@ -962,30 +971,27 @@ void screw_mesh(bContext *C, wmOperator *op, int steps, int turns)
                                if(eed->v2->f1<2) eed->v2->f1++;
                        }
                }
-               eed= eed->next;
        }
        /* find two vertices with eve->f1==1, more or less is wrong */
-       eve= em->verts.first;
-       while(eve) {
+       for(eve= em->verts.first; eve; eve= eve->next) {
                if(eve->f1==1) {
-                       if(v1==0) v1= eve;
-                       else if(v2==0) v2= eve;
+                       if(v1==NULL) v1= eve;
+                       else if(v2==NULL) v2= eve;
                        else {
-                               v1=0;
+                               v1= NULL;
                                break;
                        }
                }
-               eve= eve->next;
        }
-       if(v1==0 || v2==0) {
+       if(v1==NULL || v2==NULL) {
                BKE_report(op->reports, RPT_ERROR, "You have to select a string of connected vertices too");
-               return;
+               return OPERATOR_CANCELLED;
        }
 
        /* calculate dvec */
-       dvec[0]= ( (v1->co[0]- v2->co[0]) )/(steps);
-       dvec[1]= ( (v1->co[1]- v2->co[1]) )/(steps);
-       dvec[2]= ( (v1->co[2]- v2->co[2]) )/(steps);
+       dvec[0]= ( v1->co[0]- v2->co[0] )/steps;
+       dvec[1]= ( v1->co[1]- v2->co[1] )/steps;
+       dvec[2]= ( v1->co[2]- v2->co[2] )/steps;
 
        VECCOPY(nor, obedit->obmat[2]);
 
@@ -995,19 +1001,15 @@ void screw_mesh(bContext *C, wmOperator *op, int steps, int turns)
                dvec[2]= -dvec[2];
        }
        
-       spin_mesh(C, op,  dvec, turns*steps, turns*360,0);
-
-}
-
-static int screw_mesh_exec(bContext *C, wmOperator *op)
-{
-       Object *obedit= CTX_data_edit_object(C);
-       
-       screw_mesh(C, op,RNA_int_get(op->ptr,"steps"),RNA_int_get(op->ptr,"turns"));
-       
-       WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
-       
-       return OPERATOR_FINISHED;
+       if(spin_mesh(C, dvec, turns*steps, 360.0f*turns, 0)) {
+               WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
+               
+               return OPERATOR_FINISHED;
+       }
+       else {
+               BKE_report(op->reports, RPT_ERROR, "No valid vertices are selected");
+               return OPERATOR_CANCELLED;
+       }
 }
 
 void MESH_OT_screw(wmOperatorType *ot)
@@ -1024,8 +1026,8 @@ void MESH_OT_screw(wmOperatorType *ot)
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
        
        /*props */
-       RNA_def_int(ot->srna, "steps", 5, 0, INT_MAX, "Steps", "Steps", 0, INT_MAX);
-       RNA_def_int(ot->srna, "turns", 1, 0, INT_MAX, "Turns", "Turns", 0, INT_MAX);
+       RNA_def_int(ot->srna, "steps", 9, 0, INT_MAX, "Steps", "Steps", 0, 256);
+       RNA_def_int(ot->srna, "turns", 1, 0, INT_MAX, "Turns", "Turns", 0, 256);
 }
 
 static void erase_edges(EditMesh *em, ListBase *l)
index e0acb719cf65512f7ac52742f5ac3ca828ae5c56..a8e499c25478689a7291e08a5cc798090b24ebcb 100644 (file)
@@ -3500,7 +3500,7 @@ void special_editmenu(Scene *scene, View3D *v3d)
        Object *ob= OBACT;
        Object *obedit= NULL; // XXX
        float fac;
-       int nr,ret;
+       int nr,ret=0;
        short randfac;
        
        if(ob==NULL) return;
index 68a67823c606f4289d7d19e37e407269a553631f..691dc26c9379b4ca9f6260fc24962d8b385fe30a 100644 (file)
@@ -737,6 +737,7 @@ void ED_area_newspace(bContext *C, ScrArea *sa, int type)
                WM_event_add_mousemove(C);
                
                ED_area_tag_redraw(sa);
+               ED_area_tag_refresh(sa);
        }
 }
 
index 1d32a6984cfb83d5d87e47c136ab29d2c50fbccf..e67e2d6e7a646d3f4a0d565a3c6a52def6decb12 100644 (file)
@@ -1047,7 +1047,7 @@ void SCREEN_OT_frame_offset(wmOperatorType *ot)
        ot->exec= frame_offset_exec;
 
        ot->poll= ED_operator_screenactive;
-       ot->flag= OPTYPE_REGISTER;
+       ot->flag= 0;
 
        /* rna */
        RNA_def_int(ot->srna, "delta", 0, INT_MIN, INT_MAX, "Delta", "", INT_MIN, INT_MAX);
@@ -1125,7 +1125,7 @@ void SCREEN_OT_screen_full_area(wmOperatorType *ot)
        
        ot->exec= screen_full_area_exec;
        ot->poll= ED_operator_areaactive;
-       ot->flag= OPTYPE_REGISTER;
+       ot->flag= 0;
 
 }
 
@@ -1485,24 +1485,9 @@ void SCREEN_OT_repeat_history(wmOperatorType *ot)
 
 /* ********************** redo operator ***************************** */
 
-static int redo_last_exec(bContext *C, wmOperator *op)
+static void redo_last_cb(bContext *C, void *arg_op, void *arg2)
 {
-#if 0
-       /* XXX context is not correct after popup menu */
-       wmOperator *lastop= CTX_wm_manager(C)->operators.last;
-       
-       if(lastop) {
-               ED_undo_pop(C);
-               WM_operator_repeat(C, lastop);
-       }
-#endif
-       
-       return OPERATOR_CANCELLED;
-}
-
-static void redo_last_cb(bContext *C, void *arg1, void *arg2)
-{
-       wmOperator *lastop= CTX_wm_manager(C)->operators.last;
+       wmOperator *lastop= arg_op;
        
        if(lastop) {
                ED_undo_pop(C);
@@ -1521,7 +1506,7 @@ static uiBlock *ui_block_create_redo_last(bContext *C, ARegion *ar, void *arg_op
        
        block= uiBeginBlock(C, ar, "redo_last_popup", UI_EMBOSS, UI_HELV);
        uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN|UI_BLOCK_RET_1);
-       uiBlockSetFunc(block, redo_last_cb, NULL, NULL);
+       uiBlockSetFunc(block, redo_last_cb, arg_op, NULL);
 
        if(!op->properties) {
                IDPropertyTemplate val = {0};
@@ -1540,16 +1525,17 @@ static uiBlock *ui_block_create_redo_last(bContext *C, ARegion *ar, void *arg_op
 static int redo_last_invoke(bContext *C, wmOperator *op, wmEvent *event)
 {
        wmWindowManager *wm= CTX_wm_manager(C);
-       wmOperator *lastop= wm->operators.last;
-
-       if(!lastop)
-               return OPERATOR_CANCELLED;
+       wmOperator *lastop;
 
        /* only for operators that are registered and did an undo push */
-       if(!(lastop->type->flag & OPTYPE_REGISTER) || !(lastop->type->flag & OPTYPE_UNDO))
+       for(lastop= wm->operators.last; lastop; lastop= lastop->prev)
+               if((lastop->type->flag & OPTYPE_REGISTER) && (lastop->type->flag & OPTYPE_UNDO))
+                       break;
+       
+       if(!lastop)
                return OPERATOR_CANCELLED;
 
-       uiPupBlockO(C, ui_block_create_redo_last, lastop, op->type->idname, WM_OP_EXEC_DEFAULT);
+       uiPupBlock(C, ui_block_create_redo_last, lastop);
 
        return OPERATOR_CANCELLED;
 }
@@ -1562,7 +1548,6 @@ void SCREEN_OT_redo_last(wmOperatorType *ot)
        
        /* api callbacks */
        ot->invoke= redo_last_invoke;
-       ot->exec= redo_last_exec;
        
        ot->poll= ED_operator_screenactive;
 }
index bc9d2c10e21d312d09a1a0603152c5c1f39c1b38..85812438a2e49ca3eceb351b7c27432d74cbf126 100644 (file)
@@ -1399,7 +1399,7 @@ void node_active_link_viewer(SpaceNode *snode)
 /*static*/ int node_mouse_groupheader(SpaceNode *snode)
 {
        bNode *gnode;
-       float mx, my;
+       float mx=0, my=0;
 // XXX short mval[2];
        
        gnode= snode_get_editgroup(snode);
index 837f4a8475b70cf21aaa68d1c70b4883fb53927d..36ab867f2ae5cd76d06419fcaf0bc0c408e2f803 100644 (file)
@@ -209,9 +209,51 @@ static SpaceLink *view3d_duplicate(SpaceLink *sl)
        return (SpaceLink *)v3dn;
 }
 
+static void view3d_modal_keymaps(wmWindowManager *wm, ARegion *ar, int stype)
+{
+       RegionView3D *rv3d= ar->regiondata;
+       ListBase *keymap;
+       
+       /* copy last mode, then we can re-init the region maps */
+       rv3d->lastmode= stype;
+       
+       keymap= WM_keymap_listbase(wm, "Object Mode", 0, 0);
+       if(ELEM(stype, 0, NS_MODE_OBJECT))
+               WM_event_add_keymap_handler(&ar->handlers, keymap);
+       else
+               WM_event_remove_keymap_handler(&ar->handlers, keymap);
+       
+       keymap= WM_keymap_listbase(wm, "EditMesh", 0, 0);
+       if(stype==NS_EDITMODE_MESH)
+               WM_event_add_keymap_handler(&ar->handlers, keymap);
+       else
+               WM_event_remove_keymap_handler(&ar->handlers, keymap);
+       
+       keymap= WM_keymap_listbase(wm, "Curve", 0, 0);
+       if(stype==NS_EDITMODE_CURVE)
+               WM_event_add_keymap_handler(&ar->handlers, keymap);
+       else
+               WM_event_remove_keymap_handler(&ar->handlers, keymap);
+       
+       keymap= WM_keymap_listbase(wm, "Armature", 0, 0);
+       if(stype==NS_EDITMODE_ARMATURE)
+               WM_event_add_keymap_handler(&ar->handlers, keymap);
+       else
+               WM_event_remove_keymap_handler(&ar->handlers, keymap);
+       
+       /* editfont keymap swallows all... */
+       keymap= WM_keymap_listbase(wm, "Font", 0, 0);
+       if(stype==NS_EDITMODE_TEXT)
+               WM_event_add_keymap_handler_priority(&ar->handlers, keymap, 10);
+       else
+               WM_event_remove_keymap_handler(&ar->handlers, keymap);
+       
+}
+
 /* add handlers, stuff you only do once or on area/region changes */
 static void view3d_main_area_init(wmWindowManager *wm, ARegion *ar)
 {
+       RegionView3D *rv3d= ar->regiondata;
        ListBase *keymap;
        
        /* own keymap */
@@ -228,10 +270,8 @@ static void view3d_main_area_init(wmWindowManager *wm, ARegion *ar)
        keymap= WM_keymap_listbase(wm, "Pose", 0, 0);
        WM_event_add_keymap_handler(&ar->handlers, keymap);
        
-       /* object modal ops default */
-       keymap= WM_keymap_listbase(wm, "Object Mode", 0, 0);
-       WM_event_add_keymap_handler(&ar->handlers, keymap);
-       
+       /* modal ops keymaps */
+       view3d_modal_keymaps(wm, ar, rv3d->lastmode);
 }
 
 /* type callback, not region itself */
@@ -281,44 +321,6 @@ static void *view3d_main_area_duplicate(void *poin)
        return NULL;
 }
 
-
-static void view3d_modal_keymaps(wmWindowManager *wm, ARegion *ar, int stype)
-{
-       ListBase *keymap;
-       
-       keymap= WM_keymap_listbase(wm, "Object Mode", 0, 0);
-       if(stype==NS_MODE_OBJECT)
-               WM_event_add_keymap_handler(&ar->handlers, keymap);
-       else
-               WM_event_remove_keymap_handler(&ar->handlers, keymap);
-       
-       keymap= WM_keymap_listbase(wm, "EditMesh", 0, 0);
-       if(stype==NS_EDITMODE_MESH)
-               WM_event_add_keymap_handler(&ar->handlers, keymap);
-       else
-               WM_event_remove_keymap_handler(&ar->handlers, keymap);
-
-       keymap= WM_keymap_listbase(wm, "Curve", 0, 0);
-       if(stype==NS_EDITMODE_CURVE)
-               WM_event_add_keymap_handler(&ar->handlers, keymap);
-       else
-               WM_event_remove_keymap_handler(&ar->handlers, keymap);
-       
-       keymap= WM_keymap_listbase(wm, "Armature", 0, 0);
-       if(stype==NS_EDITMODE_ARMATURE)
-               WM_event_add_keymap_handler(&ar->handlers, keymap);
-       else
-               WM_event_remove_keymap_handler(&ar->handlers, keymap);
-       
-       /* editfont keymap swallows all... */
-       keymap= WM_keymap_listbase(wm, "Font", 0, 0);
-       if(stype==NS_EDITMODE_TEXT)
-               WM_event_add_keymap_handler_priority(&ar->handlers, keymap, 10);
-       else
-               WM_event_remove_keymap_handler(&ar->handlers, keymap);
-       
-}
-
 static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
 {
        /* context changes */
index 6313fe73cd154935d6a15b610fa655fbf62fa208..4c2cd184b84636ed25efebbd16336ac2f7beac31 100644 (file)
@@ -92,7 +92,7 @@ static void view3d_boxview_clip(ScrArea *sa)
        ARegion *ar;
        BoundBox *bb = MEM_callocN(sizeof(BoundBox), "clipbb");
        float clip[6][4];
-       float x1, y1, z1, ofs[3];
+       float x1= 0.0f, y1= 0.0f, z1= 0.0f, ofs[3];
        int val;
        
        /* create bounding box */
index 5d5efbeb0915afd511a0f854872dd58c2adcda27..c0c3752d03a11226f302e1583334b0376de61101 100644 (file)
@@ -1225,7 +1225,7 @@ void VIEW3D_OT_wpaint_toggle(wmOperatorType *ot)
 void paint_radial_control_invoke(wmOperator *op, VPaint *vp)
 {
        int mode = RNA_int_get(op->ptr, "mode");
-       float original_value;
+       float original_value= 1.0f;
 
        if(mode == WM_RADIALCONTROL_SIZE)
                original_value = vp->size;
index b593c99e5f4cfb5443f2edd63098f10ce919d96d..d813069a4a8c86378b442ca9ba11c06cc43da318 100644 (file)
@@ -303,7 +303,7 @@ void undo_editmode_menu(bContext *C)
 {
        UndoElem *uel;
        DynStr *ds= BLI_dynstr_new();
-       short event;
+       short event= 0;
        char *menu;
 
        undo_clean_stack(C);    // removes other objects from it
index 6697cc83845c423a082def13ee717ebefa6abdf7..ec7c5450cd0a9ad9925e8ceefad0d94f48b1eb1f 100644 (file)
@@ -88,7 +88,7 @@ void ED_uvedit_assign_image(Scene *scene, Object *obedit, Image *ima, Image *pre
        EditMesh *em;
        EditFace *efa;
        MTFace *tf;
-       int update;
+       int update= 0;
        
        /* skip assigning these procedural images... */
        if(ima && (ima->type==IMA_TYPE_R_RESULT || ima->type==IMA_TYPE_COMPOSITE))
index fe70f451eaf992b891d8d28c1c5f4f7feb014599..3b56fd964933e3a91600e422775af9c6b5c63462 100644 (file)
@@ -85,7 +85,8 @@ typedef struct RegionView3D {
        float pixsize;
        float ofs[3];
        short camzoom, viewbut;
-       int pad1;
+       
+       int lastmode;                                   /* for modal keymap switching, int because it stores notifier code */
        
        short rflag, viewlock;
        short persp;
index 62954711344aa54dee280f302127ec9247d463f5..a77570ec1a5fdc92acb6c45bcdf84f6f478721af 100644 (file)
@@ -952,7 +952,7 @@ static void static_particle_strand(Render *re, ObjectRen *obr, Material *ma, flo
                                                                   int first, int line, int adapt, float adapt_angle, float adapt_pix, int override_uv)
 {
        static VertRen *v1= NULL, *v2= NULL;
-       VlakRen *vlr;
+       VlakRen *vlr= NULL;
        float nor[3], cross[3], crosslen, w, dx, dy, width;
        static float anor[3], avec[3];
        int flag, i;
index ba3095d4f38bc3e418e9b8b18cb72eb135177287..7da4b9efb6892ac96481fe80a9bca4c61433aa53 100644 (file)
@@ -38,6 +38,8 @@
 #include "wm_event_types.h"
 #include "SCA_IInputDevice.h"
 
+
+
 /**
  Base Class for Blender specific inputdevices. Blender specific inputdevices are used when the gameengine is running in embedded mode instead of standalone mode.
 */
@@ -65,8 +67,9 @@ public:
                        m_reverseKeyTranslateTable[TIMER1                           ] = KX_TIMER1                  ;                  
                        m_reverseKeyTranslateTable[TIMER2                           ] = KX_TIMER2                  ;                  
                                                                                                                    
-                       // SYSTEM                                                                                                  
-                                                                                                                   
+                       // SYSTEM 
+#if 0                  
+                       /* **** XXX **** */
                        m_reverseKeyTranslateTable[KEYBD                            ] = KX_KEYBD                   ;                  
                        m_reverseKeyTranslateTable[RAWKEYBD                         ] = KX_RAWKEYBD                ;                  
                        m_reverseKeyTranslateTable[REDRAW                           ] = KX_REDRAW                  ;                  
@@ -77,7 +80,8 @@ public:
                        m_reverseKeyTranslateTable[WINCLOSE                         ] = KX_WINCLOSE                ;                  
                        m_reverseKeyTranslateTable[WINQUIT                          ] = KX_WINQUIT                 ;                  
                        m_reverseKeyTranslateTable[Q_FIRSTTIME                      ] = KX_Q_FIRSTTIME             ;                  
-                                                                                                                   
+                       /* **** XXX **** */
+#endif                                                                                                                   
                        // standard keyboard                                                                                       
                                                                                                                    
                        m_reverseKeyTranslateTable[AKEY                             ] = KX_AKEY                    ;                  
index ae2842076a6a5b15a00d3a721359d35903db163e..b7b47b3b39f03be290a3a375afcf07c081624260 100644 (file)
@@ -123,6 +123,8 @@ void BL_ConvertSensors(struct Object* blenderobject,
        
        // SYSTEM                                                                                                  
        
+#if 0                  
+       /* **** XXX **** */
        gReverseKeyTranslateTable[KEYBD                         ] = SCA_IInputDevice::KX_KEYBD;                  
        gReverseKeyTranslateTable[RAWKEYBD                      ] = SCA_IInputDevice::KX_RAWKEYBD;                  
        gReverseKeyTranslateTable[REDRAW                        ] = SCA_IInputDevice::KX_REDRAW;                  
@@ -133,7 +135,8 @@ void BL_ConvertSensors(struct Object* blenderobject,
        gReverseKeyTranslateTable[WINCLOSE                      ] = SCA_IInputDevice::KX_WINCLOSE;                  
        gReverseKeyTranslateTable[WINQUIT                       ] = SCA_IInputDevice::KX_WINQUIT;                  
        gReverseKeyTranslateTable[Q_FIRSTTIME           ] = SCA_IInputDevice::KX_Q_FIRSTTIME;                  
-       
+       /* **** XXX **** */
+#endif 
        // standard keyboard                                                                                       
        
        gReverseKeyTranslateTable[AKEY                          ] = SCA_IInputDevice::KX_AKEY;                  
index 19d833b5b0dc85c8850dda4344c228d60dc1f6fb..0ac712b3a18e95a1c8939c77c4b905f9ab7986ed 100644 (file)
@@ -89,7 +89,7 @@ ifeq ($(OS),darwin)
         CFLAGS += -pipe -fPIC -ffast-math -march=pentium-m -funsigned-char -fno-strict-aliasing
         CCFLAGS        += -pipe -fPIC  -funsigned-char -fno-strict-aliasing
        endif
-#    REL_CFLAGS        += -O2
+   REL_CFLAGS  += -O
 #    REL_CCFLAGS       += -O2
     CPPFLAGS   += -D_THREAD_SAFE
     NAN_DEPEND = true