Nodes: add Combine Strings and Group Instance ID node UIs
Reviewers: brecht Differential Revision: https://developer.blender.org/D7494
This commit is contained in:
parent
9adb81f584
commit
838e1f248d
|
@ -483,6 +483,7 @@ simulation_node_categories = [
|
||||||
SimulationNodeCategory("SIM_INPUTS", "Input", items=[
|
SimulationNodeCategory("SIM_INPUTS", "Input", items=[
|
||||||
NodeItem("SimulationNodeTime"),
|
NodeItem("SimulationNodeTime"),
|
||||||
NodeItem("SimulationNodeParticleAttribute"),
|
NodeItem("SimulationNodeParticleAttribute"),
|
||||||
|
NodeItem("FunctionNodeGroupInstanceID"),
|
||||||
]),
|
]),
|
||||||
SimulationNodeCategory("SIM_EMITTERS", "Emitters", items=[
|
SimulationNodeCategory("SIM_EMITTERS", "Emitters", items=[
|
||||||
NodeItem("SimulationNodeParticleMeshEmitter"),
|
NodeItem("SimulationNodeParticleMeshEmitter"),
|
||||||
|
@ -527,6 +528,7 @@ simulation_node_categories = [
|
||||||
NodeItem("FunctionNodeBooleanMath"),
|
NodeItem("FunctionNodeBooleanMath"),
|
||||||
NodeItem("FunctionNodeFloatCompare"),
|
NodeItem("FunctionNodeFloatCompare"),
|
||||||
NodeItem("FunctionNodeSwitch"),
|
NodeItem("FunctionNodeSwitch"),
|
||||||
|
NodeItem("FunctionNodeCombineStrings"),
|
||||||
]),
|
]),
|
||||||
SimulationNodeCategory("SIM_GROUP", "Group", items=node_group_items),
|
SimulationNodeCategory("SIM_GROUP", "Group", items=node_group_items),
|
||||||
SimulationNodeCategory("SIM_LAYOUT", "Layout", items=[
|
SimulationNodeCategory("SIM_LAYOUT", "Layout", items=[
|
||||||
|
|
|
@ -1309,6 +1309,8 @@ int ntreeTexExecTree(struct bNodeTree *ntree,
|
||||||
#define FN_NODE_BOOLEAN_MATH 1200
|
#define FN_NODE_BOOLEAN_MATH 1200
|
||||||
#define FN_NODE_SWITCH 1201
|
#define FN_NODE_SWITCH 1201
|
||||||
#define FN_NODE_FLOAT_COMPARE 1202
|
#define FN_NODE_FLOAT_COMPARE 1202
|
||||||
|
#define FN_NODE_GROUP_INSTANCE_ID 1203
|
||||||
|
#define FN_NODE_COMBINE_STRINGS 1204
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
|
||||||
|
|
|
@ -4248,6 +4248,8 @@ static void registerFunctionNodes(void)
|
||||||
register_node_type_fn_boolean_math();
|
register_node_type_fn_boolean_math();
|
||||||
register_node_type_fn_float_compare();
|
register_node_type_fn_float_compare();
|
||||||
register_node_type_fn_switch();
|
register_node_type_fn_switch();
|
||||||
|
register_node_type_fn_group_instance_id();
|
||||||
|
register_node_type_fn_combine_strings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_nodesystem(void)
|
void init_nodesystem(void)
|
||||||
|
|
|
@ -130,7 +130,9 @@ set(SRC
|
||||||
composite/node_composite_util.c
|
composite/node_composite_util.c
|
||||||
|
|
||||||
function/nodes/node_fn_boolean_math.cc
|
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_float_compare.cc
|
||||||
|
function/nodes/node_fn_group_instance_id.cc
|
||||||
function/nodes/node_fn_switch.cc
|
function/nodes/node_fn_switch.cc
|
||||||
function/node_function_util.cc
|
function/node_function_util.cc
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,8 @@ extern "C" {
|
||||||
void register_node_type_fn_boolean_math(void);
|
void register_node_type_fn_boolean_math(void);
|
||||||
void register_node_type_fn_float_compare(void);
|
void register_node_type_fn_float_compare(void);
|
||||||
void register_node_type_fn_switch(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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -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_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_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_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 */
|
/* undefine macros */
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
|
@ -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);
|
||||||
|
}
|
Loading…
Reference in New Issue