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/intern/versioning_280.c')
-rw-r--r--source/blender/blenloader/intern/versioning_280.c47
1 files changed, 26 insertions, 21 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 213fbe0bde0..0b7830c922a 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -93,11 +93,12 @@
#include "BKE_report.h"
#include "BKE_rigidbody.h"
#include "BKE_screen.h"
-#include "BKE_sequencer.h"
#include "BKE_studiolight.h"
#include "BKE_unit.h"
#include "BKE_workspace.h"
+#include "SEQ_sequencer.h"
+
/* Only for IMB_BlendMode */
#include "IMB_imbuf.h"
@@ -241,7 +242,7 @@ static void do_version_workspaces_after_lib_link(Main *bmain)
if (screen->temp) {
/* We do not generate a new workspace for those screens...
* still need to set some data in win. */
- win->workspace_hook = BKE_workspace_instance_hook_create(bmain);
+ win->workspace_hook = BKE_workspace_instance_hook_create(bmain, win->winid);
win->scene = screen->scene;
/* Deprecated from now on! */
win->screen = NULL;
@@ -254,10 +255,10 @@ static void do_version_workspaces_after_lib_link(Main *bmain)
WorkSpaceLayout *layout = BKE_workspace_layout_find(workspace, win->screen);
BLI_assert(layout != NULL);
- win->workspace_hook = BKE_workspace_instance_hook_create(bmain);
+ win->workspace_hook = BKE_workspace_instance_hook_create(bmain, win->winid);
BKE_workspace_active_set(win->workspace_hook, workspace);
- BKE_workspace_active_layout_set(win->workspace_hook, workspace, layout);
+ BKE_workspace_active_layout_set(win->workspace_hook, win->winid, workspace, layout);
/* Move scene and view layer to window. */
Scene *scene = screen->scene;
@@ -890,7 +891,7 @@ static void do_versions_material_convert_legacy_blend_mode(bNodeTree *ntree, cha
bNodeSocket *color_socket = nodeFindSocket(transp_node, SOCK_IN, "Color");
bNodeSocket *transp_socket = nodeFindSocket(transp_node, SOCK_OUT, "BSDF");
- /* If incomming link is from a closure socket, we need to convert it. */
+ /* If incoming link is from a closure socket, we need to convert it. */
if (fromsock->type == SOCK_SHADER) {
transp_node->locx = 0.33f * fromnode->locx + 0.66f * tonode->locx;
transp_node->locy = 0.33f * fromnode->locy + 0.66f * tonode->locy;
@@ -978,7 +979,7 @@ static void do_version_curvemapping_walker(Main *bmain, void (*callback)(CurveMa
}
}
- // toolsettings
+ /* toolsettings */
ToolSettings *ts = scene->toolsettings;
if (ts->vpaint) {
callback(ts->vpaint->paint.cavity_curve);
@@ -1201,7 +1202,7 @@ static void do_version_fcurve_hide_viewport_fix(struct ID *UNUSED(id),
struct FCurve *fcu,
void *UNUSED(user_data))
{
- if (!STREQ(fcu->rna_path, "hide")) {
+ if (fcu->rna_path == NULL || !STREQ(fcu->rna_path, "hide")) {
return;
}
@@ -1242,7 +1243,12 @@ void do_versions_after_linking_280(Main *bmain, ReportList *UNUSED(reports))
break;
}
}
- BLI_assert(collection_hidden != NULL);
+ if (collection_hidden == NULL) {
+ /* This should never happen (objects are always supposed to be instantiated in a
+ * scene), but it does sometimes, see e.g. T81168.
+ * Just put them in first hidden collection in those cases. */
+ collection_hidden = &hidden_collection_array[0];
+ }
if (*collection_hidden == NULL) {
char name[MAX_ID_NAME];
@@ -1660,7 +1666,7 @@ void do_versions_after_linking_280(Main *bmain, ReportList *UNUSED(reports))
BKE_mesh_tessface_clear(me);
/* Moved from do_versions because we need updated polygons for calculating normals. */
- if (MAIN_VERSION_OLDER(bmain, 256, 6)) {
+ if (!MAIN_VERSION_ATLEAST(bmain, 256, 6)) {
BKE_mesh_calc_normals(me);
}
}
@@ -1742,7 +1748,7 @@ void do_versions_after_linking_280(Main *bmain, ReportList *UNUSED(reports))
*
* \note Be sure to check when bumping the version:
* - #blo_do_versions_280 in this file.
- * - "versioning_userdef.c", #BLO_version_defaults_userpref_blend
+ * - "versioning_userdef.c", #blo_do_versions_userdef
* - "versioning_userdef.c", #do_versions_theme
*
* \note Keep this message at the bottom of the function.
@@ -2094,7 +2100,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
if (!MAIN_VERSION_ATLEAST(bmain, 280, 8)) {
/* Blender Internal removal */
for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) {
- if (STREQ(scene->r.engine, "BLENDER_RENDER") || STREQ(scene->r.engine, "BLENDER_GAME")) {
+ if (STR_ELEM(scene->r.engine, "BLENDER_RENDER", "BLENDER_GAME")) {
BLI_strncpy(scene->r.engine, RE_engine_id_BLENDER_EEVEE, sizeof(scene->r.engine));
}
@@ -2983,9 +2989,9 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
/* gpencil grid settings */
for (bGPdata *gpd = bmain->gpencils.first; gpd; gpd = gpd->id.next) {
- ARRAY_SET_ITEMS(gpd->grid.color, 0.5f, 0.5f, 0.5f); // Color
- ARRAY_SET_ITEMS(gpd->grid.scale, 1.0f, 1.0f); // Scale
- gpd->grid.lines = GP_DEFAULT_GRID_LINES; // Number of lines
+ ARRAY_SET_ITEMS(gpd->grid.color, 0.5f, 0.5f, 0.5f); /* Color */
+ ARRAY_SET_ITEMS(gpd->grid.scale, 1.0f, 1.0f); /* Scale */
+ gpd->grid.lines = GP_DEFAULT_GRID_LINES; /* Number of lines */
}
}
@@ -3414,7 +3420,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
case SPACE_OUTLINER: {
SpaceOutliner *space_outliner = (SpaceOutliner *)sl;
space_outliner->filter &= ~(SO_FILTER_UNUSED_1 | SO_FILTER_UNUSED_5 |
- SO_FILTER_UNUSED_12);
+ SO_FILTER_OB_STATE_SELECTABLE);
space_outliner->storeflag &= ~(SO_TREESTORE_UNUSED_1);
break;
}
@@ -3488,7 +3494,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) {
ob->flag &= ~(OB_FLAG_UNUSED_11 | OB_FLAG_UNUSED_12);
- ob->transflag &= ~(OB_TRANSFLAG_UNUSED_0 | OB_TRANSFLAG_UNUSED_1);
+ ob->transflag &= ~(OB_TRANSFORM_ADJUST_ROOT_PARENT_FOR_VIEW_LOCK | OB_TRANSFLAG_UNUSED_1);
ob->shapeflag &= ~OB_SHAPE_FLAG_UNUSED_1;
}
@@ -3657,8 +3663,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
- ob->transflag &= ~(OB_TRANSFLAG_UNUSED_0 | OB_TRANSFLAG_UNUSED_1 | OB_TRANSFLAG_UNUSED_3 |
- OB_TRANSFLAG_UNUSED_6 | OB_TRANSFLAG_UNUSED_12);
+ ob->transflag &= ~(OB_TRANSFORM_ADJUST_ROOT_PARENT_FOR_VIEW_LOCK | OB_TRANSFLAG_UNUSED_1 |
+ OB_TRANSFLAG_UNUSED_3 | OB_TRANSFLAG_UNUSED_6 | OB_TRANSFLAG_UNUSED_12);
ob->nlaflag &= ~(OB_ADS_UNUSED_1 | OB_ADS_UNUSED_2);
}
@@ -4073,8 +4079,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
if (STREQ(view_settings->view_transform, "Default")) {
STRNCPY(view_settings->view_transform, "Standard");
}
- else if (STREQ(view_settings->view_transform, "RRT") ||
- STREQ(view_settings->view_transform, "Film")) {
+ else if (STR_ELEM(view_settings->view_transform, "RRT", "Film")) {
STRNCPY(view_settings->view_transform, "Filmic");
}
else if (STREQ(view_settings->view_transform, "Log")) {
@@ -5087,7 +5092,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
*
* \note Be sure to check when bumping the version:
* - #do_versions_after_linking_280 in this file.
- * - "versioning_userdef.c", #BLO_version_defaults_userpref_blend
+ * - "versioning_userdef.c", #blo_do_versions_userdef
* - "versioning_userdef.c", #do_versions_theme
*
* \note Keep this message at the bottom of the function.