[Bf-blender-cvs] [c4c195672dd] master: Cleanup: remove unexposed nodes

Jacques Lucke noreply at git.blender.org
Mon Mar 22 12:24:06 CET 2021


Commit: c4c195672ddd5ab4ce912a3568974135a960f782
Author: Jacques Lucke
Date:   Mon Mar 22 12:23:25 2021 +0100
Branches: master
https://developer.blender.org/rBc4c195672ddd5ab4ce912a3568974135a960f782

Cleanup: remove unexposed nodes

Those nodes are leftovers from my work on particle nodes and are not needed currently.
They can be added back easily if they become necessary.

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

M	release/scripts/startup/nodeitems_builtins.py
M	source/blender/blenkernel/BKE_node.h
M	source/blender/blenkernel/intern/node.cc
M	source/blender/makesrna/intern/rna_nodetree.c
M	source/blender/nodes/CMakeLists.txt
M	source/blender/nodes/NOD_function.h
M	source/blender/nodes/NOD_static_types.h
D	source/blender/nodes/function/nodes/node_fn_combine_strings.cc
D	source/blender/nodes/function/nodes/node_fn_group_instance_id.cc
D	source/blender/nodes/function/nodes/node_fn_object_transforms.cc
D	source/blender/nodes/function/nodes/node_fn_switch.cc

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

diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py
index 6e1397ff971..d9c107bef63 100644
--- a/release/scripts/startup/nodeitems_builtins.py
+++ b/release/scripts/startup/nodeitems_builtins.py
@@ -562,8 +562,6 @@ geometry_node_categories = [
         NodeItem("NodeFrame"),
         NodeItem("NodeReroute"),
     ]),
