[Bf-blender-cvs] [2630b4c2311] functions: new node type for testing

Jacques Lucke noreply at git.blender.org
Thu Feb 13 12:43:08 CET 2020


Commit: 2630b4c23111e317d8705bb6f1db52cd2e57ea57
Author: Jacques Lucke
Date:   Thu Feb 13 12:43:01 2020 +0100
Branches: functions
https://developer.blender.org/rB2630b4c23111e317d8705bb6f1db52cd2e57ea57

new node type for testing

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

M	source/blender/simulations/CMakeLists.txt
M	source/blender/simulations/nodes/SIM_node_tree.h
A	source/blender/simulations/nodes/my_test_node.cc
M	source/blender/simulations/nodes/simulation_node_tree.cc

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

diff --git a/source/blender/simulations/CMakeLists.txt b/source/blender/simulations/CMakeLists.txt
index a58bb8ea97c..ca7232b6f89 100644
--- a/source/blender/simulations/CMakeLists.txt
+++ b/source/blender/simulations/CMakeLists.txt
@@ -60,6 +60,7 @@ set(SRC
 
   nodes/SIM_node_tree.h
   nodes/simulation_node_tree.cc
+  nodes/my_test_node.cc
 )
 
 set(LIB
diff --git a/source/blender/simulations/nodes/SIM_node_tree.h b/source/blender/simulations/nodes/SIM_node_tree.h
index ee370dd556d..c89934c9345 100644
--- a/source/blender/simulations/nodes/SIM_node_tree.h
+++ b/source/blender/simulations/nodes/SIM_node_tree.h
@@ -8,6 +8,7 @@ extern "C" {
 extern struct bNodeTreeType *ntreeType_Simulation;
 
 void register_node_tree_type_sim(void);
+void register_node_type_my_test_node(void);
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/simulations/nodes/my_test_node.cc b/source/blender/simulations/nodes/my_test_node.cc
new file mode 100644
index 00000000000..f8a54794883
--- /dev/null
+++ b/source/blender/simulations/nodes/my_test_node.cc
@@ -0,0 +1,21 @@
+#include <cstring>
+
+#include "BKE_node.h"
+#include "SIM_node_tree.h"
+
+void register_node_type_my_test_node()
+{
+  static bNodeType ntype = {0};
+  ntype.minwidth = 20;
+  ntype.minheight = 20;
+  ntype.maxwidth = 1000;
+  ntype.maxheight = 1000;
+  ntype.height = 100;
+  ntype.width = 140;
+
+  strcpy(ntype.idname, "MyTestNode");
+  strcpy(ntype.ui_name, "My Test Node");
+  strcpy(ntype.ui_description, "My Test Node Description");
+  ntype.type = NODE_CUSTOM;
+  nodeRegisterType(&ntype);
+}
diff --git a/source/blender/simulations/nodes/simulation_node_tree.cc b/source/blender/simulations/nodes/simulation_node_tree.cc
index 4f231a509c8..574e9fc9616 100644
--- a/source/blender/simulations/nodes/simulation_node_tree.cc
+++ b/source/blender/simulations/nodes/simulation_node_tree.cc
@@ -20,4 +20,6 @@ void register_node_tree_type_sim()
   tt->ext.srna = &RNA_SimulationNodeTree;
 
   ntreeTypeAdd(tt);
+
+  register_node_type_my_test_node();
 }



More information about the Bf-blender-cvs mailing list