From 9792994311d6268da52208e77d26a1a86c024534 Mon Sep 17 00:00:00 2001 From: Aaron Carlisle Date: Mon, 6 Dec 2021 13:39:19 -0500 Subject: Nodes: Add function to set compact socket flag for vectors This flag is currently only used for vector sockets so the function is limited to the vector builder. The flag is only used by two shader nodes at the moment and this is needed to port them over to the new socket declaration API. Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D13490 --- source/blender/nodes/intern/node_declaration.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/nodes/intern') diff --git a/source/blender/nodes/intern/node_declaration.cc b/source/blender/nodes/intern/node_declaration.cc index e804d10ad75..7a19acd2510 100644 --- a/source/blender/nodes/intern/node_declaration.cc +++ b/source/blender/nodes/intern/node_declaration.cc @@ -56,6 +56,7 @@ bNodeSocket &SocketDeclaration::update_or_build(bNodeTree &ntree, void SocketDeclaration::set_common_flags(bNodeSocket &socket) const { + SET_FLAG_FROM_TEST(socket.flag, compact_, SOCK_COMPACT); SET_FLAG_FROM_TEST(socket.flag, hide_value_, SOCK_HIDE_VALUE); SET_FLAG_FROM_TEST(socket.flag, hide_label_, SOCK_HIDE_LABEL); SET_FLAG_FROM_TEST(socket.flag, is_multi_input_, SOCK_MULTI_INPUT); @@ -70,6 +71,9 @@ bool SocketDeclaration::matches_common_data(const bNodeSocket &socket) const if (socket.identifier != identifier_) { return false; } + if (((socket.flag & SOCK_COMPACT) != 0) != compact_) { + return false; + } if (((socket.flag & SOCK_HIDE_VALUE) != 0) != hide_value_) { return false; } -- cgit v1.2.3