Blender V5.3
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
8
9#include "node_shader_util.hh"
10
12#include "UI_resources.hh"
13
14namespace blender {
15
17
19{
20 b.add_input<decl::Color>("Color"_ustr).default_value({1.0f, 0.0f, 1.0f, 1.0f});
21 b.add_input<decl::Float>("Color Fac"_ustr)
22 .default_value(1.0f)
23 .min(0.0f)
24 .max(1.0f)
26 b.add_input<decl::Float>("Alpha"_ustr)
27 .default_value(1.0f)
28 .min(0.0f)
29 .max(1.0f)
31 b.add_input<decl::Float>("Alpha Fac"_ustr)
32 .default_value(1.0f)
33 .min(0.0f)
34 .max(1.0f)
36}
37
38static void node_buts_output_linestyle(ui::Layout &layout, bContext * /*C*/, PointerRNA *ptr)
39{
40 ui::Layout &col = layout.column(false);
41 ui::Layout &row = col.row(true);
42 row.prop(ptr, "blend_type", ui::ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
43 col.prop(ptr, "use_clamp", ui::ITEM_R_SPLIT_EMPTY_NAME, std::nullopt, ICON_NONE);
44}
45
46} // namespace nodes::node_shader_output_linestyle_cc
47
48/* node type definition */
50{
52
53 static bke::bNodeType ntype;
54
55 sh_node_type_base(&ntype, "ShaderNodeOutputLineStyle"_ustr, SH_NODE_OUTPUT_LINESTYLE);
56 ntype.ui_name = "Line Style Output";
57 ntype.ui_description =
58 "Control the mixing of texture information into the base color of line styles";
59 ntype.enum_name_legacy = "OUTPUT_LINESTYLE";
61 ntype.declare = file_ns::node_declare;
63 ntype.draw_buttons = file_ns::node_buts_output_linestyle;
64 ntype.no_muting = true;
65
67}
68
69} // namespace blender
#define NODE_CLASS_OUTPUT
Definition BKE_node.hh:479
#define SH_NODE_OUTPUT_LINESTYLE
void node_register_type(bNodeType &ntype)
Definition node.cc:2920
static void node_buts_output_linestyle(ui::Layout &layout, bContext *, PointerRNA *ptr)
BMesh Iterators.
void register_node_type_sh_output_linestyle()
void sh_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
bool line_style_shader_nodes_poll(const bContext *C)
@ PROP_FACTOR
Definition RNA_types.hh:308
Defines a node type.
Definition BKE_node.hh:265
void(*) draw_buttons(ui::Layout &, bContext *C, PointerRNA *ptr)
Definition BKE_node.hh:290
std::string ui_description
Definition BKE_node.hh:271
const char * enum_name_legacy
Definition BKE_node.hh:274
NodeDeclareFunction declare
Definition BKE_node.hh:393
bool(*) add_ui_poll(const bContext *C)
Definition BKE_node.hh:341
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< StringRef > name_opt, int icon, std::optional< StringRef > placeholder=std::nullopt)
Layout & column(bool align)
Layout & row(bool align)