diff options
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/collection.c | 21 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/node.cc | 21 |
2 files changed, 28 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index dc04eb0dba3..41ec120519b 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -234,8 +234,13 @@ void BKE_collection_compat_blend_read_data(BlendDataReader *reader, SceneCollect void BKE_collection_blend_read_data(BlendDataReader *reader, Collection *collection, ID *owner_id) { /* Special case for this pointer, do not rely on regular `lib_link` process here. Avoids needs - * for do_versioning, and ensures coherence of data in any case. */ - BLI_assert((collection->id.flag & LIB_EMBEDDED_DATA) != 0 || owner_id == NULL); + * for do_versioning, and ensures coherence of data in any case. + * + * NOTE: Old versions are very often 'broken' here, just fix it silently in these cases. + */ + if (BLO_read_fileversion_get(reader) > 300) { + BLI_assert((collection->id.flag & LIB_EMBEDDED_DATA) != 0 || owner_id == NULL); + } BLI_assert(owner_id == NULL || owner_id->lib == collection->id.lib); if (owner_id != NULL && (collection->id.flag & LIB_EMBEDDED_DATA) == 0) { /* This is unfortunate, but currently a lot of existing files (including startup ones) have @@ -244,11 +249,13 @@ void BKE_collection_blend_read_data(BlendDataReader *reader, Collection *collect * NOTE: Using do_version is not a solution here, since this code will be called before any * do_version takes place. Keeping it here also ensures future (or unknown existing) similar * bugs won't go easily unnoticed. */ - CLOG_WARN(&LOG, - "Fixing root node tree '%s' owned by '%s' missing EMBEDDED tag, please consider " - "re-saving your (startup) file", - collection->id.name, - owner_id->name); + if (BLO_read_fileversion_get(reader) > 300) { + CLOG_WARN(&LOG, + "Fixing root node tree '%s' owned by '%s' missing EMBEDDED tag, please consider " + "re-saving your (startup) file", + collection->id.name, + owner_id->name); + } collection->id.flag |= LIB_EMBEDDED_DATA; } collection->owner_id = owner_id; diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc index a78257a250b..fadcceae393 100644 --- a/source/blender/blenkernel/intern/node.cc +++ b/source/blender/blenkernel/intern/node.cc @@ -652,8 +652,13 @@ static void direct_link_node_socket(BlendDataReader *reader, bNodeSocket *sock) void ntreeBlendReadData(BlendDataReader *reader, ID *owner_id, bNodeTree *ntree) { /* Special case for this pointer, do not rely on regular `lib_link` process here. Avoids needs - * for do_versioning, and ensures coherence of data in any case. */ - BLI_assert((ntree->id.flag & LIB_EMBEDDED_DATA) != 0 || owner_id == nullptr); + * for do_versioning, and ensures coherence of data in any case. + * + * NOTE: Old versions are very often 'broken' here, just fix it silently in these cases. + */ + if (BLO_read_fileversion_get(reader) > 300) { + BLI_assert((ntree->id.flag & LIB_EMBEDDED_DATA) != 0 || owner_id == nullptr); + } BLI_assert(owner_id == NULL || owner_id->lib == ntree->id.lib); if (owner_id != nullptr && (ntree->id.flag & LIB_EMBEDDED_DATA) == 0) { /* This is unfortunate, but currently a lot of existing files (including startup ones) have @@ -662,11 +667,13 @@ void ntreeBlendReadData(BlendDataReader *reader, ID *owner_id, bNodeTree *ntree) * NOTE: Using do_version is not a solution here, since this code will be called before any * do_version takes place. Keeping it here also ensures future (or unknown existing) similar * bugs won't go easily unnoticed. */ - CLOG_WARN(&LOG, - "Fixing root node tree '%s' owned by '%s' missing EMBEDDED tag, please consider " - "re-saving your (startup) file", - ntree->id.name, - owner_id->name); + if (BLO_read_fileversion_get(reader) > 300) { + CLOG_WARN(&LOG, + "Fixing root node tree '%s' owned by '%s' missing EMBEDDED tag, please consider " + "re-saving your (startup) file", + ntree->id.name, + owner_id->name); + } ntree->id.flag |= LIB_EMBEDDED_DATA; } ntree->owner_id = owner_id; |