Blender V4.5
node_shader_output_linestyle.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2005 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#include "node_shader_util.hh"
6
7#include "UI_interface.hh"
8#include "UI_resources.hh"
9
11
13{
14 b.add_input<decl::Color>("Color").default_value({1.0f, 0.0f, 1.0f, 1.0f});
15 b.add_input<decl::Float>("Color Fac")
16 .default_value(1.0f)
17 .min(0.0f)
18 .max(1.0f)
20 b.add_input<decl::Float>("Alpha").default_value(1.0f).min(0.0f).max(1.0f).subtype(PROP_FACTOR);
21 b.add_input<decl::Float>("Alpha Fac")
22 .default_value(1.0f)
23 .min(0.0f)
24 .max(1.0f)
26}
27
29{
30 uiLayout *row, *col;
31
32 col = &layout->column(false);
33 row = &col->row(true);
34 row->prop(ptr, "blend_type", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
35 col->prop(ptr, "use_clamp", UI_ITEM_R_SPLIT_EMPTY_NAME, std::nullopt, ICON_NONE);
36}
37
38} // namespace blender::nodes::node_shader_output_linestyle_cc
39
40/* node type definition */
42{
44
45 static blender::bke::bNodeType ntype;
46
47 sh_node_type_base(&ntype, "ShaderNodeOutputLineStyle", SH_NODE_OUTPUT_LINESTYLE);
48 ntype.ui_name = "Line Style Output";
49 ntype.enum_name_legacy = "OUTPUT_LINESTYLE";
51 ntype.declare = file_ns::node_declare;
53 ntype.draw_buttons = file_ns::node_buts_output_linestyle;
54 ntype.no_muting = true;
55
57}
#define NODE_CLASS_OUTPUT
Definition BKE_node.hh:434
#define SH_NODE_OUTPUT_LINESTYLE
@ PROP_FACTOR
Definition RNA_types.hh:239
@ UI_ITEM_R_SPLIT_EMPTY_NAME
uint col
void node_register_type(bNodeType &ntype)
Definition node.cc:2748
static void node_buts_output_linestyle(uiLayout *layout, bContext *, PointerRNA *ptr)
void register_node_type_sh_output_linestyle()
bool line_style_shader_nodes_poll(const bContext *C)
void sh_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
Defines a node type.
Definition BKE_node.hh:226
bool(* add_ui_poll)(const bContext *C)
Definition BKE_node.hh:298
const char * enum_name_legacy
Definition BKE_node.hh:235
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
Definition BKE_node.hh:247
NodeDeclareFunction declare
Definition BKE_node.hh:355
uiLayout & column(bool align)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< blender::StringRef > name_opt, int icon, std::optional< blender::StringRef > placeholder=std::nullopt)
PointerRNA * ptr
Definition wm_files.cc:4226