[Bf-blender-cvs] [5d9c01c53fd] master: Fix T69663: 2.81 Cant open/append/link a blend file but 2.8 can
Philipp Oeser
noreply at git.blender.org
Mon Sep 9 15:21:16 CEST 2019
Commit: 5d9c01c53fd58c9f5b9b9ac32995bae865448b7b
Author: Philipp Oeser
Date: Mon Sep 9 11:11:16 2019 +0200
Branches: master
https://developer.blender.org/rB5d9c01c53fd58c9f5b9b9ac32995bae865448b7b
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
===================================================================
M source/blender/blenloader/intern/versioning_cycles.c
===================================================================
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;
More information about the Bf-blender-cvs
mailing list