Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-09-06 18:21:27 +0300
committerJacques Lucke <jacques@blender.org>2021-09-06 18:21:42 +0300
commita3ca973dec752687dbbf5c3b24b51404ddfdf614 (patch)
treeff551185ca2791e1d552d4f48e8572d57850aa91 /source/blender/nodes/NOD_socket_declarations.hh
parent861b7071a24be8ef052570b11c044ad0f8df7f3f (diff)
Nodes: fix incorrect id socket update
The issue was that the entire socket was rebuild, even though only its `SOCK_HIDE_LABEL` flag changed. This broke e.g. Object sockets from old files.
Diffstat (limited to 'source/blender/nodes/NOD_socket_declarations.hh')
-rw-r--r--source/blender/nodes/NOD_socket_declarations.hh14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/nodes/NOD_socket_declarations.hh b/source/blender/nodes/NOD_socket_declarations.hh
index 639d2c12d73..1a5873c37b5 100644
--- a/source/blender/nodes/NOD_socket_declarations.hh
+++ b/source/blender/nodes/NOD_socket_declarations.hh
@@ -199,6 +199,20 @@ template<typename Subtype> class IDSocketDeclaration : public SocketDeclaration
{
return matches_id_socket(socket, data_, name_, identifier_);
}
+
+ bNodeSocket &update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override
+ {
+ if (StringRef(socket.idname) != data_.idname) {
+ return this->build(ntree, node, (eNodeSocketInOut)socket.in_out);
+ }
+ if (data_.hide_label) {
+ socket.flag |= SOCK_HIDE_LABEL;
+ }
+ else {
+ socket.flag &= ~SOCK_HIDE_LABEL;
+ }
+ return socket;
+ }
};
} // namespace detail