Blender  V3.3
node_composite_vec_blur.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 /* **************** VECTOR BLUR ******************** */
14 
16 
18 {
19  b.add_input<decl::Color>(N_("Image")).default_value({1.0f, 1.0f, 1.0f, 1.0f});
20  b.add_input<decl::Float>(N_("Z")).default_value(0.0f).min(0.0f).max(1.0f);
21  b.add_input<decl::Vector>(N_("Speed"))
22  .default_value({0.0f, 0.0f, 0.0f})
23  .min(0.0f)
24  .max(1.0f)
25  .subtype(PROP_VELOCITY);
26  b.add_output<decl::Color>(N_("Image"));
27 }
28 
29 /* custom1: iterations, custom2: max_speed (0 = no_limit). */
31 {
32  NodeBlurData *nbd = MEM_cnew<NodeBlurData>(__func__);
33  node->storage = nbd;
34  nbd->samples = 32;
35  nbd->fac = 1.0f;
36 }
37 
39 {
40  uiLayout *col;
41 
42  col = uiLayoutColumn(layout, false);
43  uiItemR(col, ptr, "samples", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
44  uiItemR(col, ptr, "factor", UI_ITEM_R_SPLIT_EMPTY_NAME, IFACE_("Blur"), ICON_NONE);
45 
46  col = uiLayoutColumn(layout, true);
47  uiItemL(col, IFACE_("Speed:"), ICON_NONE);
48  uiItemR(col, ptr, "speed_min", UI_ITEM_R_SPLIT_EMPTY_NAME, IFACE_("Min"), ICON_NONE);
49  uiItemR(col, ptr, "speed_max", UI_ITEM_R_SPLIT_EMPTY_NAME, IFACE_("Max"), ICON_NONE);
50 
51  uiItemR(layout, ptr, "use_curved", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
52 }
53 
54 } // namespace blender::nodes::node_composite_vec_blur_cc
55 
57 {
59 
60  static bNodeType ntype;
61 
68 
69  nodeRegisterType(&ntype);
70 }
#define CMP_NODE_VECBLUR
Definition: BKE_node.h:1210
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
#define NODE_CLASS_OP_FILTER
Definition: BKE_node.h:349
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1357
#define UNUSED(x)
#define IFACE_(msgid)
@ PROP_VELOCITY
Definition: RNA_types.h:156
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
void uiItemL(uiLayout *layout, const char *name, int icon)
@ UI_ITEM_R_SPLIT_EMPTY_NAME
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
OperationNode * node
bNodeTree * ntree
uint col
static void node_composit_init_vecblur(bNodeTree *UNUSED(ntree), bNode *node)
static void node_composit_buts_vecblur(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
static void cmp_node_vec_blur_declare(NodeDeclarationBuilder &b)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void cmp_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
void register_node_type_cmp_vecblur()
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
#define min(a, b)
Definition: sort.c:35
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