Fix #113532: geometry nodes is always reevaluated after undo

The issue was that the undo system detected that node trees have been changed
even though they have not. This is because the memory dump of the node tree
changed after unrelated changes. The root issue was that
`bNodeTreeInterface::write` also wrote the struct, and the pointer of the
`bNodeTreeInterface` itself. While this pointer is generally stable, it is not
during file-write, because when IDs are written, a shallow copy is created
first (see `BLO_write_init_id_buffer_from_id`). The temporary buffer for this
shallow copy is allocated on the heap, so its pointer may change over time.

The fix is to simply not write the `bNodeTreeInterface` separately, since it's
already embedded in `bNodeTree`.

Pull Request: https://projects.blender.org/blender/blender/pulls/114322
This commit is contained in:
Jacques Lucke 2023-10-31 13:46:31 +01:00
parent 245da40f81
commit c29857fffa
1 changed files with 0 additions and 1 deletions

View File

@ -1096,7 +1096,6 @@ void bNodeTreeInterface::free_data()
void bNodeTreeInterface::write(BlendWriter *writer)
{
BLO_write_struct(writer, bNodeTreeInterface, this);
/* Don't write the root panel struct itself, it's nested in the interface struct. */
item_types::item_write_data(writer, this->root_panel.item);
}