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
This commit is contained in:
parent
f5e0dfe59c
commit
5d9c01c53f
Notes:
blender-bot
2023-02-14 10:11:49 +01:00
Referenced by issue #70279, crash, Helicopter, blender 2.74 demo file Referenced by issue #69663, 2.81 Cant open/append/link a blend file but 2.8 can
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue