diff options
author | Jacques Lucke <jacques@blender.org> | 2021-11-15 17:52:58 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-11-15 17:52:58 +0300 |
commit | 62da41d63dd9fb131a3c7a1f339b49e6186b3300 (patch) | |
tree | 03e80caeeb103607ef353cdd00c05ec6a394b935 /source/blender/blenloader/intern | |
parent | a5c59fb90ef9c3e330556703c86e720740cf2c8d (diff) |
Fix: Incorrect socket identifier versioning
There were two issues:
- The third math node socket does not exist in old enough files.
- The comment incorrectly referred to the vector math node.
Differential Revision: https://developer.blender.org/D13219
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/versioning_300.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c index 6402bcc0b05..c0c3a8e4d4b 100644 --- a/source/blender/blenloader/intern/versioning_300.c +++ b/source/blender/blenloader/intern/versioning_300.c @@ -2158,8 +2158,8 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) * \note Keep this message at the bottom of the function. */ { - /* Use consistent socket identifiers for the vector math node. - * Thecode to make unique identifiers from the names was inconsitent. */ + /* Use consistent socket identifiers for the math node. + * The code to make unique identifiers from the names was inconsistent. */ FOREACH_NODETREE_BEGIN (bmain, ntree, id) { if (ELEM(ntree->type, NTREE_SHADER, NTREE_GEOMETRY)) { LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { @@ -2167,7 +2167,11 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) bNodeSocket *value1 = ((bNodeSocket *)node->inputs.first)->next; bNodeSocket *value2 = value1->next; strcpy(value1->identifier, "Value_001"); - strcpy(value2->identifier, "Value_002"); + if (value2 != NULL) { + /* This can be null when file is quite old so that the socket did not exist + * (before 0406eb110332a8). */ + strcpy(value2->identifier, "Value_002"); + } } } } |