diff options
Diffstat (limited to 'source/blender/nodes/composite/nodes/node_composite_splitViewer.cc')
-rw-r--r-- | source/blender/nodes/composite/nodes/node_composite_splitViewer.cc | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/source/blender/nodes/composite/nodes/node_composite_splitViewer.cc b/source/blender/nodes/composite/nodes/node_composite_splitViewer.cc index c0403a041db..63772a52840 100644 --- a/source/blender/nodes/composite/nodes/node_composite_splitViewer.cc +++ b/source/blender/nodes/composite/nodes/node_composite_splitViewer.cc @@ -21,17 +21,25 @@ * \ingroup cmpnodes */ -#include "node_composite_util.hh" - #include "BKE_global.h" #include "BKE_image.h" +#include "UI_interface.h" +#include "UI_resources.h" + +#include "node_composite_util.hh" + /* **************** SPLIT VIEWER ******************** */ -static bNodeSocketTemplate cmp_node_splitviewer_in[] = { - {SOCK_RGBA, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f}, - {SOCK_RGBA, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f}, - {-1, ""}, -}; + +namespace blender::nodes { + +static void cmp_node_split_viewer_declare(NodeDeclarationBuilder &b) +{ + b.add_input<decl::Color>(N_("Image")); + b.add_input<decl::Color>(N_("Image"), "Image_001"); +} + +} // namespace blender::nodes static void node_composit_init_splitviewer(bNodeTree *UNUSED(ntree), bNode *node) { @@ -43,13 +51,24 @@ static void node_composit_init_splitviewer(bNodeTree *UNUSED(ntree), bNode *node node->id = (ID *)BKE_image_ensure_viewer(G.main, IMA_TYPE_COMPOSITE, "Viewer Node"); } -void register_node_type_cmp_splitviewer(void) +static void node_composit_buts_splitviewer(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +{ + uiLayout *row, *col; + + col = uiLayoutColumn(layout, false); + row = uiLayoutRow(col, false); + uiItemR(row, ptr, "axis", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_EXPAND, nullptr, ICON_NONE); + uiItemR(col, ptr, "factor", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); +} + +void register_node_type_cmp_splitviewer() { static bNodeType ntype; cmp_node_type_base( &ntype, CMP_NODE_SPLITVIEWER, "Split Viewer", NODE_CLASS_OUTPUT, NODE_PREVIEW); - node_type_socket_templates(&ntype, cmp_node_splitviewer_in, nullptr); + ntype.declare = blender::nodes::cmp_node_split_viewer_declare; + ntype.draw_buttons = node_composit_buts_splitviewer; node_type_init(&ntype, node_composit_init_splitviewer); node_type_storage(&ntype, "ImageUser", node_free_standard_storage, node_copy_standard_storage); |