diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2019-09-09 12:11:16 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2019-09-09 16:19:12 +0300 |
commit | 5d9c01c53fd58c9f5b9b9ac32995bae865448b7b (patch) | |
tree | 63ee95f47407197d719c2c186f8e0e627530fb11 /source/blender/blenloader/intern/versioning_cycles.c | |
parent | f5e0dfe59c7e748907f955f848264751ed0967f0 (diff) |
Fix T69663: 2.81 Cant open/append/link a blend file but 2.8 can
Was a problem in the versioning code from rBbaaa89a0bc54, since the
TexMapping struct could already be freed and node->storage could already
be set to NULL (if a file with the new mapping node [saved from (2, 81,
8) or newer] is opened in a blender version prior to (2, 81, 8) and
saved from there again).
Reviewers: brecht
Maniphest Tasks: T69663
Differential Revision: https://developer.blender.org/D5723
Diffstat (limited to 'source/blender/blenloader/intern/versioning_cycles.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_cycles.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/versioning_cycles.c b/source/blender/blenloader/intern/versioning_cycles.c index 1abf099b4c2..d4d940daba5 100644 --- a/source/blender/blenloader/intern/versioning_cycles.c +++ b/source/blender/blenloader/intern/versioning_cycles.c @@ -797,7 +797,10 @@ static void update_mapping_node_inputs_and_properties(bNodeTree *ntree) bool need_update = false; for (bNode *node = ntree->nodes.first; node; node = node->next) { - if (node->type == SH_NODE_MAPPING) { + /* If node->storage is NULL, then conversion has already taken place. + * This can happen if a file with the new mapping node [saved from (2, 81, 8) or newer] + * is opened in a blender version prior to (2, 81, 8) and saved from there again. */ + if (node->type == SH_NODE_MAPPING && node->storage) { TexMapping *mapping = (TexMapping *)node->storage; node->custom1 = mapping->type; node->width = 140.0f; |