Depsgraph: fix crash caused by removing too many NO-OP nodes

Unused no-op operation nodes are not bound to a callback function, and
have no outgoing relations. Incoming relations of such nodes are removed
since ff60dd8b18. However, this was done
too broadly, causing too many relations to be lost and indirectly linked
objects to be unevaluated.

This commit introduces a `DEPSOP_FLAG_FAKE_USER` flag for operation
nodes, which indicates they are not to be removed, even when they appear
to be unused.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7074
This commit is contained in:
2020-03-09 16:05:06 +01:00
parent 93f6369573
commit dcb9312687
6 changed files with 27 additions and 5 deletions

View File

@@ -210,6 +210,10 @@ enum OperationFlag {
DEPSOP_FLAG_DIRECTLY_MODIFIED = (1 << 1),
/* Node was updated due to user input. */
DEPSOP_FLAG_USER_MODIFIED = (1 << 2),
/* Node may not be removed, even when it has no evaluation callback and no
* outgoing relations. This is for NO-OP nodes that are purely used to indicate a
* relation between components/IDs, and not for connecting to an operation. */
DEPSOP_FLAG_PINNED = (1 << 3),
/* Set of flags which gets flushed along the relations. */
DEPSOP_FLAG_FLUSH = (DEPSOP_FLAG_USER_MODIFIED),