diff options
author | Jacques Lucke <jacques@blender.org> | 2020-04-20 16:27:12 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-04-20 16:27:58 +0300 |
commit | 8dbbac43bb38442e69e8dcd6a02c424ffb7855df (patch) | |
tree | aebca66b6a2b55558030a18bbdc2b50d1ce4e3cc /source/blender/editors/space_node | |
parent | dcb45992bff2e4ca27a1860b9a34411f23db49a1 (diff) |
Simulations: Add Boolean Math, Switch and Float Compare node UI
Reviewers: brecht
Differential Revision: https://developer.blender.org/D7424
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 4670f0fc6f6..70f3db1e2ab 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -3179,6 +3179,40 @@ static void node_simulation_set_butfunc(bNodeType *ntype) } } +/* ****************** BUTTON CALLBACKS FOR FUNCTION NODES ***************** */ + +static void node_function_buts_boolean_math(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +{ + uiItemR(layout, ptr, "operation", 0, "", ICON_NONE); +} + +static void node_function_buts_float_compare(uiLayout *layout, + bContext *UNUSED(C), + PointerRNA *ptr) +{ + uiItemR(layout, ptr, "operation", 0, "", ICON_NONE); +} + +static void node_function_buts_switch(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +{ + uiItemR(layout, ptr, "data_type", 0, "", ICON_NONE); +} + +static void node_function_set_butfunc(bNodeType *ntype) +{ + switch (ntype->type) { + case FN_NODE_BOOLEAN_MATH: + ntype->draw_buttons = node_function_buts_boolean_math; + break; + case FN_NODE_FLOAT_COMPARE: + ntype->draw_buttons = node_function_buts_float_compare; + break; + case FN_NODE_SWITCH: + ntype->draw_buttons = node_function_buts_switch; + break; + } +} + /* ****** init draw callbacks for all tree types, only called in usiblender.c, once ************ */ static void node_property_update_default(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) @@ -3288,6 +3322,7 @@ void ED_node_init_butfuncs(void) node_shader_set_butfunc(ntype); node_texture_set_butfunc(ntype); node_simulation_set_butfunc(ntype); + node_function_set_butfunc(ntype); /* define update callbacks for socket properties */ node_template_properties_update(ntype); |