[Bf-blender-cvs] [51cea97d48c] builtin-simulation-nodes: Merge branch 'functions' into builtin-simulation-nodes

Jacques Lucke noreply at git.blender.org
Thu Mar 12 11:27:12 CET 2020


Commit: 51cea97d48cc77dd551a74454acf654d0bd90ee4
Author: Jacques Lucke
Date:   Thu Mar 12 11:27:04 2020 +0100
Branches: builtin-simulation-nodes
https://developer.blender.org/rB51cea97d48cc77dd551a74454acf654d0bd90ee4

Merge branch 'functions' into builtin-simulation-nodes

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



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

diff --cc source/blender/blenkernel/BKE_node.h
index dea9535a5dc,6f1f68e1ef2..9fc45112874
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@@ -146,8 -145,9 +145,10 @@@ typedef struct bNodeSocketType 
  
    /* for standard socket types in C */
    int type, subtype;
 +  int display_shape_default;
  
+   /* When set, bNodeSocket->limit does not have any effect anymore. */
+   bool use_link_limits_of_type;
    int input_link_limit;
    int output_link_limit;
  
diff --cc source/blender/blenloader/intern/writefile.c
index edc7eba933f,8400071fca5..d6ad28adb1b
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@@ -963,6 -963,39 +963,46 @@@ static void write_CurveProfile(WriteDat
    writestruct(wd, DATA, CurveProfilePoint, profile->path_len, profile->path);
  }
  
