diff options
author | Jacques Lucke <jacques@blender.org> | 2020-05-04 13:49:25 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-05-04 13:49:25 +0300 |
commit | 838e1f248d8459ae4092b713bb1522900646972b (patch) | |
tree | 5f21fb96b78ac3d792b36bd6f7a0adfb2a61420c /source/blender/nodes | |
parent | 9adb81f58494731438f3afdcbacb1599a4a32bb9 (diff) |
Nodes: add Combine Strings and Group Instance ID node UIs
Reviewers: brecht
Differential Revision: https://developer.blender.org/D7494
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/CMakeLists.txt | 2 | ||||
-rw-r--r-- | source/blender/nodes/NOD_function.h | 2 | ||||
-rw-r--r-- | source/blender/nodes/NOD_static_types.h | 2 | ||||
-rw-r--r-- | source/blender/nodes/function/nodes/node_fn_combine_strings.cc | 21 | ||||
-rw-r--r-- | source/blender/nodes/function/nodes/node_fn_group_instance_id.cc | 15 |
5 files changed, 42 insertions, 0 deletions
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); +} |