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:
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.cc23
-rw-r--r--source/blender/blenloader/intern/versioning_280.c2
-rw-r--r--source/blender/blenloader/intern/versioning_300.cc13
3 files changed, 29 insertions, 9 deletions
diff --git a/source/blender/blenloader/intern/readfile.cc b/source/blender/blenloader/intern/readfile.cc
index 7c07d373999..d627a93526e 100644
--- a/source/blender/blenloader/intern/readfile.cc
+++ b/source/blender/blenloader/intern/readfile.cc
@@ -2515,6 +2515,17 @@ static void lib_link_window_scene_data_restore(wmWindow *win, Scene *scene, View
}
}
+static void lib_link_restore_viewer_path(struct IDNameLib_Map *id_map, ViewerPath *viewer_path)
+{
+ LISTBASE_FOREACH (ViewerPathElem *, elem, &viewer_path->path) {
+ if (elem->type == VIEWER_PATH_ELEM_TYPE_ID) {
+ auto typed_elem = reinterpret_cast<IDViewerPathElem *>(elem);
+ typed_elem->id = static_cast<ID *>(
+ restore_pointer_by_name(id_map, (ID *)typed_elem->id, USER_IGNORE));
+ }
+ }
+}
+
static void lib_link_workspace_layout_restore(struct IDNameLib_Map *id_map,
Main *newmain,
WorkSpaceLayout *layout)
@@ -2532,6 +2543,8 @@ static void lib_link_workspace_layout_restore(struct IDNameLib_Map *id_map,
restore_pointer_by_name(id_map, (ID *)v3d->camera, USER_REAL));
v3d->ob_center = static_cast<Object *>(
restore_pointer_by_name(id_map, (ID *)v3d->ob_center, USER_REAL));
+
+ lib_link_restore_viewer_path(id_map, &v3d->viewer_path);
}
else if (sl->spacetype == SPACE_GRAPH) {
SpaceGraph *sipo = (SpaceGraph *)sl;
@@ -2741,14 +2754,7 @@ static void lib_link_workspace_layout_restore(struct IDNameLib_Map *id_map,
}
else if (sl->spacetype == SPACE_SPREADSHEET) {
SpaceSpreadsheet *sspreadsheet = (SpaceSpreadsheet *)sl;
-
- LISTBASE_FOREACH (SpreadsheetContext *, context, &sspreadsheet->context_path) {
- if (context->type == SPREADSHEET_CONTEXT_OBJECT) {
- SpreadsheetContextObject *object_context = (SpreadsheetContextObject *)context;
- object_context->object = static_cast<Object *>(
- restore_pointer_by_name(id_map, (ID *)object_context->object, USER_IGNORE));
- }
- }
+ lib_link_restore_viewer_path(id_map, &sspreadsheet->viewer_path);
}
}
}
@@ -2770,6 +2776,7 @@ void blo_lib_link_restore(Main *oldmain,
}
workspace->pin_scene = static_cast<Scene *>(
restore_pointer_by_name(id_map, (ID *)workspace->pin_scene, USER_IGNORE));
+ lib_link_restore_viewer_path(id_map, &workspace->viewer_path);
}
LISTBASE_FOREACH (wmWindow *, win, &curwm->windows) {
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 5cbfcb66bf9..3e26516cd69 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -3385,7 +3385,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
View3D *v3d = (View3D *)sl;
v3d->flag &= ~(V3D_LOCAL_COLLECTIONS | V3D_FLAG_UNUSED_1 | V3D_FLAG_UNUSED_10 |
V3D_FLAG_UNUSED_12);
- v3d->flag2 &= ~(V3D_FLAG2_UNUSED_3 | V3D_FLAG2_UNUSED_6 | V3D_FLAG2_UNUSED_12 |
+ v3d->flag2 &= ~((1 << 3) | V3D_FLAG2_UNUSED_6 | V3D_FLAG2_UNUSED_12 |
V3D_FLAG2_UNUSED_13 | V3D_FLAG2_UNUSED_14 | V3D_FLAG2_UNUSED_15);
break;
}
diff --git a/source/blender/blenloader/intern/versioning_300.cc b/source/blender/blenloader/intern/versioning_300.cc
index f0ebc6c7942..11c88a5d69b 100644
--- a/source/blender/blenloader/intern/versioning_300.cc
+++ b/source/blender/blenloader/intern/versioning_300.cc
@@ -3586,5 +3586,18 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
*/
{
/* Keep this block, even when empty. */
+
+ LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) {
+ LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
+ LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) {
+ if (sl->spacetype == SPACE_VIEW3D) {
+ View3D *v3d = (View3D *)sl;
+ v3d->flag2 |= V3D_SHOW_VIEWER;
+ v3d->overlay.flag |= V3D_OVERLAY_VIEWER_ATTRIBUTE;
+ v3d->overlay.viewer_attribute_opacity = 0.8f;
+ }
+ }
+ }
+ }
}
}