[Bf-blender-cvs] [1931878f574] temp-field-visualization: initial changes

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


Commit: 1931878f574b220575390432e4a4069ac63be054
Author: Jacques Lucke
Date:   Wed Sep 15 11:33:00 2021 +0200
Branches: temp-field-visualization
https://developer.blender.org/rB1931878f574b220575390432e4a4069ac63be054

initial changes

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

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

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

diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc
index 61b90b44b03..4d33544777b 100644
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@ -4465,6 +4465,11 @@ void ntreeUpdateAllUsers(Main *main, ID *id)
   }
 }
 
+static void update_socket_shapes_for_fields(bNodeTree &ntree)
+{
+  UNUSED_VARS(ntree);
+}
+
 void ntreeUpdateTree(Main *bmain, bNodeTree *ntree)
 {
   if (!ntree) {
@@ -4516,6 +4521,8 @@ void ntreeUpdateTree(Main *bmain, bNodeTree *ntree)
     /* update the node level from link dependencies */
     ntree_update_node_level(ntree);
 
+    update_socket_shapes_for_fields(*ntree);
+
     /* check link validity */
     ntree_validate_links(ntree);
   }
diff --git a/source/blender/nodes/NOD_node_declaration.hh b/source/blender/nodes/NOD_node_declaration.hh
index 7ba4ac52b86..235ba5efa6d 100644
--- a/source/blender/nodes/NOD_node_declaration.hh
+++ b/source/blender/nodes/NOD_node_declaration.hh
@@ -31,6 +31,7 @@ class SocketDeclaration {
  protected:
   std::string name_;
   std::string identifier_;
+  bool is_field_ = false;
 
   friend NodeDeclarationBuilder;
 
diff --git a/source/blender/nodes/NOD_socket_declarations.hh b/source/blender/nodes/NOD_socket_declarations.hh
index 11352111356..d550c3e3723 100644
--- a/source/blender/nodes/NOD_socket_declarations.hh
+++ b/source/blender/nodes/NOD_socket_declarations.hh
@@ -131,6 +131,12 @@ class Vector : public SocketDeclaration {
     return *this;
   }
 
+  Vector &is_field(bool value)
+  {
+    is_field_ = value;
+    return *this;
+  }
+
   bNodeSocket &build(bNodeTree &ntree, bNode &node, eNodeSocketInOut in_out) const override;
   bool matches(const bNodeSocket &socket) const override;
   bNodeSocket &update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const override;
@@ -147,6 +153,12 @@ class Bool : public SocketDeclaration {
     return *this;
   }
 
+  Bool &is_field(bool value)
+  {
+    is_field_ = value;
+    return *this;
+  }
+
   bNodeSocket &build(bNodeTree &ntree, bNode &node, eNodeSocketInOut in_out) const override;
   bool matches(const bNodeSocket &socket) const override;
 };
diff --git a/source/blender/nodes/geometry/nodes/node_geo_set_position.cc b/source/blender/nodes/geometry/nodes/node_geo_set_position.cc
index e8591616f55..9750a94c3f3 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_set_position.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_set_position.cc
@@ -23,8 +23,8 @@ namespace blender::nodes {
 static void geo_node_set_position_declare(NodeDeclarationBuilder &b)
 {
   b.add_input<decl::Geometry>("Geometry");
-  b.add_input<decl::Vector>("Position");
-  b.add_input<decl::Bool>("Selection").default_value(true);
+  b.add_input<decl::Vector>("Position").is_field(true);
+  b.add_input<decl::Bool>("Selection").default_value(true).is_field(true);
   b.add_output<decl::Geometry>("Geometry");
 }



More information about the Bf-blender-cvs mailing list