+ static void write_node_socket_default_value(WriteData *wd, bNodeSocket *sock)
+ {
+   if (sock->default_value == NULL) {
+     return;
+   }
+ 
+   switch ((eNodeSocketDatatype)sock->type) {
+     case SOCK_FLOAT:
+       writestruct(wd, DATA, bNodeSocketValueFloat, 1, sock->default_value);
+       break;
+     case SOCK_VECTOR:
+       writestruct(wd, DATA, bNodeSocketValueVector, 1, sock->default_value);
+       break;
+     case SOCK_RGBA:
+       writestruct(wd, DATA, bNodeSocketValueRGBA, 1, sock->default_value);
+       break;
+     case SOCK_BOOLEAN:
+       writestruct(wd, DATA, bNodeSocketValueBoolean, 1, sock->default_value);
+       break;
+     case SOCK_INT:
+       writestruct(wd, DATA, bNodeSocketValueInt, 1, sock->default_value);
+       break;
+     case SOCK_STRING:
+       writestruct(wd, DATA, bNodeSocketValueString, 1, sock->default_value);
+       break;
+     case __SOCK_MESH:
+     case SOCK_CUSTOM:
+     case SOCK_SHADER:
++    case SOCK_EMITTERS:
++    case SOCK_EVENTS:
++    case SOCK_FORCES:
++    case SOCK_CONTROL_FLOW:
++    case SOCK_OBJECT:
++    case SOCK_IMAGE:
++    case SOCK_SURFACE_HOOK:
+       BLI_assert(false);
+       break;
+   }
+ }
+ 
  static void write_node_socket(WriteData *wd, bNodeSocket *sock)
  {
    /* actual socket writing */
diff --cc source/blender/nodes/function/nodes/node_fn_combine_vector.cc
index 06f839f5803,00000000000..7fc9da16461
mode 100644,000000..100644
--- a/source/blender/nodes/function/nodes/node_fn_combine_vector.cc
+++ b/source/blender/nodes/function/nodes/node_fn_combine_vector.cc
@@@ -1,22 -1,0 +1,22 @@@
 +#include "node_fn_util.h"
 +
 +static bNodeSocketTemplate fn_node_combine_vector_in[] = {
-     {SOCK_FLOAT, 1, N_("X"), 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f},
-     {SOCK_FLOAT, 1, N_("Y"), 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f},
-     {SOCK_FLOAT, 1, N_("Z"), 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f},
-     {-1, 0, ""},
++    {SOCK_FLOAT, N_("X"), 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f},
++    {SOCK_FLOAT, N_("Y"), 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f},
++    {SOCK_FLOAT, N_("Z"), 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f},
++    {-1, ""},
 +};
 +
 +static bNodeSocketTemplate fn_node_combine_vector_out[] = {
-     {SOCK_VECTOR, 0, N_("Vector")},
-     {-1, 0, ""},
++    {SOCK_VECTOR, N_("Vector")},
++    {-1, ""},
 +};
 +
 +void register_node_type_fn_combine_vector()
 +{
 +  static bNodeType ntype;
 +
 +  fn_node_type_base(&ntype, FN_NODE_COMBINE_VECTOR, "Combine Vector", 0, 0);
 +  node_type_socket_templates(&ntype, fn_node_combine_vector_in, fn_node_combine_vector_out);
 +  nodeRegisterType(&ntype);
 +}
diff --cc source/blender/nodes/simulation/nodes/node_sim_execute_condition.cc
index 28d0b4e6596,00000000000..6892deade76
mode 100644,000000..100644
--- a/source/blender/nodes/simulation/nodes/node_sim_execute_condition.cc
+++ b/source/blender/nodes/simulation/nodes/node_sim_execute_condition.cc
@@@ -1,23 -1,0 +1,23 @@@
 +#include "node_sim_util.h"
 +
 +static bNodeSocketTemplate sim_node_execute_condition_in[] = {
-     {SOCK_BOOLEAN, 1, N_("Condition")},
-     {SOCK_CONTROL_FLOW, 1, N_("If True")},
-     {SOCK_CONTROL_FLOW, 1, N_("If False")},
-     {-1, 0, ""},
++    {SOCK_BOOLEAN, N_("Condition")},
++    {SOCK_CONTROL_FLOW, N_("If True")},
++    {SOCK_CONTROL_FLOW, N_("If False")},
++    {-1, ""},
 +};
 +
 +static bNodeSocketTemplate sim_node_execute_condition_out[] = {
-     {SOCK_CONTROL_FLOW, 0, N_("Execute")},
-     {-1, 0, ""},
++    {SOCK_CONTROL_FLOW, N_("Execute")},
++    {-1, ""},
 +};
 +
 +void register_node_type_sim_execute_condition()
 +{
 +  static bNodeType ntype;
 +
 +  sim_node_type_base(&ntype, SIM_NODE_EXECUTE_CONDITION, "Execute Condition", 0, 0);
 +  node_type_socket_templates(
 +      &ntype, sim_node_execute_condition_in, sim_node_execute_condition_out);
 +  nodeRegisterType(&ntype);
 +}
diff --cc source/blender/nodes/simulation/nodes/node_sim_force.cc
index 2b14e37b99b,00000000000..842bf977181
mode 100644,000000..100644
--- a/source/blender/nodes/simulation/nodes/node_sim_force.cc
+++ b/source/blender/nodes/simulation/nodes/node_sim_force.cc
@@@ -1,20 -1,0 +1,20 @@@
 +#include "node_sim_util.h"
 +
 +static bNodeSocketTemplate sim_node_force_in[] = {
-     {SOCK_VECTOR, 1, N_("Force"), 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f},
-     {-1, 0, ""},
++    {SOCK_VECTOR, N_("Force"), 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f},
++    {-1, ""},
 +};
 +
 +static bNodeSocketTemplate sim_node_force_out[] = {
-     {SOCK_FORCES, 0, N_("Force")},
-     {-1, 0, ""},
++    {SOCK_FORCES, N_("Force")},
++    {-1, ""},
 +};
 +
 +void register_node_type_sim_force()
 +{
 +  static bNodeType ntype;
 +
 +  sim_node_type_base(&ntype, SIM_NODE_FORCE, "Force", 0, 0);
 +  node_type_socket_templates(&ntype, sim_node_force_in, sim_node_force_out);
 +  nodeRegisterType(&ntype);
 +}
diff --cc source/blender/nodes/simulation/nodes/node_sim_multi_execute.cc
index dcfa9cb656e,00000000000..ecbe2e5f88c
mode 100644,000000..100644
--- a/source/blender/nodes/simulation/nodes/node_sim_multi_execute.cc
+++ b/source/blender/nodes/simulation/nodes/node_sim_multi_execute.cc
@@@ -1,22 -1,0 +1,22 @@@
 +#include "node_sim_util.h"
 +
 +static bNodeSocketTemplate sim_node_multi_execute_in[] = {
-     {SOCK_CONTROL_FLOW, 1, "1"},
-     {SOCK_CONTROL_FLOW, 1, "2"},
-     {SOCK_CONTROL_FLOW, 1, "3"},
-     {-1, 0, ""},
++    {SOCK_CONTROL_FLOW, "1"},
++    {SOCK_CONTROL_FLOW, "2"},
++    {SOCK_CONTROL_FLOW, "3"},
++    {-1, ""},
 +};
 +
 +static bNodeSocketTemplate sim_node_multi_execute_out[] = {
-     {SOCK_CONTROL_FLOW, 0, N_("Execute")},
-     {-1, 0, ""},
++    {SOCK_CONTROL_FLOW, N_("Execute")},
++    {-1, ""},
 +};
 +
 +void register_node_type_sim_multi_execute()
 +{
 +  static bNodeType ntype;
 +
 +  sim_node_type_base(&ntype, SIM_NODE_MULTI_EXECUTE, "Multi Execute", 0, 0);
 +  node_type_socket_templates(&ntype, sim_node_multi_execute_in, sim_node_multi_execute_out);
 +  nodeRegisterType(&ntype);
 +}
diff --cc source/blender/nodes/simulation/nodes/node_sim_particle_birth_event.cc
index ecb253b76e3,00000000000..a2469f0062b
mode 100644,000000..100644
--- a/source/blender/nodes/simulation/nodes/node_sim_particle_birth_event.cc
+++ b/source/blender/nodes/simulation/nodes/node_sim_particle_birth_event.cc
@@@ -1,21 -1,0 +1,21 @@@
 +#include "node_sim_util.h"
 +
 +static bNodeSocketTemplate sim_node_particle_birth_event_in[] = {
-     {SOCK_CONTROL_FLOW, 1, N_("Execute")},
-     {-1, 0, ""},
++    {SOCK_CONTROL_FLOW, N_("Execute")},
++    {-1, ""},
 +};
 +
 +static bNodeSocketTemplate sim_node_particle_birth_event_out[] = {
-     {SOCK_EVENTS, 0, N_("Event")},
-     {-1, 0, ""},
++    {SOCK_EVENTS, N_("Event")},
++    {-1, ""},
 +};
 +
 +void register_node_type_sim_particle_birth_event()
 +{
 +  static bNodeType ntype;
 +
 +  sim_node_type_base(&ntype, SIM_NODE_PARTICLE_BIRTH_EVENT, "Particle Birth Event", 0, 0);
 +  node_type_socket_templates(
 +      &ntype, sim_node_particle_birth_event_in, sim_node_particle_birth_event_out);
 +  nodeRegisterType(&ntype);
 +}
diff --cc source/blender/nodes/simulation/nodes/node_sim_particle_simulation.cc
index 07f4056d61d,00000000000..5c17a444588
mode 100644,000000..100644
--- a/source/blender/nodes/simulation/nodes/node_sim_particle_simulation.cc
+++ b/source/blender/nodes/simulation/nodes/node_sim_particle_simulation.cc
@@@ -1,23 -1,0 +1,23 @@@
 +#include "node_sim_util.h"
 +
 +static bNodeSocketTemplate sim_node_particle_simulation_in[] = {
-     {SOCK_EMITTERS, 1000, N_("Emitters")},
-     {SOCK_EVENTS, 1000, N_("Events")},
-     {SOCK_FORCES, 1000, N_("Forces")},
-     {-1, 0, ""},
++    {SOCK_EMITTERS, N_("Emitters")},
++    {SOCK_EVENTS, N_("Events")},
++    {SOCK_FORCES, N_("Forces")},
++    {-1, ""},
 +};
 +
 +static bNodeSocketTemplate sim_node_particle_simulation_out[] = {
-     {-1, 0, ""},
++    {-1, ""},
 +};
 +
 +void register_node_type_sim_particle_simulation()
 +{
 +  static bNodeType ntype;
 +
 +  sim_node_type_base(
 +      &ntype, SIM_NODE_PARTICLE_SIMULATION, "Particle Simulation", NODE_CLASS_OUTPUT, 0);
 +  node_type_socket_templates(
 +      &ntype, sim_node_particle_simulation_in, sim_node_particle_simulation_out);
 +  nodeRegisterType(&ntype);
 +}
diff --cc source/blender/nodes/simulation/nodes/node_sim_particle_time_step_event.cc
index efa3edab989,00000000000..be2d98f4a81
mode 100644,000000..100644
--- 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
@@@ -1,21 -1,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, ""},
++    {SOCK_CONTROL_FLOW, N_("Execute")},
++    {-1, ""},
 +};
 +
 +static bNodeSocketTemplate sim_node_particle_time_step_event_out[] = {
-     {SOCK_EVENTS, 0, N_("Event")},
-     {-1, 0, ""},
++    {SOCK_EVENTS, N_("Event")},
++    {-1, ""},
 +};
 +
 +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);
 +}
diff --cc 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list