Blender  V3.3
node_fn_input_color.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #include "node_function_util.hh"
4 
5 #include "BLI_math_vector.h"
6 
7 #include "UI_interface.h"
8 #include "UI_resources.h"
9 
11 
13 {
14  b.add_output<decl::Color>(N_("Color"));
15 }
16 
18 {
19  uiTemplateColorPicker(layout, ptr, "color", true, false, false, true);
20  uiItemR(layout, ptr, "color", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
21 }
22 
25 {
26  bNode &bnode = builder.node();
27  NodeInputColor *node_storage = static_cast<NodeInputColor *>(bnode.storage);
30 }
31 
33 {
34  NodeInputColor *data = MEM_cnew<NodeInputColor>(__func__);
35  copy_v4_fl4(data->color, 0.5f, 0.5f, 0.5f, 1.0f);
36  node->storage = data;
37 }
38 
39 } // namespace blender::nodes::node_fn_input_color_cc
40 
42 {
43  namespace file_ns = blender::nodes::node_fn_input_color_cc;
44 
45  static bNodeType ntype;
46 
51  &ntype, "NodeInputColor", node_free_standard_storage, node_copy_standard_storage);
54  nodeRegisterType(&ntype);
55 }
#define FN_NODE_INPUT_COLOR
Definition: BKE_node.h:1532
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_INPUT
Definition: BKE_node.h:345
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1357
MINLINE void copy_v4_fl4(float v[4], float x, float y, float z, float w)
#define UNUSED(x)
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
@ UI_ITEM_R_SPLIT_EMPTY_NAME
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
void uiTemplateColorPicker(uiLayout *layout, struct PointerRNA *ptr, const char *propname, bool value_slider, bool lock, bool lock_luminosity, bool cubic)
OperationNode * node
bNodeTree * ntree
static void fn_node_input_color_init(bNodeTree *UNUSED(ntree), bNode *node)
static void fn_node_input_color_build_multi_function(blender::nodes::NodeMultiFunctionBuilder &builder)
static void fn_node_input_color_declare(NodeDeclarationBuilder &b)
static void fn_node_input_color_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
ColorSceneLinear4f< eAlpha::Premultiplied > ColorGeometry4f
Definition: BLI_color.hh:346
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_fn_input_color()
void fn_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
NodeMultiFunctionBuildFunction build_multi_function
Definition: BKE_node.h:313
NodeDeclareFunction declare
Definition: BKE_node.h:324
void * storage
#define N_(msgid)
PointerRNA * ptr
Definition: wm_files.c:3480