diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-12-16 22:49:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-12-16 22:49:33 +0300 |
commit | c3401eb5cb0833dc76eff1e90e573b487181ec81 (patch) | |
tree | ce0ab6907d724650abff8f4ee2d80c96c8e4169f /source/blender/editors/screen | |
parent | 5e48ab8d75bd5ce3085a9de183f36107f6d5d616 (diff) |
camera switching via markers
Currently access by selecting a marking and binding with the active camera from the view menu.
Note:
after long discussion we decieded there is no nice way to do this.. animate pointers? animate multiple camera visibility?, use sequencer? use NLA?.... have a kind of event system (like framechange scriptlinks)... etc
so this is ifdef'd with DURIAN_CAMERA_SWITCH
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 41 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 6 |
2 files changed, 46 insertions, 1 deletions
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 640a14a934b..9c581527e4c 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1670,6 +1670,47 @@ void ED_update_for_newframe(const bContext *C, int mute) bScreen *screen= CTX_wm_screen(C); Scene *scene= CTX_data_scene(C); +#ifdef DURIAN_CAMERA_SWITCH + void *camera= scene_find_camera_switch(scene); + if(camera && scene->camera != camera) { + + if(camera && scene->camera && (camera != scene->camera)) { + bScreen *sc; + /* are there cameras in the views that are not in the scene? */ + for(sc= CTX_data_main(C)->screen.first; sc; sc= sc->id.next) { + ScrArea *sa= sc->areabase.first; + while(sa) { + SpaceLink *sl= sa->spacedata.first; + while(sl) { + if(sl->spacetype==SPACE_VIEW3D) { + View3D *v3d= (View3D*) sl; + if (v3d->camera == scene->camera) { + v3d->camera= camera; + /* + 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; + } + } + */ + } + } + sl= sl->next; + } + sa= sa->next; + } + } + } + + scene->camera= camera; + + } +#endif + //extern void audiostream_scrub(unsigned int frame); /* seqaudio.c */ /* this function applies the changes too */ diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index fe2bc58faf2..7227c13d374 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2339,6 +2339,9 @@ static int screen_animation_step(bContext *C, wmOperator *op, wmEvent *event) ScreenAnimData *sad= wt->customdata; ScrArea *sa; int sync; +#ifdef DURIAN_CAMERA_SWITCH + Object *camera_orig= scene->camera; +#endif /* sync, don't sync, or follow scene setting */ if(sad->flag & ANIMPLAY_FLAG_SYNC) sync= 1; @@ -2397,10 +2400,11 @@ static int screen_animation_step(bContext *C, wmOperator *op, wmEvent *event) } /* since we follow drawflags, we can't send notifier but tag regions ourselves */ + ED_update_for_newframe(C, 1); sound_update_playing(C); - + for(sa= screen->areabase.first; sa; sa= sa->next) { ARegion *ar; for(ar= sa->regionbase.first; ar; ar= ar->next) { |