Commit: 838e1f248d8459ae4092b713bb1522900646972b Author: Jacques Lucke Date: Mon May 4 12:49:25 2020 +0200 Branches: master https://developer.blender.org/rB838e1f248d8459ae4092b713bb1522900646972b
Nodes: add Combine Strings and Group Instance ID node UIs Reviewers: brecht Differential Revision: https://developer.blender.org/D7494 =================================================================== 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_function.h M source/blender/nodes/NOD_static_types.h A source/blender/nodes/function/nodes/node_fn_combine_strings.cc A source/blender/nodes/function/nodes/node_fn_group_instance_id.cc =================================================================== diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py index 48df4ae8b90..2dc6c6cd409 100644 --- a/release/scripts/startup/nodeitems_builtins.py +++ b/release/scripts/startup/nodeitems_builtins.py @@ -483,6 +483,7 @@ simulation_node_categories = [ SimulationNodeCategory("SIM_INPUTS", "Input", items=[ NodeItem("SimulationNodeTime"), NodeItem("SimulationNodeParticleAttribute"), + NodeItem("FunctionNodeGroupInstanceID"), ]), SimulationNodeCategory("SIM_EMITTERS", "Emitters", items=[ NodeItem("SimulationNodeParticleMeshEmitter"), @@ -527,6 +528,7 @@ simulation_node_categories = [ NodeItem("FunctionNodeBooleanMath"), NodeItem("FunctionNodeFloatCompare"), NodeItem("FunctionNodeSwitch"), + NodeItem("FunctionNodeCombineStrings"), ]), SimulationNodeCategory("SIM_GROUP", "Group", items=node_group_items), SimulationNodeCategory("SIM_LAYOUT", "Layout", items=[ diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 7c77d57bc69..536d04f8bd3 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -1309,6 +1309,8 @@ int ntreeTexExecTree(struct bNodeTree *ntree, #define FN_NODE_BOOLEAN_MATH 1200 #define FN_NODE_SWITCH 1201 #define FN_NODE_FLOAT_COMPARE 1202 +#define FN_NODE_GROUP_INSTANCE_ID 1203 +#define FN_NODE_COMBINE_STRINGS 1204 /** \} */ diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index f9477339b9b..e6547012b88 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -4248,6 +4248,8 @@ static void registerFunctionNodes(void) register_node_type_fn_boolean_math(); register_node_type_fn_float_compare(); register_node_type_fn_switch(); + register_node_type_fn_group_instance_id(); + register_node_type_fn_combine_strings(); } void init_nodesystem(void) diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt index 469a230f467..80bf0f7c5e2 100644 --- a/source/blender/nodes/CMakeLists.txt +++ b/source/blender/nodes/CMakeLists.txt @@ -130,7 +130,9 @@ set(SRC composite/node_composite_util.c function/nodes/node_fn_boolean_math.cc + function/nodes/node_fn_combine_strings.cc function/nodes/node_fn_float_compare.cc + function/nodes/node_fn_group_instance_id.cc function/nodes/node_fn_switch.cc function/node_function_util.cc diff --git a/source/blender/nodes/NOD_function.h b/source/blender/nodes/NOD_function.h index 58597b3d410..377ae8bfb84 100644 --- a/source/blender/nodes/NOD_function.h +++ b/source/blender/nodes/NOD_function.h @@ -24,6 +24,8 @@ extern "C" { void register_node_type_fn_boolean_math(void); void register_node_type_fn_float_compare(void); void register_node_type_fn_switch(void); +void register_node_type_fn_group_instance_id(void); +void register_node_type_fn_combine_strings(void); #ifdef __cplusplus } diff --git a/source/blender/nodes/NOD_static_types.h b/source/blender/nodes/NOD_static_types.h index 354c87c554a..91aa11566d3 100644 --- a/source/blender/nodes/NOD_static_types.h +++ b/source/blender/nodes/NOD_static_types.h @@ -274,6 +274,8 @@ DefNode(SimulationNode, SIM_NODE_PARTICLE_ATTRIBUTE, def_sim_particle_attribute, DefNode(FunctionNode, FN_NODE_BOOLEAN_MATH, def_boolean_math, "BOOLEAN_MATH", BooleanMath, "Boolean Math", "") DefNode(FunctionNode, FN_NODE_FLOAT_COMPARE, def_float_compare, "FLOAT_COMPARE", FloatCompare, "Float Compare", "") DefNode(FunctionNode, FN_NODE_SWITCH, def_fn_switch, "SWITCH", Switch, "Switch", "") +DefNode(FunctionNode, FN_NODE_GROUP_INSTANCE_ID, 0, "GROUP_INSTANCE_ID", GroupInstanceID, "Group Instance ID", "") +DefNode(FunctionNode, FN_NODE_COMBINE_STRINGS, 0, "COMBINE_STRINGS", CombineStrings, "Combine Strings", "") /* undefine macros */ diff --git a/source/blender/nodes/function/nodes/node_fn_combine_strings.cc b/source/blender/nodes/function/nodes/node_fn_combine_strings.cc new file mode 100644 index 00000000000..1b6091451d9 --- /dev/null +++ b/source/blender/nodes/function/nodes/node_fn_combine_strings.cc @@ -0,0 +1,21 @@ +#include "node_function_util.h" + +static bNodeSocketTemplate fn_node_combine_strings_in[] = { + {SOCK_STRING, N_("A")}, + {SOCK_STRING, N_("B")}, + {-1, ""}, +}; + +static bNodeSocketTemplate fn_node_combine_strings_out[] = { + {SOCK_STRING, N_("Result")}, + {-1, ""}, +}; + +void register_node_type_fn_combine_strings() +{ + static bNodeType ntype; + + fn_node_type_base(&ntype, FN_NODE_COMBINE_STRINGS, "Combine Strings", 0, 0); + node_type_socket_templates(&ntype, fn_node_combine_strings_in, fn_node_combine_strings_out); + nodeRegisterType(&ntype); +} diff --git a/source/blender/nodes/function/nodes/node_fn_group_instance_id.cc b/source/blender/nodes/function/nodes/node_fn_group_instance_id.cc new file mode 100644 index 00000000000..2ac86ee2407 --- /dev/null +++ b/source/blender/nodes/function/nodes/node_fn_group_instance_id.cc @@ -0,0 +1,15 @@ +#include "node_function_util.h" + +static bNodeSocketTemplate fn_node_group_instance_id_out[] = { + {SOCK_STRING, N_("Identifier")}, + {-1, ""}, +}; + +void register_node_type_fn_group_instance_id() +{ + static bNodeType ntype; + + fn_node_type_base(&ntype, FN_NODE_GROUP_INSTANCE_ID, "Group Instance ID", 0, 0); + node_type_socket_templates(&ntype, nullptr, fn_node_group_instance_id_out); + nodeRegisterType(&ntype); +} _______________________________________________ Bf-blender-cvs mailing list [email protected] https://lists.blender.org/mailman/listinfo/bf-blender-cvs
