[Bf-blender-cvs] [0f1f55e14b0] builtin-simulation-nodes: new simulation time input node ui

Jacques Lucke noreply at git.blender.org
Thu Mar 12 15:29:58 CET 2020


Commit: 0f1f55e14b06fc9f9512b7bab9f85a11919f63d8
Author: Jacques Lucke
Date:   Thu Mar 12 15:18:13 2020 +0100
Branches: builtin-simulation-nodes
https://developer.blender.org/rB0f1f55e14b06fc9f9512b7bab9f85a11919f63d8

new simulation time input node ui

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

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_simulation_time_input.cc

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

diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py
index 3fdf6fadc72..afbbb77ec16 100644
--- a/release/scripts/startup/nodeitems_builtins.py
+++ b/release/scripts/startup/nodeitems_builtins.py
@@ -501,6 +501,9 @@ simulation_node_categories = [
         NodeItem("SimulationNodeExecuteCondition"),
         NodeItem("SimulationNodeMultiExecute"),
     ]),
+    SimulationNodeCategory("FUNCTION_INPUTS", "Function Inputs", items=[
+        NodeItem("SimulationNodeSimulationTimeInput"),
+    ]),
     FunctionNodeCategory("VECTOR", "Vector", items=[
         NodeItem("FunctionNodeCombineVector"),
     ]),
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index 01828c5ce95..049e4fe273b 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -1013,6 +1013,7 @@ void BKE_nodetree_remove_layer_n(struct bNodeTree *ntree,
 #define SIM_NODE_PARTICLE_MESH_EMITTER 1007
 #define SIM_NODE_PARTICLE_MESH_COLLISION_EVENT 1008
 #define SIM_NODE_EMIT_PARTICLES 1009
+#define SIM_NODE_SIMULATION_TIME_INPUT 1010
 
 #define FN_NODE_COMBINE_VECTOR 1100
 
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 869379ce746..ebe06101a5f 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -4208,6 +4208,7 @@ static void registerSimulationNodes(void)
   register_node_type_sim_particle_mesh_emitter();
   register_node_type_sim_particle_mesh_collision_event();
   register_node_type_sim_emit_particles();
+  register_node_type_sim_simulation_time_input();
 }
 
 static void registerFunctionNodes(void)
diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt
index 0482a0eb081..7e80de52d3c 100644
--- a/source/blender/nodes/CMakeLists.txt
+++ b/source/blender/nodes/CMakeLists.txt
@@ -236,6 +236,7 @@ set(SRC
   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/nodes/node_sim_simulation_time_input.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 06d0ec8027e..8c7713c85f9 100644
--- a/source/blender/nodes/NOD_simulation.h
+++ b/source/blender/nodes/NOD_simulation.h
@@ -21,6 +21,7 @@ void register_node_type_sim_multi_execute(void);
 void register_node_type_sim_particle_mesh_emitter(void);
 void register_node_type_sim_particle_mesh_collision_event(void);
 void register_node_type_sim_emit_particles(void);
+void register_node_type_sim_simulation_time_input(void);
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/nodes/NOD_static_types.h b/source/blender/nodes/NOD_static_types.h
index cfa0e52df3f..f11db976c93 100644
--- a/source/blender/nodes/NOD_static_types.h
+++ b/source/blender/nodes/NOD_static_types.h
@@ -268,6 +268,7 @@ DefNode(SimulationNode, SIM_NODE_MULTI_EXECUTE,       0,                 "MULTI_
 DefNode(SimulationNode, SIM_NODE_PARTICLE_MESH_EMITTER,  0,              "PARTICLE_MESH_EMITTER",  ParticleMeshEmitter,  "Particle Mesh Emitter", "")
 DefNode(SimulationNode, SIM_NODE_PARTICLE_MESH_COLLISION_EVENT, 0,       "PARTICLE_MESH_COLLISION_EVENT", ParticleMeshCollisionEvent, "Particle Mesh Collision Event", "")
 DefNode(SimulationNode, SIM_NODE_EMIT_PARTICLES, 0,                      "EMIT_PARTICLES",      EmitParticles,      "Emit Particles",       "")
+DefNode(SimulationNode, SIM_NODE_SIMULATION_TIME_INPUT, 0,               "SIMULATION_TIME_INPUT",  SimulationTimeInput, "Simulation Time Input", "")
 
 DefNode(FunctionNode, FN_NODE_COMBINE_VECTOR, 0, "COMBINE_VECTOR", CombineVector, "Combine Vector", "")
 
diff --git a/source/blender/nodes/simulation/nodes/node_sim_simulation_time_input.cc b/source/blender/nodes/simulation/nodes/node_sim_simulation_time_input.cc
new file mode 100644
index 00000000000..f9b4dd979c9
--- /dev/null
+++ b/source/blender/nodes/simulation/nodes/node_sim_simulation_time_input.cc
@@ -0,0 +1,15 @@
+#include "node_sim_util.h"
+
+static bNodeSocketTemplate sim_node_simulation_time_input_out[] = {
+    {SOCK_FLOAT, N_("Simulation Time")},
+    {-1, ""},
+};
+
+void register_node_type_sim_simulation_time_input()
+{
+  static bNodeType ntype;
+
+  sim_node_type_base(&ntype, SIM_NODE_SIMULATION_TIME_INPUT, "Simulation Time Input", 0, 0);
+  node_type_socket_templates(&ntype, nullptr, sim_node_simulation_time_input_out);
+  nodeRegisterType(&ntype);
+}



More information about the Bf-blender-cvs mailing list