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>2006-12-29 21:09:05 +0300
committerCampbell Barton <ideasman42@gmail.com>2006-12-29 21:09:05 +0300
commitafb5f209d69b6f25f02aca0a09d245ad051e573b (patch)
tree81373bd74ec13f7c65e8bf78dff2c459840ec5db /source/blender/src/editview.c
parentd73468989516772c4095abc8c5c15aa71669b3f7 (diff)
record while in fly mode when record is enabled from the timeline.
if play and record are enabled at the same time you can record the flight path. adds a keyframe for every frame, dosnt support the Keying options in the user prefs. If no rotation is being done on the camera, no rot keys are applied and same for location.
Diffstat (limited to 'source/blender/src/editview.c')
-rw-r--r--source/blender/src/editview.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/source/blender/src/editview.c b/source/blender/src/editview.c
index de7fd8f5cf4..507c4d55247 100644
--- a/source/blender/src/editview.c
+++ b/source/blender/src/editview.c
@@ -59,6 +59,7 @@
#include "DNA_space_types.h"
#include "DNA_view3d_types.h"
#include "DNA_userdef_types.h"
+#include "DNA_ipo_types.h" /* for fly mode recording */
#include "BLI_blenlib.h"
#include "BLI_arithb.h"
@@ -2116,6 +2117,11 @@ void fly(void)
persp_backup; /* remember if were ortho or not, only used for restoring the view if it was a ortho view */
short xlock=0, zlock=0;
+ /* for recording */
+ int cfra = G.scene->r.cfra;
+ char *actname="";
+
+
if(curarea->spacetype!=SPACE_VIEW3D) return;
if(G.vd->persp==2 && G.vd->camera->id.lib) return;
@@ -2132,6 +2138,11 @@ void fly(void)
G.vd->dist=0.0;
G.vd->viewbut=0;
+
+ /* used for recording */
+ if(G.vd->camera->ipoflag & OB_ACTION_OB)
+ actname= "Object";
+
} else {
/* perspective or ortho */
if (G.vd->persp==0)
@@ -2363,16 +2374,33 @@ void fly(void)
VecAddf(G.vd->ofs, G.vd->ofs, dvec);
headerprint("FlyKeys Speed:(+/- | Wheel), MouseLook:Alt, Upright Axis:X/Z, Slow:Shift, Direction:WASDRF, Ok:LMB, Cancel:RMB");
-
+
+ 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 teh view */
if (G.vd->persp==2) {
G.vd->persp= 1; /*set this so setviewmatrixview3d uses the ofs and quat instead of the camera */
setviewmatrixview3d();
setcameratoview3d();
G.vd->persp= 2;
+
+ /* record the motion */
+ if (G.flags & G_RECORDKEYS && G.vd->camera->ipo && cfra != G.scene->r.cfra) {
+ cfra = G.scene->r.cfra;
+
+ if (xlock || zlock || moffset[0] || moffset[1]) {
+ insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_ROT_X);
+ insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_ROT_Y);
+ insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_ROT_Z);
+ }
+ if (speed) {
+ insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_LOC_X);
+ insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_LOC_Y);
+ insertkey(&G.vd->camera->id, ID_OB, actname, NULL, OB_LOC_Z);
+ }
+ }
DAG_object_flush_update(G.scene, G.vd->camera, OB_RECALC_OB);
}
-
scrarea_do_windraw(curarea);
screen_swapbuffers();
} else
@@ -2401,6 +2429,13 @@ void fly(void)
float mat3[3][3];
Mat3CpyMat4(mat3, G.vd->camera->obmat);
Mat3ToCompatibleEul(mat3, G.vd->camera->rot, rot_backup);
+
+ if (G.flags & G_RECORDKEYS && G.vd->camera->ipo) {
+ allqueue(REDRAWIPO, 0);
+ allspace(REMAKEIPO, 0);
+ allqueue(REDRAWNLA, 0);
+ allqueue(REDRAWTIME, 0);
+ }
}
else { /* not camera */
/* Apply the fly mode view */