[Bf-blender-cvs] [f01fa8c8a7c] builtin-simulation-nodes: initial particle time step event node

Jacques Lucke noreply at git.blender.org
Thu Mar 5 13:15:35 CET 2020


Commit: f01fa8c8a7cf819089ef0e71671af87f999b5049
Author: Jacques Lucke
Date:   Thu Mar 5 12:12:15 2020 +0100
Branches: builtin-simulation-nodes
https://developer.blender.org/rBf01fa8c8a7cf819089ef0e71671af87f999b5049

initial particle time step event node

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

M	release/scripts/startup/nodeitems_builtins.py
M	source/blender/blenkernel/BKE_node.h
M	source/blender/blenkernel/intern/node.c
M	source/blender/nodes/CMakeLists.txt
M	source/blender/nodes/NOD_simulation.h
M	source/blender/nodes/NOD_static_types.h
A	source/blender/nodes/simulation/nodes/node_sim_particle_time_step_event.cc

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

diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py
index f5d4ef20e4f..8f6c4c3928d 100644
--- a/release/scripts/startup/nodeitems_builtins.py
+++ b/release/scripts/startup/nodeitems_builtins.py
@@ -480,6 +480,7 @@ simulation_node_categories = [
     ]),
     SimulationNodeCategory("EVENTS", "Events", items=[
         NodeItem("SimulationNodeParticleBirthEvent"),
+        NodeItem("SimulationNodeParticleTimeStepEvent"),
     ]),
     SimulationNodeCategory("FORCES", "Forces", items=[
         NodeItem("SimulationNodeCustomForce"),
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index 9ab79ad6052..4fad168ceb1 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -1010,6 +1010,7 @@ void BKE_nodetree_remove_layer_n(struct bNodeTree *ntree,
 #define SIM_NODE_CUSTOM_FORCE 1001
 #define SIM_NODE_SET_PARTICLE_ATTRIBUTE 1002
 #define SIM_NODE_PARTICLE_BIRTH_EVENT 1003
+#define SIM_NODE_PARTICLE_TIME_STEP_EVENT 1004
 
 /* custom defines options for Material node */
 // #define SH_NODE_MAT_DIFF 1
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 5f18157149b..2933997f841 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -4127,6 +4127,7 @@ static void registerSimulationNodes(void)
   register_node_type_sim_custom_force();
   register_node_type_set_particle_attribute();
   register_node_type_sim_particle_birth_event();
+  register_node_type_sim_particle_time_step_event();
 }
 
 void init_nodesystem(void)
diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt
index 767d912a3cf..e58e4602c24 100644
--- a/source/blender/nodes/CMakeLists.txt
+++ b/source/blender/nodes/CMakeLists.txt
@@ -225,6 +225,7 @@ set(SRC
   simulation/nodes/node_sim_custom_force.cc
   simulation/nodes/node_sim_particle_birth_event.cc
   simulation/nodes/node_sim_particle_simulation.cc
+  simulation/nodes/node_sim_particle_time_step_event.cc
   simulation/nodes/node_sim_set_particle_attribute.cc
   simulation/node_sim_tree.cc
   simulation/node_sim_util.cc
diff --git a/source/blender/nodes/NOD_simulation.h b/source/blender/nodes/NOD_simulation.h
index c2b2170cb37..63cd50fd27d 100644
--- a/source/blender/nodes/NOD_simulation.h
+++ b/source/blender/nodes/NOD_simulation.h
@@ -15,6 +15,7 @@ void register_node_type_sim_particle_simulation(void);
 void register_node_type_sim_custom_force(void);
 void register_node_type_set_particle_attribute(void);
 void register_node_type_sim_particle_birth_event(void);
+void register_node_type_sim_particle_time_step_event(void);
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/nodes/NOD_static_types.h b/source/blender/nodes/NOD_static_types.h
index 3069d90033e..0f478220749 100644
--- a/source/blender/nodes/NOD_static_types.h
+++ b/source/blender/nodes/NOD_static_types.h
@@ -261,7 +261,8 @@ DefNode(TextureNode,    TEX_NODE_PROC+TEX_DISTNOISE, 0,                  "TEX_DI
 DefNode(SimulationNode, SIM_NODE_PARTICLE_SIMULATION, 0,                 "PARTICLE_SIMULATION", ParticleSimulation, "Particle Simulation", "")
 DefNode(SimulationNode, SIM_NODE_CUSTOM_FORCE,        0,                 "CUSTOM_FORCE",        CustomForce,        "Custom Force",        "")
 DefNode(SimulationNode, SIM_NODE_SET_PARTICLE_ATTRIBUTE, 0,              "SET_PARTICLE_ATTRIBUTE", SetParticleAttribute, "Set Particle Attribute", "")
-DefNode(SimulationNode, SIM_NODE_PARTICLE_BIRTH_EVENT,   0,               "PARTICLE_BIRTH_EVENT",   ParticleBirthEvent,   "Particle Birth Event",   "")
+DefNode(SimulationNode, SIM_NODE_PARTICLE_BIRTH_EVENT,   0,              "PARTICLE_BIRTH_EVENT",   ParticleBirthEvent,   "Particle Birth Event",   "")
+DefNode(SimulationNode, SIM_NODE_PARTICLE_TIME_STEP_EVENT, 0,            "PARTICLE_TIME_STEP_EVENT", ParticleTimeStepEvent, "Particle Time Step Event", "")
 
 /* undefine macros */
 #undef DefNode
diff --git a/source/blender/nodes/simulation/nodes/node_sim_particle_time_step_event.cc b/source/blender/nodes/simulation/nodes/node_sim_particle_time_step_event.cc
new file mode 100644
index 00000000000..efa3edab989
--- /dev/null
+++ b/source/blender/nodes/simulation/nodes/node_sim_particle_time_step_event.cc
@@ -0,0 +1,21 @@
+#include "node_sim_util.h"
+
+static bNodeSocketTemplate sim_node_particle_time_step_event_in[] = {
+    {SOCK_CONTROL_FLOW, 1, N_("Execute")},
+    {-1, 0, ""},
+};
+
+static bNodeSocketTemplate sim_node_particle_time_step_event_out[] = {
+    {SOCK_EVENTS, 0, N_("Event")},
+    {-1, 0, ""},
+};
+
+void register_node_type_sim_particle_time_step_event()
+{
+  static bNodeType ntype;
+
+  sim_node_type_base(&ntype, SIM_NODE_PARTICLE_TIME_STEP_EVENT, "Particle Time Step Event", 0, 0);
+  node_type_socket_templates(
+      &ntype, sim_node_particle_time_step_event_in, sim_node_particle_time_step_event_out);
+  nodeRegisterType(&ntype);
+}



More information about the Bf-blender-cvs mailing list