b210d56857
There is a fundamental issue when adding nodes from versioning code right now. Generally speaking, versioning code should not change after it has been written. If old versioning code suddenly changes its behavior, it can invalidate the versioning code that comes after it. The issue is that while the versioning code itself doesn't change, it is indirectly calling code that is changing and evolving all the time. This makes the versioning unreliable and makes it hard to do certain changes (e.g. changing which sockets a node has). It's easy to overlook issues this creates because many of these cases don't have regression tests. The solution is to keep the versioning code more independent from the part of Blender that is constantly evolving. More specifically, this means that when adding a node, this should not take the current node initialization and declaration code into account. Instead, the versioning code should just manually create the node with the sockets that it expects based on the version that the versioning code has been written for. This patch adds new `version_node_add_empty`, `version_node_add_socket` and `version_node_add_link` methods which allow creating nodes without calling ever evolving code. Pull Request: https://projects.blender.org/blender/blender/pulls/121664