From f43561eae6826eead2e5e78bc8792b3c15dda6ae Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Thu, 17 Dec 2020 18:37:04 +0100 Subject: Function Nodes: Input Vector Ref: T82651 Normally people use "Combine XYZ" to input a vector, but it is more interesting to have an explicit vector input. So this is basically "Combine XYZ" without any input sockets, the values are stored in the node itself. Differential Revision: https://developer.blender.org/D9885 --- source/blender/editors/space_node/drawnode.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/blender/editors/space_node/drawnode.c') diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index c2951a9d7a8..b6744719cad 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -3289,6 +3289,12 @@ static void node_function_buts_switch(uiLayout *layout, bContext *UNUSED(C), Poi uiItemR(layout, ptr, "data_type", DEFAULT_FLAGS, "", ICON_NONE); } +static void node_function_buts_input_vector(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +{ + uiLayout *col = uiLayoutColumn(layout, true); + uiItemR(col, ptr, "vector", UI_ITEM_R_EXPAND, "", ICON_NONE); +} + static void node_function_set_butfunc(bNodeType *ntype) { switch (ntype->type) { @@ -3301,6 +3307,9 @@ static void node_function_set_butfunc(bNodeType *ntype) case FN_NODE_SWITCH: ntype->draw_buttons = node_function_buts_switch; break; + case FN_NODE_INPUT_VECTOR: + ntype->draw_buttons = node_function_buts_input_vector; + break; } } -- cgit v1.2.3