diff options
author | Dalai Felinto <dalai@blender.org> | 2020-12-17 20:37:04 +0300 |
---|---|---|
committer | Dalai Felinto <dalai@blender.org> | 2020-12-18 15:03:27 +0300 |
commit | f43561eae6826eead2e5e78bc8792b3c15dda6ae (patch) | |
tree | 8676fcba093e97c77224390760c7cb7c76359b48 /source/blender/editors/space_node | |
parent | b342e089c3fb5cf83d6b3715f0658ed217a8c469 (diff) |
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
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 9 |
1 files changed, 9 insertions, 0 deletions
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; } } |