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:
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/NOD_node_declaration.hh1
-rw-r--r--source/blender/nodes/NOD_socket_declarations.hh7
-rw-r--r--source/blender/nodes/intern/node_declaration.cc4
3 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/nodes/NOD_node_declaration.hh b/source/blender/nodes/NOD_node_declaration.hh
index 9b99026d6a7..cccaf93a7d7 100644
--- a/source/blender/nodes/NOD_node_declaration.hh
+++ b/source/blender/nodes/NOD_node_declaration.hh
@@ -86,6 +86,7 @@ class SocketDeclaration {
std::string description_;
bool hide_label_ = false;
bool hide_value_ = false;
+ bool compact_ = false;
bool is_multi_input_ = false;
bool no_mute_links_ = false;
bool is_attribute_name_ = false;
diff --git a/source/blender/nodes/NOD_socket_declarations.hh b/source/blender/nodes/NOD_socket_declarations.hh
index 7284accd1ec..98c8fa68876 100644
--- a/source/blender/nodes/NOD_socket_declarations.hh
+++ b/source/blender/nodes/NOD_socket_declarations.hh
@@ -104,6 +104,7 @@ class VectorBuilder : public SocketDeclarationBuilder<Vector> {
VectorBuilder &subtype(PropertySubType subtype);
VectorBuilder &min(const float min);
VectorBuilder &max(const float max);
+ VectorBuilder &compact();
};
class BoolBuilder;
@@ -315,6 +316,12 @@ inline VectorBuilder &VectorBuilder::max(const float max)
return *this;
}
+inline VectorBuilder &VectorBuilder::compact()
+{
+ decl_->compact_ = true;
+ return *this;
+}
+
/** \} */
/* -------------------------------------------------------------------- */
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;
}