diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-11-25 14:50:34 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-11-25 14:50:34 +0300 |
commit | 4c3ed98ca27667c3403361199096e31eaa93cce2 (patch) | |
tree | 653c568d9d0547f7ac4beb847a590912d97102c0 /source/blender/blenloader | |
parent | e60c49ecf06815039137c98f86a7198d6ee81e14 (diff) |
Local View
Bring back per-viewport localview. This is based on Blender 2.79.
We have a limit of 16 different local view viewports.
We are using both the numpad /, as well as the regular /.
Missing features:
* Hack to make sure lights are always visible.
* Make rendered mode with external engines to support this as well
(probably just need to support this in the RNA iterators).
* Support over 16 viewports by taking existing viewports out of local view.
The code can use a cleanup pass in the future to unify the test to see
if an object is visible (or we can use TESTBASE in more places).
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index d44eda49151..b5e2f0146dd 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7406,25 +7406,21 @@ static void lib_link_window_scene_data_restore(wmWindow *win, Scene *scene) } if (v3d->localvd) { - /*Base *base;*/ + Base *base; v3d->localvd->camera = scene->camera; - /* localview can become invalid during undo/redo steps, so we exit it when no could be found */ -#if 0 /* XXX regionlocalview ? */ - for (base= sc->scene->base.first; base; base= base->next) { - if (base->lay & v3d->lay) break; + /* Localview can become invalid during undo/redo steps, so we exit it when no could be found. */ + for (base = screen->scene->base.first; base; base = base->next) { + if (base->local_view_bits & v3d->local_view_uuid) { + break; + } } - if (base==NULL) { - v3d->lay= v3d->localvd->lay; - v3d->layact= v3d->localvd->layact; + if (base == NULL) { MEM_freeN(v3d->localvd); - v3d->localvd= NULL; + v3d->localvd = NULL; + v3d->local_view_uuid = 0; } -#endif - } - else if (v3d->scenelock) { - v3d->lay = scene->lay; } } } @@ -7446,9 +7442,6 @@ static void lib_link_workspace_layout_restore(struct IDNameLib_Map *id_map, Main v3d->camera = restore_pointer_by_name(id_map, (ID *)v3d->camera, USER_REAL); v3d->ob_centre = restore_pointer_by_name(id_map, (ID *)v3d->ob_centre, USER_REAL); - /* not very nice, but could help */ - if ((v3d->layact & v3d->lay) == 0) v3d->layact = v3d->lay; - /* free render engines for now */ for (ar = sa->regionbase.first; ar; ar = ar->next) { if (ar->regiontype == RGN_TYPE_WINDOW) { |