remove some unused view3d members & added RV3D_VIEW_USER define.
authorCampbell Barton <ideasman42@gmail.com>
Sun, 15 May 2011 03:42:28 +0000 (03:42 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 15 May 2011 03:42:28 +0000 (03:42 +0000)
Aligorith: replaced v3d->keyflags with ANIMFILTER_KEYS_LOCAL since v3d->keyflags couldn't be set anywhere and wasn't initialized.

source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/makesdna/DNA_view3d_types.h

index 6f5960f5ed3c5208466ce0468e81d6cf3666035b..40a38d7f78c333aab5fbd25e5cc92fda0cc3eca7 100644 (file)
@@ -763,7 +763,7 @@ static void draw_viewport_name(ARegion *ar, View3D *v3d)
 /* draw info beside axes in bottom left-corner: 
 *      framenum, object name, bone name (if available), marker name (if available)
 */
-static void draw_selected_name(Scene *scene, Object *ob, View3D *v3d)
+static void draw_selected_name(Scene *scene, Object *ob)
 {
        char info[256], *markern;
        short offset=30;
@@ -832,7 +832,7 @@ static void draw_selected_name(Scene *scene, Object *ob, View3D *v3d)
                }
                
                /* color depends on whether there is a keyframe */
-               if (id_frame_has_keyframe((ID *)ob, /*BKE_curframe(scene)*/(float)(CFRA), v3d->keyflags))
+               if (id_frame_has_keyframe((ID *)ob, /*BKE_curframe(scene)*/(float)(CFRA), ANIMFILTER_KEYS_LOCAL))
                        UI_ThemeColor(TH_VERTEX_SELECT);
                else
                        UI_ThemeColor(TH_TEXT_HI);
@@ -2469,7 +2469,7 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
        // needs to be done always, gridview is adjusted in drawgrid() now
        rv3d->gridview= v3d->grid;
 
-       if(rv3d->view==0 || rv3d->persp != RV3D_ORTHO) {
+       if((rv3d->view == RV3D_VIEW_USER) || (rv3d->persp != RV3D_ORTHO)) {
                if ((v3d->flag2 & V3D_RENDER_OVERRIDE)==0) {
                        drawfloor(scene, v3d, &grid_unit);
                }
@@ -2641,7 +2641,7 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar)
 
        ob= OBACT;
        if(U.uiflag & USER_DRAWVIEWINFO) 
-               draw_selected_name(scene, ob, v3d);
+               draw_selected_name(scene, ob);
        
        /* XXX here was the blockhandlers for floating panels */
 
index 01d89e6d84bf2a346c024485e2eadf68270904f3..0289bcd841bb6077677c6ba648e912069845019b 100644 (file)
@@ -568,7 +568,7 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y)
 {
        RegionView3D *rv3d= vod->rv3d;
 
-       rv3d->view= 0; /* need to reset everytime because of view snapping */
+       rv3d->view= RV3D_VIEW_USER; /* need to reset everytime because of view snapping */
 
        if (U.flag & USER_TRACKBALL) {
                float phi, si, q1[4], dvec[3], newvec[3];
@@ -2218,7 +2218,7 @@ static void axis_set_view(bContext *C, View3D *v3d, ARegion *ar, float q1, float
                        invert_qt(obact_quat);
                        mul_qt_qtqt(new_quat, new_quat, obact_quat);
 
-                       rv3d->view= view= 0;
+                       rv3d->view= view= RV3D_VIEW_USER;
                }
        }
 
@@ -2430,7 +2430,7 @@ static int vieworbit_exec(bContext *C, wmOperator *op)
                                q1[1]= q1[2]= 0.0;
                                q1[3]= si;
                                mul_qt_qtqt(new_quat, rv3d->viewquat, q1);
-                               rv3d->view= 0;
+                               rv3d->view= RV3D_VIEW_USER;
                        }
                        else if(orbitdir == V3D_VIEW_STEPDOWN || orbitdir == V3D_VIEW_STEPUP) {
                                /* horizontal axis */
@@ -2442,7 +2442,7 @@ static int vieworbit_exec(bContext *C, wmOperator *op)
                                q1[0]= (float)cos(phi);
                                mul_v3_fl(q1+1, sin(phi));
                                mul_qt_qtqt(new_quat, rv3d->viewquat, q1);
-                               rv3d->view= 0;
+                               rv3d->view= RV3D_VIEW_USER;
                        }
 
                        smooth_view(C, CTX_wm_view3d(C), ar, NULL, NULL, NULL, new_quat, NULL, NULL);
index aad9c1dd3fff28530fa86154d6e36fc9c8e0ebb9..fce23df38101b7e6fe8e52f2b7e3fcde3b891e2a 100644 (file)
@@ -522,9 +522,9 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
                block= uiLayoutGetBlock(row);
                
                if(v3d->twflag & V3D_USE_MANIPULATOR) {
-                       uiDefIconButBitS(block, TOG, V3D_MANIP_TRANSLATE, B_MAN_TRANS, ICON_MAN_TRANS, 0,0,XIC,YIC, &v3d->twtype, 1.0, 0.0, 0, 0, "Translate manipulator mode");
-                       uiDefIconButBitS(block, TOG, V3D_MANIP_ROTATE, B_MAN_ROT, ICON_MAN_ROT, 0,0,XIC,YIC, &v3d->twtype, 1.0, 0.0, 0, 0, "Rotate manipulator mode");
-                       uiDefIconButBitS(block, TOG, V3D_MANIP_SCALE, B_MAN_SCALE, ICON_MAN_SCALE, 0,0,XIC,YIC, &v3d->twtype, 1.0, 0.0, 0, 0, "Scale manipulator mode");
+                       uiDefIconButBitC(block, TOG, V3D_MANIP_TRANSLATE, B_MAN_TRANS, ICON_MAN_TRANS, 0,0,XIC,YIC, &v3d->twtype, 1.0, 0.0, 0, 0, "Translate manipulator mode");
+                       uiDefIconButBitC(block, TOG, V3D_MANIP_ROTATE, B_MAN_ROT, ICON_MAN_ROT, 0,0,XIC,YIC, &v3d->twtype, 1.0, 0.0, 0, 0, "Rotate manipulator mode");
+                       uiDefIconButBitC(block, TOG, V3D_MANIP_SCALE, B_MAN_SCALE, ICON_MAN_SCALE, 0,0,XIC,YIC, &v3d->twtype, 1.0, 0.0, 0, 0, "Scale manipulator mode");
                }
                        
                if (v3d->twmode > (BIF_countTransformOrientation(C) - 1) + V3D_MANIP_CUSTOM) {
@@ -532,7 +532,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
                }
                        
                str_menu = BIF_menustringTransformOrientation(C, "Orientation");
-               uiDefButS(block, MENU, B_MAN_MODE, str_menu,0,0,70 * dpi_fac, YIC, &v3d->twmode, 0, 0, 0, 0, "Transform Orientation");
+               uiDefButC(block, MENU, B_MAN_MODE, str_menu,0,0,70 * dpi_fac, YIC, &v3d->twmode, 0, 0, 0, 0, "Transform Orientation");
                MEM_freeN((void *)str_menu);
        }
 
