Fix: mattes of cryptomatte node lost after write

Fix an issue introduced by {f4df036bc497} where the read/write
code missed to store and read the mattes from its new location.
This commit is contained in:
Jeroen Bakker 2020-12-15 11:15:01 +01:00
parent 12792ee70c
commit 35368e8bfc
Notes: blender-bot 2023-02-14 09:43:37 +01:00
Referenced by issue #83792, Crash when opening a file containing a cryptomatte node with a `matte_id`
1 changed files with 4 additions and 0 deletions

View File

@ -494,6 +494,9 @@ void ntreeBlendWrite(BlendWriter *writer, bNodeTree *ntree)
if (nc->matte_id) {
BLO_write_string(writer, nc->matte_id);
}
LISTBASE_FOREACH (CryptomatteEntry *, entry, &nc->entries) {
BLO_write_struct(writer, CryptomatteEntry, entry);
}
BLO_write_struct_by_name(writer, node->typeinfo->storagename, node->storage);
}
else if (node->typeinfo != &NodeTypeUndefined) {
@ -646,6 +649,7 @@ void ntreeBlendReadData(BlendDataReader *reader, bNodeTree *ntree)
case CMP_NODE_CRYPTOMATTE: {
NodeCryptomatte *nc = (NodeCryptomatte *)node->storage;
BLO_read_data_address(reader, &nc->matte_id);
BLO_read_list(reader, &nc->entries);
break;
}
case TEX_NODE_IMAGE: {