Blender  V3.3
node_composite_map_value.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_texture.h"
9 
10 #include "RNA_access.h"
11 
12 #include "UI_interface.h"
13 #include "UI_resources.h"
14 
15 #include "node_composite_util.hh"
16 
17 /* **************** MAP VALUE ******************** */
18 
20 
22 {
23  b.add_input<decl::Float>(N_("Value")).default_value(1.0f).min(0.0f).max(1.0f);
24  b.add_output<decl::Float>(N_("Value"));
25 }
26 
28 {
30 }
31 
33 {
34  uiLayout *sub, *col;
35 
36  col = uiLayoutColumn(layout, true);
37  uiItemR(col, ptr, "offset", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
38  uiItemR(col, ptr, "size", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
39 
40  col = uiLayoutColumn(layout, true);
41  uiItemR(col, ptr, "use_min", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
42  sub = uiLayoutColumn(col, false);
43  uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_min"));
44  uiItemR(sub, ptr, "min", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
45 
46  col = uiLayoutColumn(layout, true);
47  uiItemR(col, ptr, "use_max", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
48  sub = uiLayoutColumn(col, false);
49  uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_max"));
50  uiItemR(sub, ptr, "max", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
51 }
52 
53 } // namespace blender::nodes::node_composite_map_value_cc
54 
56 {
58 
59  static bNodeType ntype;
60 
66 
67  nodeRegisterType(&ntype);
68 }
#define CMP_NODE_MAP_VALUE
Definition: BKE_node.h:1208
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_VECTOR
Definition: BKE_node.h:348
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1357
struct TexMapping * BKE_texture_mapping_add(int type)
Definition: texture.c:229
#define UNUSED(x)
#define TEXMAP_TYPE_POINT
void uiLayoutSetActive(uiLayout *layout, bool active)
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
@ 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_buts_map_value(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
static void node_composit_init_map_value(bNodeTree *UNUSED(ntree), bNode *node)
static void cmp_node_map_value_declare(NodeDeclarationBuilder &b)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_cmp_map_value()
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
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:4863
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