index 638b92a18b93a4d1d98d473dd3ce7a17881aaffa..2f8d90dd49b663ba200bfd666e19886f3f8e4ac1 100644 (file)
@@ -218,7 +218,7 @@ void smooth_view(bContext *C, View3D *v3d, ARegion *ar, Object *oldcamera, Objec
                        if((rv3d->viewlock & RV3D_LOCKED)==0) {
                                /* use existing if exists, means multiple calls to smooth view wont loose the original 'view' setting */
                                sms.orig_view= rv3d->sms ? rv3d->sms->orig_view : rv3d->view;
-                               rv3d->view= 0;
+                               rv3d->view= RV3D_VIEW_USER;
                        }
 
                        sms.time_allowed= (double)U.smooth_viewtx / 1000.0;
@@ -1116,7 +1116,7 @@ static void obmat_to_viewmat(View3D *v3d, RegionView3D *rv3d, Object *ob, short
        float bmat[4][4];
        float tmat[3][3];
        
-       rv3d->view= 0; /* dont show the grid */
+       rv3d->view= RV3D_VIEW_USER; /* dont show the grid */
        
        copy_m4_m4(bmat, ob->obmat);
        normalize_m4(bmat);
@@ -1869,7 +1869,7 @@ void view3d_align_axis_to_vector(View3D *v3d, RegionView3D *rv3d, int axisidx, f
        cross_v3_v3v3(axis, alignaxis, norm);
        axis_angle_to_quat( new_quat,axis, -angle);
        
-       rv3d->view= 0;
+       rv3d->view= RV3D_VIEW_USER;
        
        if (rv3d->persp==RV3D_CAMOB && v3d->camera) {
                /* switch out of camera view */
index e76cd4b07d6e6c9c5115d8446e50bf76eed9d1f5..60fa48d9717e7f2fac74b927fbf2e32ba6c72e58 100644 (file)
@@ -163,26 +163,21 @@ typedef struct View3D {
         * OB_SHADED or OB_TEXTURE */
        short drawtype;
        short ob_centre_cursor;         /* optional bool for 3d cursor to define center */
-       short scenelock, around, pad3;
+       short scenelock, around;
        short flag, flag2;
        
-       short pivot_last; /* pivot_last is for rotating around the last edited element */
-       
        float lens, grid;
-       float gridview; /* XXX deprecated, now in RegionView3D */
        float near, far;
        float ofs[3];                   /* XXX deprecated */
        float cursor[3];
 
-       short gridlines, pad4;
-       short gridflag;
-       short gridsubdiv;       /* Number of subdivisions in the grid between each highlighted grid line */
        short modeselect;
-       short keyflags;         /* flags for display of keyframes */
-       
+       short gridlines;
+       short gridsubdiv;       /* Number of subdivisions in the grid between each highlighted grid line */
+       char gridflag;
+
        /* transform widget info */
-       short twtype, twmode, twflag;
-       short twdrawflag; /* XXX deprecated */
+       char twtype, twmode, twflag, pad2[2];
        
        /* afterdraw, for xray & transparent */
        struct ListBase afterdraw_transp;
@@ -195,7 +190,7 @@ typedef struct View3D {
        char ndofmode;                  /* mode of transform for 6DOF devices -1 not found, 0 normal, 1 fly, 2 ob transform */
        char ndoffilter;                /* filter for 6DOF devices 0 normal, 1 dominant */
        
-       void *properties_storage;       /* Nkey panel stores stuff here, not in file */
+       void *properties_storage;       /* Nkey panel stores stuff here (runtime only!) */
        
        /* XXX depricated? */
        struct bGPdata *gpd;            /* Grease-Pencil Data (annotation layers) */
@@ -231,10 +226,11 @@ typedef struct View3D {
 #define RV3D_BOXCLIP           4
 
 /* RegionView3d->view */
-#define RV3D_VIEW_FRONT                 1
+#define RV3D_VIEW_USER                  0
+#define RV3D_VIEW_FRONT                         1
 #define RV3D_VIEW_BACK                  2
 #define RV3D_VIEW_LEFT                  3
-#define RV3D_VIEW_RIGHT                 4
+#define RV3D_VIEW_RIGHT                         4
 #define RV3D_VIEW_TOP                   5
 #define RV3D_VIEW_BOTTOM                6
 #define RV3D_VIEW_PERSPORTHO    7