Fix versioning old 2.6 node groups, causing dangling link pointers #111704

Merged
Lukas Tönne merged 11 commits from LukasTonne/blender:fix-versioning-26-node-groups into main 2023-09-05 12:37:13 +02:00

11 Commits

Author SHA1 Message Date
Lukas Tönne f47109838e Merge branch 'main' into fix-versioning-26-node-groups
buildbot/vexp-code-patch-coordinator Build done. Details
2023-09-05 11:47:47 +02:00
Lukas Tönne cc23d2cd07 Merge branch 'main' into fix-versioning-26-node-groups 2023-09-04 17:23:38 +02:00
Lukas Tönne 58ea865f09 Added missing 'compact' flag for sockets.
buildbot/vexp-code-patch-coordinator Build done. Details
Also fixed use of an incorrect flag for interface sockets.
2023-09-04 16:27:38 +02:00
Lukas Tönne bad7e18689 Initialize socket typeinfo before node typeinfo.
Creating nodes relies on socket typeinfo to be valid before node
typeinfo itself.
2023-09-04 16:25:52 +02:00
Lukas Tönne 4f84995bca Use warning instead of error for modifier issues to avoid test crash.
CLOG_ERROR aborts in debug mode, which makes all tests fail (in this
case because a nodes modifier does not have a geometry output, which
should just disable it).
2023-09-04 16:23:54 +02:00
Lukas Tönne 57b17483e8 Removed invalid nodeUniqueName calls.
This function is supposed to only be called once, or the tree topology
will fail on assert. node names are made unique later on already.
2023-09-04 16:22:16 +02:00
Lukas Tönne bf3c7aedc0 Removed old 2.5 after_linking code that is already broken.
2.5 versioning would require an after_linking step to construct correct
socket identifiers of node groups, which would preserve links to and
from the group. This has been broken for a long time and cannot be
easily restored. The code is not running anyway because it depends on
outdated bNodeLink format, so its better to just remove entirely.
2023-09-04 16:20:25 +02:00
Lukas Tönne cd1522f184 Merge branch 'main' into fix-versioning-26-node-groups 2023-09-04 09:45:15 +02:00
Lukas Tönne be0a597b32 Merge branch 'main' into fix-versioning-26-node-groups 2023-09-01 11:29:41 +02:00
Lukas Tönne 1b259a2045 Merge branch 'main' into fix-versioning-26-node-groups 2023-08-30 17:38:44 +02:00
Lukas Tönne a0cb03b5d3 Fix for versioning old 2.6 node groups, causing dangling link pointers.
In 2.6 the old method of using bNodeSocket lists in bNodeTree directly
as group sockets was replaced with new group input/output nodes. This
required versioning to create those input/output nodes and then redirect
links to the new node sockets. Because creating nodes relies heavily on
node typeinfo this versioning was done in the `_after_linking` section
of the 2.6 versioning code, running after _all other versioning_
(including for much newer versions!) has already happended.

While typinfo is available at that point, doing such late versioning
causes severe problems when the data structure changes, as is the case
with the recent node panels patch (#111348). The new node group
interface also has versioning code for 4.0, but this runs _before_ the
`_after_linking` code for 2.6! Versioning for node panels expects
sockets in bNodeTree to not have any links pointing at them, but this is
not true for old 2.6 files which have not yet been fully versioned at
that point, because of the late versioning stage. Subsequently 2.6
`_after_linking` code crashes when trying to modify node links with
dangling pointers.

The solution here is to move the old versioning code out of the
`after_linking` stage to restore the expected versioning chain. This
requires creating nodes and node sockets without any typeinfo, but
luckily we only need to create simple known group input/output nodes
which don't have much complicated behavior.
2023-08-30 17:26:15 +02:00