Blender  V3.3
node_composite_split_viewer.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2006 Blender Foundation. All rights reserved. */
3 
8 #include "BKE_global.h"
9 #include "BKE_image.h"
10 
11 #include "UI_interface.h"
12 #include "UI_resources.h"
13 
14 #include "node_composite_util.hh"
15 
16 /* **************** SPLIT VIEWER ******************** */
17 
19 
21 {
22  b.add_input<decl::Color>(N_("Image"));
23  b.add_input<decl::Color>(N_("Image"), "Image_001");
24 }
25 
27 {
28  ImageUser *iuser = MEM_cnew<ImageUser>(__func__);
29  node->storage = iuser;
30  iuser->sfra = 1;
31  node->custom1 = 50; /* default 50% split */
32 
33  node->id = (ID *)BKE_image_ensure_viewer(G.main, IMA_TYPE_COMPOSITE, "Viewer Node");
34 }
35 
37 {
38  uiLayout *row, *col;
39 
40  col = uiLayoutColumn(layout, false);
41  row = uiLayoutRow(col, false);
42  uiItemR(row, ptr, "axis", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_EXPAND, nullptr, ICON_NONE);
43  uiItemR(col, ptr, "factor", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
44 }
45 
46 } // namespace blender::nodes::node_composite_split_viewer_cc
47 
49 {
51 
52  static bNodeType ntype;
53 
57  ntype.flag |= NODE_PREVIEW;
60 
61  ntype.no_muting = true;
62 
63  nodeRegisterType(&ntype);
64 }
struct Image * BKE_image_ensure_viewer(struct Main *bmain, int type, const char *name)
#define NODE_CLASS_OUTPUT
Definition: BKE_node.h:346
#define CMP_NODE_SPLITVIEWER
Definition: BKE_node.h:1235
void node_type_init(struct bNodeType *ntype, void(*initfunc)(struct bNodeTree *ntree, struct bNode *node))
Definition: node.cc:4390
void node_type_storage(struct bNodeType *ntype, const char *storagename, void(*freefunc)(struct bNode *node), void(*copyfunc)(struct bNodeTree *dest_ntree, struct bNode *dest_node, const struct bNode *src_node))
Definition: node.cc:4426
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1357
#define UNUSED(x)
@ IMA_TYPE_COMPOSITE
#define NODE_PREVIEW
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
uiLayout * uiLayoutRow(uiLayout *layout, bool align)
@ UI_ITEM_R_SPLIT_EMPTY_NAME
@ UI_ITEM_R_EXPAND
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
OperationNode * node
bNodeTree * ntree
uint col
#define G(x, y, z)
static void node_composit_init_splitviewer(bNodeTree *UNUSED(ntree), bNode *node)
static void node_composit_buts_splitviewer(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
static void cmp_node_split_viewer_declare(NodeDeclarationBuilder &b)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_cmp_splitviewer()
void cmp_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
void node_copy_standard_storage(bNodeTree *UNUSED(dest_ntree), bNode *dest_node, const bNode *src_node)
Definition: node_util.c:55
void node_free_standard_storage(bNode *node)
Definition: node_util.c:43
Definition: DNA_ID.h:368
Defines a node type.
Definition: BKE_node.h:226
short flag
Definition: BKE_node.h:236
void(* draw_buttons)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr)
Definition: BKE_node.h:244
NodeDeclareFunction declare
Definition: BKE_node.h:324
bool no_muting
Definition: BKE_node.h:338
#define N_(msgid)
PointerRNA * ptr
Definition: wm_files.c:3480