Fix T101210: invalid internal node links lead to crash

Internal links are run-time/derived data. Therefore it is not necessary
to load them from .blend files where invalid internal links may be stored.
They will be regenerated after a node tree is loaded anyway.
This commit is contained in:
Jacques Lucke 2022-10-24 19:00:27 +02:00
parent 63675b8d70
commit 5379587772
Notes: blender-bot 2023-02-14 01:57:12 +01:00
Referenced by issue #101210, Fail to open the file
1 changed files with 1 additions and 11 deletions

View File

@ -516,10 +516,6 @@ void ntreeBlendWrite(BlendWriter *writer, bNodeTree *ntree)
write_node_socket(writer, sock);
}
LISTBASE_FOREACH (bNodeLink *, link, &node->internal_links) {
BLO_write_struct(writer, bNodeLink, link);
}
if (node->storage) {
if (ELEM(ntree->type, NTREE_SHADER, NTREE_GEOMETRY) &&
ELEM(node->type, SH_NODE_CURVE_VEC, SH_NODE_CURVE_RGB, SH_NODE_CURVE_FLOAT)) {
@ -703,13 +699,7 @@ void ntreeBlendReadData(BlendDataReader *reader, ID *owner_id, bNodeTree *ntree)
BLO_read_data_address(reader, &node->prop);
IDP_BlendDataRead(reader, &node->prop);
BLO_read_list(reader, &node->internal_links);
LISTBASE_FOREACH (bNodeLink *, link, &node->internal_links) {
BLO_read_data_address(reader, &link->fromnode);
BLO_read_data_address(reader, &link->fromsock);
BLO_read_data_address(reader, &link->tonode);
BLO_read_data_address(reader, &link->tosock);
}
BLI_listbase_clear(&node->internal_links);
if (node->type == CMP_NODE_MOVIEDISTORTION) {
/* Do nothing, this is runtime cache and hence handled by generic code using