Blender  V3.3
node_composite_ellipsemask.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 "UI_interface.h"
9 #include "UI_resources.h"
10 
11 #include "node_composite_util.hh"
12 
13 /* **************** SCALAR MATH ******************** */
14 
16 
18 {
19  b.add_input<decl::Float>(N_("Mask")).default_value(0.0f).min(0.0f).max(1.0f);
20  b.add_input<decl::Float>(N_("Value")).default_value(1.0f).min(0.0f).max(1.0f);
21  b.add_output<decl::Float>(N_("Mask"));
22 }
23 
25 {
26  NodeEllipseMask *data = MEM_cnew<NodeEllipseMask>(__func__);
27  data->x = 0.5;
28  data->y = 0.5;
29  data->width = 0.2;
30  data->height = 0.1;
31  data->rotation = 0.0;
32  node->storage = data;
33 }
34 
36 {
37  uiLayout *row;
38  row = uiLayoutRow(layout, true);
39  uiItemR(row, ptr, "x", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
40  uiItemR(row, ptr, "y", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
41  row = uiLayoutRow(layout, true);
42  uiItemR(row, ptr, "width", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
43  uiItemR(row, ptr, "height", UI_ITEM_R_SPLIT_EMPTY_NAME | UI_ITEM_R_SLIDER, nullptr, ICON_NONE);
44 
45  uiItemR(layout, ptr, "rotation", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
46  uiItemR(layout, ptr, "mask_type", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
47 }
48 
49 } // namespace blender::nodes::node_composite_ellipsemask_cc
50 
52 {
54 
55  static bNodeType ntype;
56 
60  node_type_size(&ntype, 260, 110, 320);
63  &ntype, "NodeEllipseMask", node_free_standard_storage, node_copy_standard_storage);
64 
65  nodeRegisterType(&ntype);
66 }
void node_type_size(struct bNodeType *ntype, int width, int minwidth, int maxwidth)
Definition: node.cc:4396
#define CMP_NODE_MASK_ELLIPSE
Definition: BKE_node.h:1279
#define NODE_CLASS_MATTE
Definition: BKE_node.h:352
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)
uiLayout * uiLayoutRow(uiLayout *layout, bool align)
@ UI_ITEM_R_SPLIT_EMPTY_NAME
@ UI_ITEM_R_SLIDER
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
OperationNode * node
bNodeTree * ntree
static void node_composit_buts_ellipsemask(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
static void cmp_node_ellipsemask_declare(NodeDeclarationBuilder &b)
static void node_composit_init_ellipsemask(bNodeTree *UNUSED(ntree), bNode *node)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_cmp_ellipsemask()
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
Defines a node type.
Definition: BKE_node.h:226
void(* draw_buttons)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr)
Definition: BKE_node.h:244
NodeDeclareFunction declare
Definition: BKE_node.h:324
#define N_(msgid)
PointerRNA * ptr
Definition: wm_files.c:3480