Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-10-27 05:54:25 +0300
committerCampbell Barton <ideasman42@gmail.com>2009-10-27 05:54:25 +0300
commit1c1659eb286b369ffe6ba99207c42611159f24bb (patch)
tree02eaa19cedf10a01978db892e89d585dcce1707e /source/blender/editors/space_view3d
parent641072a769cc7bff4d69945c71f536c5b0394bc9 (diff)
- Right click menu can open links directly to API reference docs (rna and operators)
- Generated and uploaded api docs - http://www.blender.org/documentation/250PythonDoc - Added Edit docs menu item & operators as discussed with Mindrones, Brecht, Stani & Letterip @ bconf, needs some web backend. python operator can aparently use xml/rpc to upload docstrings. - Added operator invoke function - context.manager.invoke_props_popup(self.__operator__, event) this calls a popup for invoke by default (which intern calls execute()) - Own recent commit to game framing applied to non-camera views too. - v3d->persp is deprecated but still used in some places. - Transforming strips could overlap 1 frame if moving them below frame 0 - Transforming overlapping strips could go into an eternal loop (though overlapping strips should not exist)
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c38
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c142
-rw-r--r--source/blender/editors/space_view3d/view3d_header.c27
-rw-r--r--source/blender/editors/space_view3d/view3d_ops.c14
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c79
5 files changed, 156 insertions, 144 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 15e41a66981..487c55bec9b 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -395,14 +395,14 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, char **grid_u
setlinestyle(0);
/* center cross */
- if( ELEM(rv3d->view, V3D_VIEW_RIGHT, V3D_VIEW_LEFT))
+ if( ELEM(rv3d->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT))
UI_make_axis_color(col, col2, 'y');
else UI_make_axis_color(col, col2, 'x');
glColor3ubv((GLubyte *)col2);
fdrawline(0.0, y, (float)ar->winx, y);
- if( ELEM(rv3d->view, V3D_VIEW_TOP, V3D_VIEW_BOTTOM))
+ if( ELEM(rv3d->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM))
UI_make_axis_color(col, col2, 'y');
else UI_make_axis_color(col, col2, 'z');
glColor3ubv((GLubyte *)col2);
@@ -662,11 +662,11 @@ static void draw_view_icon(RegionView3D *rv3d)
{
BIFIconID icon;
- if( ELEM(rv3d->view, V3D_VIEW_TOP, V3D_VIEW_BOTTOM))
+ if( ELEM(rv3d->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM))
icon= ICON_AXIS_TOP;
- else if( ELEM(rv3d->view, V3D_VIEW_FRONT, V3D_VIEW_BACK))
+ else if( ELEM(rv3d->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK))
icon= ICON_AXIS_FRONT;
- else if( ELEM(rv3d->view, V3D_VIEW_RIGHT, V3D_VIEW_LEFT))
+ else if( ELEM(rv3d->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT))
icon= ICON_AXIS_SIDE;
else return ;
@@ -683,33 +683,33 @@ static char *view3d_get_name(View3D *v3d, RegionView3D *rv3d)
char *name = NULL;
switch (rv3d->view) {
- case V3D_VIEW_FRONT:
- if (rv3d->persp == V3D_ORTHO) name = "Front Ortho";
+ case RV3D_VIEW_FRONT:
+ if (rv3d->persp == RV3D_ORTHO) name = "Front Ortho";
else name = "Front Persp";
break;
- case V3D_VIEW_BACK:
- if (rv3d->persp == V3D_ORTHO) name = "Back Ortho";
+ case RV3D_VIEW_BACK:
+ if (rv3d->persp == RV3D_ORTHO) name = "Back Ortho";
else name = "Back Persp";
break;
- case V3D_VIEW_TOP:
- if (rv3d->persp == V3D_ORTHO) name = "Top Ortho";
+ case RV3D_VIEW_TOP:
+ if (rv3d->persp == RV3D_ORTHO) name = "Top Ortho";
else name = "Top Persp";
break;
- case V3D_VIEW_BOTTOM:
- if (rv3d->persp == V3D_ORTHO) name = "Bottom Ortho";
+ case RV3D_VIEW_BOTTOM:
+ if (rv3d->persp == RV3D_ORTHO) name = "Bottom Ortho";
else name = "Bottom Persp";
break;
- case V3D_VIEW_RIGHT:
- if (rv3d->persp == V3D_ORTHO) name = "Right Ortho";
+ case RV3D_VIEW_RIGHT:
+ if (rv3d->persp == RV3D_ORTHO) name = "Right Ortho";
else name = "Right Persp";
break;
- case V3D_VIEW_LEFT:
- if (rv3d->persp == V3D_ORTHO) name = "Left Ortho";
+ case RV3D_VIEW_LEFT:
+ if (rv3d->persp == RV3D_ORTHO) name = "Left Ortho";
else name = "Left Persp";
break;
default:
- if (rv3d->persp==V3D_CAMOB) {
+ if (rv3d->persp==RV3D_CAMOB) {
if ((v3d->camera) && (v3d->camera->type == OB_CAMERA)) {
Camera *cam;
cam = v3d->camera->data;
@@ -718,7 +718,7 @@ static char *view3d_get_name(View3D *v3d, RegionView3D *rv3d)
name = "Object as Camera";
}
} else {
- name = (rv3d->persp == V3D_ORTHO) ? "User Ortho" : "User Persp";
+ name = (rv3d->persp == RV3D_ORTHO) ? "User Ortho" : "User Persp";
}
break;
}
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 51f257da432..46e188bfa12 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -103,7 +103,7 @@ static void view3d_boxview_clip(ScrArea *sa)
RegionView3D *rv3d= ar->regiondata;
if(rv3d->viewlock & RV3D_BOXCLIP) {
- if(ELEM(rv3d->view, V3D_VIEW_TOP, V3D_VIEW_BOTTOM)) {
+ if(ELEM(rv3d->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM)) {
if(ar->winx>ar->winy) x1= rv3d->dist;
else x1= ar->winx*rv3d->dist/ar->winy;
@@ -113,7 +113,7 @@ static void view3d_boxview_clip(ScrArea *sa)
ofs[0]= rv3d->ofs[0];
ofs[1]= rv3d->ofs[1];
}
- else if(ELEM(rv3d->view, V3D_VIEW_FRONT, V3D_VIEW_BACK)) {
+ else if(ELEM(rv3d->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK)) {
ofs[2]= rv3d->ofs[2];
if(ar->winx>ar->winy) z1= ar->winy*rv3d->dist/ar->winx;
@@ -181,22 +181,22 @@ static void view3d_boxview_sync(ScrArea *sa, ARegion *ar)
if(rv3dtest->viewlock) {
rv3dtest->dist= rv3d->dist;
- if( ELEM(rv3d->view, V3D_VIEW_TOP, V3D_VIEW_BOTTOM) ) {
- if( ELEM(rv3dtest->view, V3D_VIEW_FRONT, V3D_VIEW_BACK))
+ if( ELEM(rv3d->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM) ) {
+ if( ELEM(rv3dtest->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK))
rv3dtest->ofs[0]= rv3d->ofs[0];
- else if( ELEM(rv3dtest->view, V3D_VIEW_RIGHT, V3D_VIEW_LEFT))
+ else if( ELEM(rv3dtest->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT))
rv3dtest->ofs[1]= rv3d->ofs[1];
}
- else if( ELEM(rv3d->view, V3D_VIEW_FRONT, V3D_VIEW_BACK) ) {
- if( ELEM(rv3dtest->view, V3D_VIEW_TOP, V3D_VIEW_BOTTOM))
+ else if( ELEM(rv3d->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK) ) {
+ if( ELEM(rv3dtest->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM))
rv3dtest->ofs[0]= rv3d->ofs[0];
- else if( ELEM(rv3dtest->view, V3D_VIEW_RIGHT, V3D_VIEW_LEFT))
+ else if( ELEM(rv3dtest->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT))
rv3dtest->ofs[2]= rv3d->ofs[2];
}
- else if( ELEM(rv3d->view, V3D_VIEW_RIGHT, V3D_VIEW_LEFT) ) {
- if( ELEM(rv3dtest->view, V3D_VIEW_TOP, V3D_VIEW_BOTTOM))
+ else if( ELEM(rv3d->view, RV3D_VIEW_RIGHT, RV3D_VIEW_LEFT) ) {
+ if( ELEM(rv3dtest->view, RV3D_VIEW_TOP, RV3D_VIEW_BOTTOM))
rv3dtest->ofs[1]= rv3d->ofs[1];
- if( ELEM(rv3dtest->view, V3D_VIEW_FRONT, V3D_VIEW_BACK))
+ if( ELEM(rv3dtest->view, RV3D_VIEW_FRONT, RV3D_VIEW_BACK))
rv3dtest->ofs[2]= rv3d->ofs[2];
}
@@ -325,12 +325,12 @@ static const float thres = 0.93f; //cos(20 deg);
static float snapquats[39][6] = {
/*{q0, q1, q3, q4, view, oposite_direction}*/
-{COS45, -SIN45, 0.0, 0.0, V3D_VIEW_FRONT, 0}, //front
-{0.0, 0.0, -SIN45, -SIN45, V3D_VIEW_BACK, 0}, //back
-{1.0, 0.0, 0.0, 0.0, V3D_VIEW_TOP, 0}, //top
-{0.0, -1.0, 0.0, 0.0, V3D_VIEW_BOTTOM, 0}, //bottom
-{0.5, -0.5, -0.5, -0.5, V3D_VIEW_LEFT, 0}, //left
-{0.5, -0.5, 0.5, 0.5, V3D_VIEW_RIGHT, 0}, //right
+{COS45, -SIN45, 0.0, 0.0, RV3D_VIEW_FRONT, 0}, //front
+{0.0, 0.0, -SIN45, -SIN45, RV3D_VIEW_BACK, 0}, //back
+{1.0, 0.0, 0.0, 0.0, RV3D_VIEW_TOP, 0}, //top
+{0.0, -1.0, 0.0, 0.0, RV3D_VIEW_BOTTOM, 0}, //bottom
+{0.5, -0.5, -0.5, -0.5, RV3D_VIEW_LEFT, 0}, //left
+{0.5, -0.5, 0.5, 0.5, RV3D_VIEW_RIGHT, 0}, //right
/* some more 45 deg snaps */
{0.65328145027160645, -0.65328145027160645, 0.27059805393218994, 0.27059805393218994, 0, 0},
@@ -601,12 +601,12 @@ static int viewrotate_invoke(bContext *C, wmOperator *op, wmEvent *event)
vod= op->customdata;
/* switch from camera view when: */
- if(vod->rv3d->persp != V3D_PERSP) {
+ if(vod->rv3d->persp != RV3D_PERSP) {
if (U.uiflag & USER_AUTOPERSP)
- vod->rv3d->persp= V3D_PERSP;
- else if(vod->rv3d->persp==V3D_CAMOB)
- vod->rv3d->persp= V3D_PERSP;
+ vod->rv3d->persp= RV3D_PERSP;
+ else if(vod->rv3d->persp==RV3D_CAMOB)
+ vod->rv3d->persp= RV3D_PERSP;
ED_region_tag_redraw(vod->ar);
}
@@ -665,7 +665,7 @@ void viewmove_modal_keymap(wmKeyConfig *keyconf)
static void viewmove_apply(ViewOpsData *vod, int x, int y)
{
- if(vod->rv3d->persp==V3D_CAMOB) {
+ if(vod->rv3d->persp==RV3D_CAMOB) {
float max= (float)MAX2(vod->ar->winx, vod->ar->winy);
vod->rv3d->camdx += (vod->oldx - x)/(max);
@@ -861,7 +861,7 @@ static void viewzoom_apply(ViewOpsData *vod, int x, int y)
view_zoom_mouseloc(vod->ar, zfac, vod->oldx, vod->oldy);
- if ((U.uiflag & USER_ORBIT_ZBUF) && (U.viewzoom==USER_ZOOM_CONT) && (vod->rv3d->persp==V3D_PERSP)) {
+ if ((U.uiflag & USER_ORBIT_ZBUF) && (U.viewzoom==USER_ZOOM_CONT) && (vod->rv3d->persp==RV3D_PERSP)) {
float upvec[3], mat[3][3];
/* Secret apricot feature, translate the view when in continues mode */
@@ -877,7 +877,7 @@ static void viewzoom_apply(ViewOpsData *vod, int x, int y)
if(vod->rv3d->dist>10.0*vod->far) vod->rv3d->dist=10.0*vod->far;
}
-// XXX if(vod->rv3d->persp==V3D_ORTHO || vod->rv3d->persp==V3D_CAMOB) preview3d_event= 0;
+// XXX if(vod->rv3d->persp==RV3D_ORTHO || vod->rv3d->persp==RV3D_CAMOB) preview3d_event= 0;
if(vod->rv3d->viewlock & RV3D_BOXVIEW)
view3d_boxview_sync(vod->sa, vod->ar);
@@ -931,7 +931,7 @@ static int viewzoom_exec(bContext *C, wmOperator *op)
if(delta < 0) {
/* this min and max is also in viewmove() */
- if(rv3d->persp==V3D_CAMOB) {
+ if(rv3d->persp==RV3D_CAMOB) {
rv3d->camzoom-= 10;
if(rv3d->camzoom<-30) rv3d->camzoom= -30;
}
@@ -940,7 +940,7 @@ static int viewzoom_exec(bContext *C, wmOperator *op)
}
}
else {
- if(rv3d->persp==V3D_CAMOB) {
+ if(rv3d->persp==RV3D_CAMOB) {
rv3d->camzoom+= 10;
if(rv3d->camzoom>300) rv3d->camzoom= 300;
}
@@ -1062,8 +1062,8 @@ static int viewhome_exec(bContext *C, wmOperator *op) /* was view3d_home() in 2.
new_dist*= size;
}
- if (rv3d->persp==V3D_CAMOB) {
- rv3d->persp= V3D_PERSP;
+ if (rv3d->persp==RV3D_CAMOB) {
+ rv3d->persp= RV3D_PERSP;
smooth_view(C, NULL, v3d->camera, new_ofs, NULL, &new_dist, NULL);
}
else {
@@ -1179,7 +1179,7 @@ static int viewcenter_exec(bContext *C, wmOperator *op) /* like a localview with
afm[2]= (max[2]-min[2]);
size= MAX3(afm[0], afm[1], afm[2]);
/* perspective should be a bit farther away to look nice */
- if(rv3d->persp==V3D_ORTHO)
+ if(rv3d->persp==RV3D_ORTHO)
size*= 0.7;
if(size <= v3d->near*1.5f) size= v3d->near*1.5f;
@@ -1201,8 +1201,8 @@ static int viewcenter_exec(bContext *C, wmOperator *op) /* like a localview with
v3d->cursor[1]= -new_ofs[1];
v3d->cursor[2]= -new_ofs[2];
- if (rv3d->persp==V3D_CAMOB) {
- rv3d->persp= V3D_PERSP;
+ if (rv3d->persp==RV3D_CAMOB) {
+ rv3d->persp= RV3D_PERSP;
smooth_view(C, v3d->camera, NULL, new_ofs, NULL, &new_dist, NULL);
}
else {
@@ -1284,7 +1284,7 @@ static int view3d_render_border_invoke(bContext *C, wmOperator *op, wmEvent *eve
RegionView3D *rv3d= CTX_wm_region_view3d(C);
/* if not in camera view do not exec the operator*/
- if (rv3d->persp == V3D_CAMOB) return WM_border_select_invoke(C, op, event);
+ if (rv3d->persp == RV3D_CAMOB) return WM_border_select_invoke(C, op, event);
else return OPERATOR_PASS_THROUGH;
}
@@ -1384,7 +1384,7 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op)
cent[0] = (((double)rect.xmin)+((double)rect.xmax)) / 2;
cent[1] = (((double)rect.ymin)+((double)rect.ymax)) / 2;
- if (rv3d->persp==V3D_PERSP) {
+ if (rv3d->persp==RV3D_PERSP) {
double p_corner[3];
/* no depths to use, we cant do anything! */
@@ -1455,7 +1455,7 @@ static int view3d_zoom_border_invoke(bContext *C, wmOperator *op, wmEvent *event
RegionView3D *rv3d= CTX_wm_region_view3d(C);
/* if in camera view do not exec the operator so we do not conflict with set render border*/
- if (rv3d->persp != V3D_CAMOB)
+ if (rv3d->persp != RV3D_CAMOB)
return WM_border_select_invoke(C, op, event);
else
return OPERATOR_PASS_THROUGH;
@@ -1489,13 +1489,13 @@ void VIEW3D_OT_zoom_border(wmOperatorType *ot)
/* ********************* Changing view operator ****************** */
static EnumPropertyItem prop_view_items[] = {
- {V3D_VIEW_FRONT, "FRONT", 0, "Front", "View From the Front"},
- {V3D_VIEW_BACK, "BACK", 0, "Back", "View From the Back"},
- {V3D_VIEW_LEFT, "LEFT", 0, "Left", "View From the Left"},
- {V3D_VIEW_RIGHT, "RIGHT", 0, "Right", "View From the Right"},
- {V3D_VIEW_TOP, "TOP", 0, "Top", "View From the Top"},
- {V3D_VIEW_BOTTOM, "BOTTOM", 0, "Bottom", "View From the Bottom"},
- {V3D_VIEW_CAMERA, "CAMERA", 0, "Camera", "View From the active amera"},
+ {RV3D_VIEW_FRONT, "FRONT", 0, "Front", "View From the Front"},
+ {RV3D_VIEW_BACK, "BACK", 0, "Back", "View From the Back"},
+ {RV3D_VIEW_LEFT, "LEFT", 0, "Left", "View From the Left"},
+ {RV3D_VIEW_RIGHT, "RIGHT", 0, "Right", "View From the Right"},
+ {RV3D_VIEW_TOP, "TOP", 0, "Top", "View From the Top"},
+ {RV3D_VIEW_BOTTOM, "BOTTOM", 0, "Bottom", "View From the Bottom"},
+ {RV3D_VIEW_CAMERA, "CAMERA", 0, "Camera", "View From the active amera"},
{0, NULL, 0, NULL, NULL}};
static void axis_set_view(bContext *C, float q1, float q2, float q3, float q4, short view, int perspo)
@@ -1506,12 +1506,12 @@ static void axis_set_view(bContext *C, float q1, float q2, float q3, float q4, s
if(rv3d->viewlock) {
/* only pass on if */
- if(rv3d->view==V3D_VIEW_FRONT && view==V3D_VIEW_BACK);
- else if(rv3d->view==V3D_VIEW_BACK && view==V3D_VIEW_FRONT);
- else if(rv3d->view==V3D_VIEW_RIGHT && view==V3D_VIEW_LEFT);
- else if(rv3d->view==V3D_VIEW_LEFT && view==V3D_VIEW_RIGHT);
- else if(rv3d->view==V3D_VIEW_BOTTOM && view==V3D_VIEW_TOP);
- else if(rv3d->view==V3D_VIEW_TOP && view==V3D_VIEW_BOTTOM);
+ if(rv3d->view==RV3D_VIEW_FRONT && view==RV3D_VIEW_BACK);
+ else if(rv3d->view==RV3D_VIEW_BACK && view==RV3D_VIEW_FRONT);
+ else if(rv3d->view==RV3D_VIEW_RIGHT && view==RV3D_VIEW_LEFT);
+ else if(rv3d->view==RV3D_VIEW_LEFT && view==RV3D_VIEW_RIGHT);
+ else if(rv3d->view==RV3D_VIEW_BOTTOM && view==RV3D_VIEW_TOP);
+ else if(rv3d->view==RV3D_VIEW_TOP && view==RV3D_VIEW_BOTTOM);
else return;
}
@@ -1525,17 +1525,17 @@ static void axis_set_view(bContext *C, float q1, float q2, float q3, float q4, s
return;
}
- if (rv3d->persp==V3D_CAMOB && v3d->camera) {
+ if (rv3d->persp==RV3D_CAMOB && v3d->camera) {
- if (U.uiflag & USER_AUTOPERSP) rv3d->persp= V3D_ORTHO;
- else if(rv3d->persp==V3D_CAMOB) rv3d->persp= perspo;
+ if (U.uiflag & USER_AUTOPERSP) rv3d->persp= RV3D_ORTHO;
+ else if(rv3d->persp==RV3D_CAMOB) rv3d->persp= perspo;
smooth_view(C, v3d->camera, NULL, rv3d->ofs, new_quat, NULL, NULL);
}
else {
- if (U.uiflag & USER_AUTOPERSP) rv3d->persp= V3D_ORTHO;
- else if(rv3d->persp==V3D_CAMOB) rv3d->persp= perspo;
+ if (U.uiflag & USER_AUTOPERSP) rv3d->persp= RV3D_ORTHO;
+ else if(rv3d->persp==RV3D_CAMOB) rv3d->persp= perspo;
smooth_view(C, NULL, NULL, NULL, new_quat, NULL, NULL);
}
@@ -1547,7 +1547,7 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
View3D *v3d = CTX_wm_view3d(C);
RegionView3D *rv3d= CTX_wm_region_view3d(C);
Scene *scene= CTX_data_scene(C);
- static int perspo=V3D_PERSP;
+ static int perspo=RV3D_PERSP;
int viewnum;
viewnum = RNA_enum_get(op->ptr, "type");
@@ -1555,35 +1555,35 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
/* Use this to test if we started out with a camera */
switch (viewnum) {
- case V3D_VIEW_BOTTOM :
+ case RV3D_VIEW_BOTTOM :
axis_set_view(C, 0.0, -1.0, 0.0, 0.0, viewnum, perspo);
break;
- case V3D_VIEW_BACK:
+ case RV3D_VIEW_BACK:
axis_set_view(C, 0.0, 0.0, (float)-cos(M_PI/4.0), (float)-cos(M_PI/4.0), viewnum, perspo);
break;
- case V3D_VIEW_LEFT:
+ case RV3D_VIEW_LEFT:
axis_set_view(C, 0.5, -0.5, 0.5, 0.5, viewnum, perspo);
break;
- case V3D_VIEW_TOP:
+ case RV3D_VIEW_TOP:
axis_set_view(C, 1.0, 0.0, 0.0, 0.0, viewnum, perspo);
break;
- case V3D_VIEW_FRONT:
+ case RV3D_VIEW_FRONT:
axis_set_view(C, (float)cos(M_PI/4.0), (float)-sin(M_PI/4.0), 0.0, 0.0, viewnum, perspo);
break;
- case V3D_VIEW_RIGHT:
+ case RV3D_VIEW_RIGHT:
axis_set_view(C, 0.5, -0.5, -0.5, -0.5, viewnum, perspo);
break;
- case V3D_VIEW_CAMERA:
+ case RV3D_VIEW_CAMERA:
if(rv3d->viewlock==0) {
/* lastview - */
- if(rv3d->persp != V3D_CAMOB) {
+ if(rv3d->persp != RV3D_CAMOB) {
/* store settings of current view before allowing overwriting with camera view */
QUATCOPY(rv3d->lviewquat, rv3d->viewquat);
rv3d->lview= rv3d->view;
@@ -1610,7 +1610,7 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
v3d->camera= scene_find_camera(scene);
/*handle_view3d_lock();*/
}
- rv3d->persp= V3D_CAMOB;
+ rv3d->persp= RV3D_CAMOB;
smooth_view(C, NULL, v3d->camera, rv3d->ofs, rv3d->viewquat, &rv3d->dist, &v3d->lens);
}
@@ -1626,7 +1626,7 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
break;
}
- if(rv3d->persp != V3D_CAMOB) perspo= rv3d->persp;
+ if(rv3d->persp != RV3D_CAMOB) perspo= rv3d->persp;
return OPERATOR_FINISHED;
}
@@ -1665,7 +1665,7 @@ static int vieworbit_exec(bContext *C, wmOperator *op)
if(rv3d->viewlock==0) {
- if(rv3d->persp != V3D_CAMOB) {
+ if(rv3d->persp != RV3D_CAMOB) {
if(orbitdir == V3D_VIEW_STEPLEFT || orbitdir == V3D_VIEW_STEPRIGHT) {
/* z-axis */
phi= (float)(M_PI/360.0)*U.pad_rot_angle;
@@ -1771,9 +1771,9 @@ static int viewpersportho_exec(bContext *C, wmOperator *op)
RegionView3D *rv3d= CTX_wm_region_view3d(C);
if(rv3d->viewlock==0) {
- if(rv3d->persp!=V3D_ORTHO)
- rv3d->persp=V3D_ORTHO;
- else rv3d->persp=V3D_PERSP;
+ if(rv3d->persp!=RV3D_ORTHO)
+ rv3d->persp=RV3D_ORTHO;
+ else rv3d->persp=RV3D_PERSP;
ED_region_tag_redraw(ar);
}
@@ -2195,7 +2195,7 @@ void viewmoveNDOFfly(ARegion *ar, View3D *v3d, int mode)
// until the first draw and doesn't update the menu
// to reflect persp mode.
- rv3d->persp = V3D_PERSP;
+ rv3d->persp = RV3D_PERSP;
// Correct the distance jump if rv3d->dist != 0
@@ -2357,7 +2357,7 @@ void viewmoveNDOF(Scene *scene, ARegion *ar, View3D *v3d, int mode)
fval[6] = fval[6] / 1000000.0f;
// scale more if not in perspective mode
- if (rv3d->persp == V3D_ORTHO) {
+ if (rv3d->persp == RV3D_ORTHO) {
fval[0] = fval[0] * 0.05f;
fval[1] = fval[1] * 0.05f;
fval[2] = fval[2] * 0.05f;
@@ -2405,8 +2405,8 @@ void viewmoveNDOF(Scene *scene, ARegion *ar, View3D *v3d, int mode)
*/
len = zsens * sbadjust * fval[2];
- if (rv3d->persp==V3D_CAMOB) {
- if(rv3d->persp==V3D_CAMOB) { /* This is stupid, please fix - TODO */
+ if (rv3d->persp==RV3D_CAMOB) {
+ if(rv3d->persp==RV3D_CAMOB) { /* This is stupid, please fix - TODO */
rv3d->camzoom+= 10.0f * -len;
}
if (rv3d->camzoom < minZoom) rv3d->camzoom = minZoom;
diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c
index 1e11699556a..7bf50dcd5af 100644
--- a/source/blender/editors/space_view3d/view3d_header.c
+++ b/source/blender/editors/space_view3d/view3d_header.c
@@ -168,21 +168,30 @@ static RegionView3D *wm_region_view3d(const bContext *C)
return NULL;
}
-static void copy_view3d_lock_space(View3D *vd, Scene *scene)
+static void copy_view3d_lock_space(View3D *v3d, Scene *scene)
{
int bit;
- if(vd->scenelock && vd->localvd==NULL) {
- vd->lay= scene->lay;
- vd->camera= scene->camera;
+ if(v3d->scenelock && v3d->localvd==NULL) {
+ v3d->lay= scene->lay;
+ v3d->camera= scene->camera;
- if(vd->camera==0 && vd->persp==V3D_CAMOB)
- vd->persp= V3D_PERSP;
+ if(v3d->camera==NULL) {
+ ARegion *ar;
+
+ for(ar=v3d->regionbase.first; ar; ar= ar->next) {
+ if(ar->regiontype == RGN_TYPE_WINDOW) {
+ RegionView3D *rv3d= ar->regiondata;
+ if(rv3d->persp==RV3D_CAMOB)
+ rv3d->persp= RV3D_PERSP;
+ }
+ }
+ }
- if((vd->lay & vd->layact) == 0) {
+ if((v3d->lay & v3d->layact) == 0) {
for(bit= 0; bit<32; bit++) {
- if(vd->lay & (1<<bit)) {
- vd->layact= 1<<bit;
+ if(v3d->lay & (1<<bit)) {
+ v3d->layact= 1<<bit;
break;
}
}
diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c
index 4b692e572e2..13324e61999 100644
--- a/source/blender/editors/space_view3d/view3d_ops.c
+++ b/source/blender/editors/space_view3d/view3d_ops.c
@@ -137,19 +137,19 @@ void view3d_keymap(wmKeyConfig *keyconf)
RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_all", CKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "center", 1);
/* numpad view hotkeys*/
- RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD0, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_CAMERA);
- RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_FRONT);
+ RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD0, KM_PRESS, 0, 0)->ptr, "type", RV3D_VIEW_CAMERA);
+ RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, 0, 0)->ptr, "type", RV3D_VIEW_FRONT);
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", PAD2, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_STEPDOWN);
- RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD3, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_RIGHT);
+ RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD3, KM_PRESS, 0, 0)->ptr, "type", RV3D_VIEW_RIGHT);
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", PAD4, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_STEPLEFT);
WM_keymap_add_item(keymap, "VIEW3D_OT_view_persportho", PAD5, KM_PRESS, 0, 0);
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", PAD6, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_STEPRIGHT);
- RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_TOP);
+ RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, 0, 0)->ptr, "type", RV3D_VIEW_TOP);
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", PAD8, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_STEPUP);
- RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, KM_CTRL, 0)->ptr, "type", V3D_VIEW_BACK);
- RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD3, KM_PRESS, KM_CTRL, 0)->ptr, "type", V3D_VIEW_LEFT);
- RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, KM_CTRL, 0)->ptr, "type", V3D_VIEW_BOTTOM);
+ RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, KM_CTRL, 0)->ptr, "type", RV3D_VIEW_BACK);
+ RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD3, KM_PRESS, KM_CTRL, 0)->ptr, "type", RV3D_VIEW_LEFT);
+ RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, KM_CTRL, 0)->ptr, "type", RV3D_VIEW_BOTTOM);
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_pan", PAD2, KM_PRESS, KM_CTRL, 0)->ptr, "type", V3D_VIEW_PANDOWN);
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_pan", PAD4, KM_PRESS, KM_CTRL, 0)->ptr, "type", V3D_VIEW_PANLEFT);
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_pan", PAD6, KM_PRESS, KM_CTRL, 0)->ptr, "type", V3D_VIEW_PANRIGHT);
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index b108d38a3f9..300825bfe7d 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -285,7 +285,7 @@ void smooth_view(bContext *C, Object *oldcamera, Object *camera, float *ofs, flo
rv3d->view= 0;
/* ensure it shows correct */
- if(sms.to_camera) rv3d->persp= V3D_PERSP;
+ if(sms.to_camera) rv3d->persp= RV3D_PERSP;
/* keep track of running timer! */
if(rv3d->sms==NULL)
@@ -329,7 +329,7 @@ static int view3d_smoothview_invoke(bContext *C, wmOperator *op, wmEvent *event)
/* if we went to camera, store the original */
if(sms->to_camera) {
- rv3d->persp= V3D_CAMOB;
+ rv3d->persp= RV3D_CAMOB;
VECCOPY(rv3d->ofs, sms->orig_ofs);
QUATCOPY(rv3d->viewquat, sms->orig_quat);
rv3d->dist = sms->orig_dist;
@@ -411,7 +411,7 @@ static int view3d_setcameratoview_exec(bContext *C, wmOperator *op)
RegionView3D *rv3d= CTX_wm_region_view3d(C);
setcameratoview3d(v3d, rv3d, v3d->camera);
- rv3d->persp = V3D_CAMOB;
+ rv3d->persp = RV3D_CAMOB;
WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, CTX_data_scene(C));
@@ -452,7 +452,7 @@ static int view3d_setobjectascamera_exec(bContext *C, wmOperator *op)
Scene *scene= CTX_data_scene(C);
if(BASACT) {
- rv3d->persp= V3D_CAMOB;
+ rv3d->persp= RV3D_CAMOB;
v3d->camera= OBACT;
if(v3d->scenelock)
scene->camera= OBACT;
@@ -487,7 +487,7 @@ void viewline(ARegion *ar, View3D *v3d, float mval[2], float ray_start[3], float
RegionView3D *rv3d= ar->regiondata;
float vec[4];
- if(rv3d->persp != V3D_ORTHO){
+ if(rv3d->persp != RV3D_ORTHO){
vec[0]= 2.0f * mval[0] / ar->winx - 1;
vec[1]= 2.0f * mval[1] / ar->winy - 1;
vec[2]= -1.0f;
@@ -820,7 +820,7 @@ int get_view3d_ortho(View3D *v3d, RegionView3D *rv3d)
{
Camera *cam;
- if(rv3d->persp==V3D_CAMOB) {
+ if(rv3d->persp==RV3D_CAMOB) {
if(v3d->camera && v3d->camera->type==OB_CAMERA) {
cam= v3d->camera->data;
@@ -833,7 +833,7 @@ int get_view3d_ortho(View3D *v3d, RegionView3D *rv3d)
return 0;
}
- if(rv3d->persp==V3D_ORTHO)
+ if(rv3d->persp==RV3D_ORTHO)
return 1;
return 0;
@@ -852,7 +852,7 @@ int get_view3d_viewplane(View3D *v3d, RegionView3D *rv3d, int winxi, int winyi,
*clipsta= v3d->near;
*clipend= v3d->far;
- if(rv3d->persp==V3D_CAMOB) {
+ if(rv3d->persp==RV3D_CAMOB) {
if(v3d->camera) {
if(v3d->camera->type==OB_LAMP ) {
Lamp *la;
@@ -875,7 +875,7 @@ int get_view3d_viewplane(View3D *v3d, RegionView3D *rv3d, int winxi, int winyi,
}
}
- if(rv3d->persp==V3D_ORTHO) {
+ if(rv3d->persp==RV3D_ORTHO) {
if(winx>winy) x1= -rv3d->dist;
else x1= -winx*rv3d->dist/winy;
x2= -x1;
@@ -890,7 +890,7 @@ int get_view3d_viewplane(View3D *v3d, RegionView3D *rv3d, int winxi, int winyi,
}
else {
/* fac for zoom, also used for camdx */
- if(rv3d->persp==V3D_CAMOB) {
+ if(rv3d->persp==RV3D_CAMOB) {
fac= (1.41421+( (float)rv3d->camzoom )/50.0);
fac*= fac;
}
@@ -1009,7 +1009,7 @@ static void obmat_to_viewmat(View3D *v3d, RegionView3D *rv3d, Object *ob, short
Mat3CpyMat4(tmat, rv3d->viewmat);
if (smooth) {
float new_quat[4];
- if (rv3d->persp==V3D_CAMOB && v3d->camera) {
+ if (rv3d->persp==RV3D_CAMOB && v3d->camera) {
/* were from a camera view */
float orig_ofs[3];
@@ -1020,13 +1020,13 @@ static void obmat_to_viewmat(View3D *v3d, RegionView3D *rv3d, Object *ob, short
/* Switch from camera view */
Mat3ToQuat(tmat, new_quat);
- rv3d->persp=V3D_PERSP;
+ rv3d->persp=RV3D_PERSP;
rv3d->dist= 0.0;
view_settings_from_ob(v3d->camera, rv3d->ofs, NULL, NULL, &v3d->lens);
smooth_view(NULL, NULL, NULL, orig_ofs, new_quat, &orig_dist, &orig_lens); // XXX
- rv3d->persp=V3D_CAMOB; /* just to be polite, not needed */
+ rv3d->persp=RV3D_CAMOB; /* just to be polite, not needed */
} else {
Mat3ToQuat(tmat, new_quat);
@@ -1042,27 +1042,27 @@ static void obmat_to_viewmat(View3D *v3d, RegionView3D *rv3d, Object *ob, short
static void view3d_viewlock(RegionView3D *rv3d)
{
switch(rv3d->view) {
- case V3D_VIEW_BOTTOM :
+ case RV3D_VIEW_BOTTOM :
QUATSET(rv3d->viewquat,0.0, -1.0, 0.0, 0.0);
break;
- case V3D_VIEW_BACK:
+ case RV3D_VIEW_BACK:
QUATSET(rv3d->viewquat,0.0, 0.0, (float)-cos(M_PI/4.0), (float)-cos(M_PI/4.0));
break;
- case V3D_VIEW_LEFT:
+ case RV3D_VIEW_LEFT:
QUATSET(rv3d->viewquat,0.5, -0.5, 0.5, 0.5);
break;
- case V3D_VIEW_TOP:
+ case RV3D_VIEW_TOP:
QUATSET(rv3d->viewquat,1.0, 0.0, 0.0, 0.0);
break;
- case V3D_VIEW_FRONT:
+ case RV3D_VIEW_FRONT:
QUATSET(rv3d->viewquat,(float)cos(M_PI/4.0), (float)-sin(M_PI/4.0), 0.0, 0.0);
break;
- case V3D_VIEW_RIGHT:
+ case RV3D_VIEW_RIGHT:
QUATSET(rv3d->viewquat, 0.5, -0.5, -0.5, -0.5);
break;
}
@@ -1071,7 +1071,7 @@ static void view3d_viewlock(RegionView3D *rv3d)
/* dont set windows active in in here, is used by renderwin too */
void setviewmatrixview3d(Scene *scene, View3D *v3d, RegionView3D *rv3d)
{
- if(rv3d->persp==V3D_CAMOB) { /* obs/camera */
+ if(rv3d->persp==RV3D_CAMOB) { /* obs/camera */
if(v3d->camera) {
where_is_object(scene, v3d->camera);
obmat_to_viewmat(v3d, rv3d, v3d->camera, 0);
@@ -1087,7 +1087,7 @@ void setviewmatrixview3d(Scene *scene, View3D *v3d, RegionView3D *rv3d)
view3d_viewlock(rv3d);
QuatToMat4(rv3d->viewquat, rv3d->viewmat);
- if(rv3d->persp==V3D_PERSP) rv3d->viewmat[3][2]-= rv3d->dist;
+ if(rv3d->persp==RV3D_PERSP) rv3d->viewmat[3][2]-= rv3d->dist;
if(v3d->ob_centre) {
Object *ob= v3d->ob_centre;
float vec[3];
@@ -1324,7 +1324,7 @@ static void initlocalview(Scene *scene, ScrArea *sa)
rv3d->dist= size;
/* perspective should be a bit farther away to look nice */
- if(rv3d->persp==V3D_ORTHO)
+ if(rv3d->persp==RV3D_ORTHO)
rv3d->dist*= 0.7;
// correction for window aspect ratio
@@ -1334,7 +1334,7 @@ static void initlocalview(Scene *scene, ScrArea *sa)
rv3d->dist*= asp;
}
- if (rv3d->persp==V3D_CAMOB) rv3d->persp= V3D_PERSP;
+ if (rv3d->persp==RV3D_CAMOB) rv3d->persp= RV3D_PERSP;
v3d->cursor[0]= -rv3d->ofs[0];
v3d->cursor[1]= -rv3d->ofs[1];
@@ -1566,8 +1566,10 @@ static int game_engine_exec(bContext *C, wmOperator *unused)
bScreen *sc= CTX_wm_screen(C);
ScrArea *sa, *prevsa= CTX_wm_area(C);
ARegion *ar, *prevar= CTX_wm_region(C);
+ RegionView3D *rv3d;
rcti cam_frame;
+
sa= prevsa;
if(sa->spacetype != SPACE_VIEW3D) {
for(sa=sc->areabase.first; sa; sa= sa->next)
@@ -1588,12 +1590,13 @@ static int game_engine_exec(bContext *C, wmOperator *unused)
// bad context switch ..
CTX_wm_area_set(C, sa);
CTX_wm_region_set(C, ar);
+ rv3d= ar->regiondata;
view3d_operator_needs_opengl(C);
game_set_commmandline_options(&startscene->gm);
- if(startscene->gm.framing.type == SCE_GAMEFRAMING_BARS) { /* Letterbox */
+ if(rv3d->persp==RV3D_CAMOB && startscene->gm.framing.type == SCE_GAMEFRAMING_BARS) { /* Letterbox */
rctf cam_framef;
calc_viewborder(startscene, ar, CTX_wm_view3d(C), &cam_framef);
cam_frame.xmin = cam_framef.xmin + ar->winrct.xmin;
@@ -1788,7 +1791,7 @@ int initFlyInfo (bContext *C, FlyInfo *fly, wmOperator *op, wmEvent *event)
fly->ar = CTX_wm_region(C);
fly->scene= CTX_data_scene(C);
- if(fly->rv3d->persp==V3D_CAMOB && fly->v3d->camera->id.lib) {
+ if(fly->rv3d->persp==RV3D_CAMOB && fly->v3d->camera->id.lib) {
BKE_report(op->reports, RPT_ERROR, "Cannot fly a camera from an external library");
return FALSE;
}
@@ -1798,7 +1801,7 @@ int initFlyInfo (bContext *C, FlyInfo *fly, wmOperator *op, wmEvent *event)
return FALSE;
}
- if(fly->rv3d->persp==V3D_CAMOB && fly->v3d->camera->constraints.first) {
+ if(fly->rv3d->persp==RV3D_CAMOB && fly->v3d->camera->constraints.first) {
BKE_report(op->reports, RPT_ERROR, "Cannot fly an object with constraints");
return FALSE;
}
@@ -1842,7 +1845,7 @@ int initFlyInfo (bContext *C, FlyInfo *fly, wmOperator *op, wmEvent *event)
fly->persp_backup= fly->rv3d->persp;
fly->dist_backup= fly->rv3d->dist;
- if (fly->rv3d->persp==V3D_CAMOB) {
+ if (fly->rv3d->persp==RV3D_CAMOB) {
/* store the origoinal camera loc and rot */
VECCOPY(fly->ofs_backup, fly->v3d->camera->loc);
VECCOPY(fly->rot_backup, fly->v3d->camera->rot);
@@ -1860,8 +1863,8 @@ int initFlyInfo (bContext *C, FlyInfo *fly, wmOperator *op, wmEvent *event)
} else {
/* perspective or ortho */
- if (fly->rv3d->persp==V3D_ORTHO)
- fly->rv3d->persp= V3D_PERSP; /*if ortho projection, make perspective */
+ if (fly->rv3d->persp==RV3D_ORTHO)
+ fly->rv3d->persp= RV3D_PERSP; /*if ortho projection, make perspective */
QUATCOPY(fly->rot_backup, fly->rv3d->viewquat);
VECCOPY(fly->ofs_backup, fly->rv3d->ofs);
fly->rv3d->dist= 0.0;
@@ -1891,7 +1894,7 @@ static int flyEnd(bContext *C, FlyInfo *fly)
if (fly->state == FLY_CANCEL) {
/* Revert to original view? */
- if (fly->persp_backup==V3D_CAMOB) { /* a camera view */
+ if (fly->persp_backup==RV3D_CAMOB) { /* a camera view */
rv3d->viewbut=1;
VECCOPY(v3d->camera->loc, fly->ofs_backup);
VECCOPY(v3d->camera->rot, fly->rot_backup);
@@ -1903,7 +1906,7 @@ static int flyEnd(bContext *C, FlyInfo *fly)
rv3d->persp= fly->persp_backup;
}
}
- else if (fly->persp_backup==V3D_CAMOB) { /* camera */
+ else if (fly->persp_backup==RV3D_CAMOB) { /* camera */
float mat3[3][3];
Mat3CpyMat4(mat3, v3d->camera->obmat);
Mat3ToCompatibleEul(mat3, v3d->camera->rot, fly->rot_backup);
@@ -2289,7 +2292,7 @@ int flyApply(FlyInfo *fly)
/* impose a directional lag */
VecLerpf(dvec, dvec_tmp, fly->dvec_prev, (1.0f/(1.0f+(time_redraw*5.0f))));
- if (rv3d->persp==V3D_CAMOB) {
+ if (rv3d->persp==RV3D_CAMOB) {
if (v3d->camera->protectflag & OB_LOCK_LOCX)
dvec[0] = 0.0;
if (v3d->camera->protectflag & OB_LOCK_LOCY)
@@ -2313,8 +2316,8 @@ int flyApply(FlyInfo *fly)
//XXX2.5 do_screenhandlers(G.curscreen); /* advance the next frame */
/* we are in camera view so apply the view ofs and quat to the view matrix and set the camera to the view */
- if (rv3d->persp==V3D_CAMOB) {
- rv3d->persp= V3D_PERSP; /*set this so setviewmatrixview3d uses the ofs and quat instead of the camera */
+ if (rv3d->persp==RV3D_CAMOB) {
+ rv3d->persp= RV3D_PERSP; /*set this so setviewmatrixview3d uses the ofs and quat instead of the camera */
setviewmatrixview3d(scene, v3d, rv3d);
setcameratoview3d(v3d, rv3d, v3d->camera);
@@ -2324,7 +2327,7 @@ int flyApply(FlyInfo *fly)
VecNegf(v3d->camera->loc);
}
- rv3d->persp= V3D_CAMOB;
+ rv3d->persp= RV3D_CAMOB;
#if 0 //XXX2.5
/* record the motion */
if (IS_AUTOKEY_MODE(NORMAL) && (!playing_anim || cfra != G.scene->r.cfra)) {
@@ -2457,19 +2460,19 @@ void view3d_align_axis_to_vector(View3D *v3d, RegionView3D *rv3d, int axisidx, f
rv3d->view= 0;
- if (rv3d->persp==V3D_CAMOB && v3d->camera) {
+ if (rv3d->persp==RV3D_CAMOB && v3d->camera) {
/* switch out of camera view */
float orig_ofs[3];
float orig_dist= rv3d->dist;
float orig_lens= v3d->lens;
VECCOPY(orig_ofs, rv3d->ofs);
- rv3d->persp= V3D_PERSP;
+ rv3d->persp= RV3D_PERSP;
rv3d->dist= 0.0;
view_settings_from_ob(v3d->camera, rv3d->ofs, NULL, NULL, &v3d->lens);
smooth_view(NULL, NULL, NULL, orig_ofs, new_quat, &orig_dist, &orig_lens); // XXX
} else {
- if (rv3d->persp==V3D_CAMOB) rv3d->persp= V3D_PERSP; /* switch out of camera mode */
+ if (rv3d->persp==RV3D_CAMOB) rv3d->persp= RV3D_PERSP; /* switch out of camera mode */
smooth_view(NULL, NULL, NULL, NULL, new_quat, NULL, NULL); // XXX
}
}