-    # NodeItem("FunctionNodeCombineStrings"),
-    # NodeItem("FunctionNodeGroupInstanceID"),
 ]
 
 
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index 013c90197b2..71f188a2de1 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -1402,11 +1402,7 @@ int ntreeTexExecTree(struct bNodeTree *ntree,
  * \{ */
 
 #define FN_NODE_BOOLEAN_MATH 1200
-#define FN_NODE_SWITCH 1201
 #define FN_NODE_FLOAT_COMPARE 1202
-#define FN_NODE_GROUP_INSTANCE_ID 1203
-#define FN_NODE_COMBINE_STRINGS 1204
-#define FN_NODE_OBJECT_TRANSFORMS 1205
 #define FN_NODE_RANDOM_FLOAT 1206
 #define FN_NODE_INPUT_VECTOR 1207
 #define FN_NODE_INPUT_STRING 1208
diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc
index 5041f914ef9..ea8d0b5415c 100644
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@ -4947,14 +4947,10 @@ static void registerGeometryNodes()
 static void registerFunctionNodes()
 {
   register_node_type_fn_boolean_math();
-  register_node_type_fn_combine_strings();
   register_node_type_fn_float_compare();
-  register_node_type_fn_group_instance_id();
   register_node_type_fn_input_string();
   register_node_type_fn_input_vector();
-  register_node_type_fn_object_transforms();
   register_node_type_fn_random_float();
-  register_node_type_fn_switch();
 }
 
 void BKE_node_system_init(void)
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index fc1f692a8bf..a46c9a6fe40 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -91,20 +91,6 @@ static const EnumPropertyItem node_socket_type_items[] = {
     {0, NULL, 0, NULL, NULL},
 };
 
-static const EnumPropertyItem node_socket_data_type_items[] = {
-    {SOCK_FLOAT, "FLOAT", 0, "Float", ""},
-    {SOCK_INT, "INT", 0, "Int", ""},
-    {SOCK_BOOLEAN, "BOOLEAN", 0, "Boolean", ""},
-    {SOCK_VECTOR, "VECTOR", 0, "Vector", ""},
-    {SOCK_STRING, "STRING", 0, "String", ""},
-    {SOCK_RGBA, "RGBA", 0, "Color", ""},
-    {SOCK_OBJECT, "OBJECT", 0, "Object", ""},
-    {SOCK_IMAGE, "IMAGE", 0, "Image", ""},
-    {SOCK_GEOMETRY, "GEOMETRY", 0, "Geometry", ""},
-    {SOCK_COLLECTION, "COLLECTION", 0, "Collection", ""},
-    {0, NULL, 0, NULL, NULL},
-};
-
 static const EnumPropertyItem node_quality_items[] = {
     {NTREE_QUALITY_HIGH, "HIGH", 0, "High", "High quality"},
     {NTREE_QUALITY_MEDIUM, "MEDIUM", 0, "Medium", "Medium quality"},
@@ -4601,17 +4587,6 @@ static void def_float_compare(StructRNA *srna)
   RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
 }
 
-static void def_fn_switch(StructRNA *srna)
-{
-  PropertyRNA *prop;
-
-  prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE);
-  RNA_def_property_enum_sdna(prop, NULL, "custom1");
-  RNA_def_property_enum_items(prop, node_socket_data_type_items);
-  RNA_def_property_ui_text(prop, "Data Type", "Data type for inputs and outputs");
-  RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
-}
-
 static void def_vector_math(StructRNA *srna)
 {
   PropertyRNA *prop;
diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt
index 366cac48a40..271f4e5c5e4 100644
--- a/source/blender/nodes/CMakeLists.txt
+++ b/source/blender/nodes/CMakeLists.txt
@@ -132,14 +132,10 @@ set(SRC
   composite/node_composite_util.c
 
   function/nodes/node_fn_boolean_math.cc
-  function/nodes/node_fn_combine_strings.cc
   function/nodes/node_fn_float_compare.cc
-  function/nodes/node_fn_group_instance_id.cc
   function/nodes/node_fn_input_string.cc
   function/nodes/node_fn_input_vector.cc
-  function/nodes/node_fn_object_transforms.cc
   function/nodes/node_fn_random_float.cc
-  function/nodes/node_fn_switch.cc
   function/node_function_util.cc
 
   geometry/nodes/node_geo_align_rotation_to_vector.cc
diff --git a/source/blender/nodes/NOD_function.h b/source/blender/nodes/NOD_function.h
index 6b184f04af7..b31b5326d66 100644
--- a/source/blender/nodes/NOD_function.h
+++ b/source/blender/nodes/NOD_function.h
@@ -21,14 +21,10 @@ extern "C" {
 #endif
 
 void register_node_type_fn_boolean_math(void);
-void register_node_type_fn_combine_strings(void);
 void register_node_type_fn_float_compare(void);
-void register_node_type_fn_group_instance_id(void);
 void register_node_type_fn_input_string(void);
 void register_node_type_fn_input_vector(void);
-void register_node_type_fn_object_transforms(void);
 void register_node_type_fn_random_float(void);
-void register_node_type_fn_switch(void);
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/nodes/NOD_static_types.h b/source/blender/nodes/NOD_static_types.h
index abb467961b1..ec687ae6b70 100644
--- a/source/blender/nodes/NOD_static_types.h
+++ b/source/blender/nodes/NOD_static_types.h
@@ -262,10 +262,6 @@ DefNode(TextureNode,    TEX_NODE_PROC+TEX_DISTNOISE, 0,                  "TEX_DI
 
 DefNode(FunctionNode, FN_NODE_BOOLEAN_MATH,  def_boolean_math,  "BOOLEAN_MATH",  BooleanMath,  "Boolean Math", "")
 DefNode(FunctionNode, FN_NODE_FLOAT_COMPARE, def_float_compare, "FLOAT_COMPARE", FloatCompare, "Float Compare", "")
-DefNode(FunctionNode, FN_NODE_SWITCH,        def_fn_switch,     "SWITCH",        Switch,       "Switch", "")
-DefNode(FunctionNode, FN_NODE_GROUP_INSTANCE_ID, 0,             "GROUP_INSTANCE_ID", GroupInstanceID,  "Group Instance ID", "")
-DefNode(FunctionNode, FN_NODE_COMBINE_STRINGS, 0,               "COMBINE_STRINGS", CombineStrings, "Combine Strings", "")
-DefNode(FunctionNode, FN_NODE_OBJECT_TRANSFORMS, 0,             "OBJECT_TRANSFORMS", ObjectTransforms, "Object Transforms", "")
 DefNode(FunctionNode, FN_NODE_RANDOM_FLOAT, 0,                  "RANDOM_FLOAT", RandomFloat, "Random Float", "")
 DefNode(FunctionNode, FN_NODE_INPUT_VECTOR, def_fn_input_vector, "INPUT_VECTOR", InputVector, "Vector", "")
 DefNode(FunctionNode, FN_NODE_INPUT_STRING, def_fn_input_string, "INPUT_STRING", InputString, "String", "")
diff --git a/source/blender/nodes/function/nodes/node_fn_combine_strings.cc b/source/blender/nodes/function/nodes/node_fn_combine_strings.cc
deleted file mode 100644
index a545c4f0749..00000000000
--- a/source/blender/nodes/function/nodes/node_fn_combine_strings.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "node_function_util.hh"
-
-static bNodeSocketTemplate fn_node_combine_strings_in[] = {
-    {SOCK_STRING, N_("A")},
-    {SOCK_STRING, N_("B")},
-    {-1, ""},
-};
-
-static bNodeSocketTemplate fn_node_combine_strings_out[] = {
-    {SOCK_STRING, N_("Result")},
-    {-1, ""},
-};
-
-static void fn_node_combine_strings_expand_in_mf_network(
-    blender::nodes::NodeMFNetworkBuilder &builder)
-{
-  static blender::fn::CustomMF_SI_SI_SO<std::string, std::string, std::string> combine_fn{
-      "Combine Strings", [](const std::string &a, const std::string &b) { return a + b; }};
-  builder.set_matching_fn(combine_fn);
-}
-
-void register_node_type_fn_combine_strings()
-{
-  static bNodeType ntype;
-
-  fn_node_type_base(&ntype, FN_NODE_COMBINE_STRINGS, "Combine Strings", 0, 0);
-  node_type_socket_templates(&ntype, fn_node_combine_strings_in, fn_node_combine_strings_out);
-  ntype.expand_in_mf_network = fn_node_combine_strings_expand_in_mf_network;
-  nodeRegisterType(&ntype);
-}
diff --git a/source/blender/nodes/function/nodes/node_fn_group_instance_id.cc b/source/blender/nodes/function/nodes/node_fn_group_instance_id.cc
deleted file mode 100644
index 3d0ea201239..00000000000
--- a/source/blender/nodes/function/nodes/node_fn_group_instance_id.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "node_function_util.hh"
-
-static bNodeSocketTemplate fn_node_group_instance_id_out[] = {
-    {SOCK_STRING, N_("Identifier")},
-    {-1, ""},
-};
-
-static void fn_node_group_instance_id_expand_in_mf_network(
-    blender::nodes::NodeMFNetworkBuilder &builder)
-{
-  const blender::nodes::DNode &node = builder.dnode();
-  std::string id = "/";
-  for (const blender::nodes::DTreeContext *context = node.context();
-       context->parent_node() != nullptr;
-       context = context->parent_context()) {
-    id = "/" + context->parent_node()->name() + id;
-  }
-  builder.construct_and_set_matching_fn<blender::fn::CustomMF_Constant<std::string>>(
-      std::move(id)

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list