diff options
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/include/ED_view3d.h | 2 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 17 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_header.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_view.c | 54 |
4 files changed, 3 insertions, 72 deletions
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 7f90575acc0..9e279044962 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -153,8 +153,6 @@ struct RegionView3D *ED_view3d_context_rv3d(struct bContext *C); void ED_view3d_init_mats_rv3d(struct Object *ob, struct RegionView3D *rv3d); -void ED_view3d_scene_layers_copy(struct View3D *v3d, struct Scene *scene); -void ED_view3d_scene_layers_update(struct Main *bmain, struct Scene *scene); int ED_view3d_scene_layer_set(int lay, const int *values); int ED_view3d_context_activate(struct bContext *C); diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index d8531d0b4e9..448144471a9 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1395,7 +1395,7 @@ void ED_screen_set_scene(bContext *C, Scene *scene) if(sl->spacetype==SPACE_VIEW3D) { View3D *v3d= (View3D*) sl; - ED_view3d_scene_layers_copy(v3d, scene); + BKE_screen_view3d_sync(v3d, scene); if (!v3d->camera || !object_in_scene(v3d->camera, scene)) { v3d->camera= scene_find_camera(sc->scene); @@ -1729,20 +1729,7 @@ void ED_update_for_newframe(const bContext *C, int mute) 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->scenelock) { - v3d->camera= camera; - } - } - sl= sl->next; - } - sa= sa->next; - } + BKE_screen_view3d_scene_sync(sc); } } diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 535b5695182..82744527dce 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -141,7 +141,7 @@ static void handle_view3d_lock(bContext *C) /* not through notifiery, listener don't have context and non-open screens or spaces need to be updated too */ - ED_view3d_scene_layers_update(bmain, scene); + BKE_screen_view3d_main_sync(&bmain->screen, scene); /* notifiers for scene update */ WM_event_add_notifier(C, NC_SCENE|ND_LAYER, scene); diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index e9599089419..02ef62b22d3 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1385,60 +1385,6 @@ static unsigned int free_localbit(void) return 0; } -static void copy_view3d_lock_space(View3D *v3d, Scene *scene) -{ - int bit; - - if(v3d->scenelock && v3d->localvd==NULL) { - v3d->lay= scene->lay; - v3d->camera= scene->camera; - - 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((v3d->lay & v3d->layact) == 0) { - for(bit= 0; bit<32; bit++) { - if(v3d->lay & (1<<bit)) { - v3d->layact= 1<<bit; - break; - } - } - } - } -} - -void ED_view3d_scene_layers_copy(struct View3D *v3d, struct Scene *scene) -{ - copy_view3d_lock_space(v3d, scene); -} - -void ED_view3d_scene_layers_update(Main *bmain, Scene *scene) -{ - bScreen *sc; - ScrArea *sa; - SpaceLink *sl; - - /* from scene copy to the other views */ - for(sc=bmain->screen.first; sc; sc=sc->id.next) { - if(sc->scene!=scene) - continue; - - for(sa=sc->areabase.first; sa; sa=sa->next) - for(sl=sa->spacedata.first; sl; sl=sl->next) - if(sl->spacetype==SPACE_VIEW3D) - copy_view3d_lock_space((View3D*)sl, scene); - } -} - int ED_view3d_scene_layer_set(int lay, const int *values) { int i, tot= 0; |