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.
This commit is contained in:
Jacques Lucke 2021-09-06 17:21:27 +02:00
parent 861b7071a2
commit a3ca973dec
Notes: blender-bot 2023-02-13 17:46:48 +01:00
Referenced by issue #91240, Full copy of scene causes failed assertion '(id_iter->tag & LIB_TAG_NEW) == 0'
Referenced by issue #91165, Studio Sprite Fright Commits Log
1 changed files with 14 additions and 0 deletions

View File

@ -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