Blender V5.0
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
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.ui_description =
50 "Control the mixing of texture information into the base color of line styles";
51 ntype.enum_name_legacy = "OUTPUT_LINESTYLE";
53 ntype.declare = file_ns::node_declare;
55 ntype.draw_buttons = file_ns::node_buts_output_linestyle;
56 ntype.no_muting = true;
57
59}
#define NODE_CLASS_OUTPUT
Definition BKE_node.hh:448
#define SH_NODE_OUTPUT_LINESTYLE
@ PROP_FACTOR
Definition RNA_types.hh:251
@ UI_ITEM_R_SPLIT_EMPTY_NAME
uint col
void node_register_type(bNodeType &ntype)
Definition node.cc:2416
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:238
std::string ui_description
Definition BKE_node.hh:244
bool(* add_ui_poll)(const bContext *C)
Definition BKE_node.hh:310
const char * enum_name_legacy
Definition BKE_node.hh:247
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
Definition BKE_node.hh:259
NodeDeclareFunction declare
Definition BKE_node.hh:362
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:4238