[Bf-blender-cvs] [90b41c7c2f2] functions: create socket in new node

Jacques Lucke noreply at git.blender.org
Thu Feb 13 17:40:42 CET 2020


Commit: 90b41c7c2f273e216d068d2876493162b54143d0
Author: Jacques Lucke
Date:   Thu Feb 13 12:52:29 2020 +0100
Branches: functions
https://developer.blender.org/rB90b41c7c2f273e216d068d2876493162b54143d0

create socket in new node

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

M	source/blender/simulations/nodes/my_test_node.cc

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

diff --git a/source/blender/simulations/nodes/my_test_node.cc b/source/blender/simulations/nodes/my_test_node.cc
index f8a54794883..f24223e6fc1 100644
--- a/source/blender/simulations/nodes/my_test_node.cc
+++ b/source/blender/simulations/nodes/my_test_node.cc
@@ -3,6 +3,11 @@
 #include "BKE_node.h"
 #include "SIM_node_tree.h"
 
+static void init_node(bNodeTree *ntree, bNode *node)
+{
+  nodeAddSocket(ntree, node, SOCK_IN, "NodeSocketFloat", "my_identifier", "My Name");
+}
+
 void register_node_type_my_test_node()
 {
   static bNodeType ntype = {0};
@@ -17,5 +22,8 @@ void register_node_type_my_test_node()
   strcpy(ntype.ui_name, "My Test Node");
   strcpy(ntype.ui_description, "My Test Node Description");
   ntype.type = NODE_CUSTOM;
+
+  ntype.initfunc = init_node;
+
   nodeRegisterType(&ntype);
 }



More information about the Bf-blender-cvs mailing list