[Bf-blender-cvs] [234de0bf717] temp-field-visualization: cleanup

Jacques Lucke noreply at git.blender.org
Fri Sep 17 12:26:55 CEST 2021


Commit: 234de0bf7176a4404f55a6eeb38456b6b16688e1
Author: Jacques Lucke
Date:   Wed Sep 15 16:30:29 2021 +0200
Branches: temp-field-visualization
https://developer.blender.org/rB234de0bf7176a4404f55a6eeb38456b6b16688e1

cleanup

===================================================================

M	source/blender/blenkernel/intern/node.cc
M	source/blender/nodes/NOD_node_declaration.hh

===================================================================

diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc
index 5f8e7cb6d04..150b0a99a1f 100644
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@ -4480,7 +4480,7 @@ static void update_socket_shapes_for_fields(bNodeTree &ntree)
     int input_index;
     LISTBASE_FOREACH_INDEX (bNodeSocket *, socket, &node->inputs, input_index) {
       const SocketDeclaration &socket_decl = *declaration->inputs()[input_index];
-      bool is_field = socket_decl.get_is_field();
+      bool is_field = socket_decl.is_field();
       if (is_field) {
         socket->display_shape = SOCK_DISPLAY_SHAPE_DIAMOND;
       }
diff --git a/source/blender/nodes/NOD_node_declaration.hh b/source/blender/nodes/NOD_node_declaration.hh
index 8ca2b411a38..5062902e065 100644
--- a/source/blender/nodes/NOD_node_declaration.hh
+++ b/source/blender/nodes/NOD_node_declaration.hh
@@ -37,6 +37,7 @@ class SocketDeclaration {
   bool hide_label_ = false;
   bool hide_value_ = false;
   bool is_multi_input_ = false;
+  bool is_field_ = false;
 
   friend NodeDeclarationBuilder;
   template<typename SocketDecl> friend class SocketDeclarationBuilder;
@@ -51,6 +52,8 @@ class SocketDeclaration {
   StringRefNull name() const;
   StringRefNull identifier() const;
 
+  bool is_field() const;
+
  protected:
   void set_common_flags(bNodeSocket &socket) const;
   bool matches_common_data(const bNodeSocket &socket) const;
@@ -93,6 +96,12 @@ class SocketDeclarationBuilder : public BaseSocketDeclarationBuilder {
     decl_->is_multi_input_ = value;
     return *(Self *)this;
   }
+
+  Self &is_field(bool value)
+  {
+    decl_->is_field_ = value;
+    return *(Self *)this;
+  }
 };
 
 using SocketDeclarationPtr = std::unique_ptr<SocketDeclaration>;
@@ -148,6 +157,11 @@ inline StringRefNull SocketDeclaration::identifier() const
   return identifier_;
 }
 
+inline bool SocketDeclaration::is_field() const
+{
+  return is_field_;
+}
+
 /* --------------------------------------------------------------------
  * NodeDeclarationBuilder inline methods.
  */



More information about the Bf-blender-cvs mailing list