Blender V5.3
node_geo_input_face_smooth.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
6
8
10{
11 b.add_output<decl::Bool>("Smooth"_ustr)
12 .structure_type(StructureType::Field)
14}
15
17{
18 Field<bool> sharp = AttributeFieldInput::get_field<bool, "sharp_face">();
19 params.set_output("Smooth"_ustr, fn::invert_boolean_field(std::move(sharp)));
20}
21
22static void node_register()
23{
24 static bke::bNodeType ntype;
25
26 geo_node_type_base(&ntype, "GeometryNodeInputShadeSmooth"_ustr, GEO_NODE_INPUT_FACE_SMOOTH);
27 ntype.ui_name = "Is Face Smooth";
28 ntype.ui_description = "Retrieve whether each face is marked for smooth or sharp normals";
29 ntype.enum_name_legacy = "INPUT_SHADE_SMOOTH";
32 ntype.declare = node_declare;
34}
36
37} // namespace blender::nodes::node_geo_input_face_smooth_cc
#define NODE_CLASS_INPUT
Definition BKE_node.hh:478
#define GEO_NODE_INPUT_FACE_SMOOTH
#define BLT_I18NCONTEXT_ID_MESH
#define NOD_REGISTER_NODE(REGISTER_FUNC)
static const fn::Field< T > & get_field()
void set_output(const UString identifier, T &&value)
std::optional< std::string > translation_context
void node_register_type(bNodeType &ntype)
Definition node.cc:2920
Field< bool > invert_boolean_field(const Field< bool > &field)
Definition field.cc:564
static void node_geo_exec(GeoNodeExecParams params)
static void node_declare(NodeDeclarationBuilder &b)
void geo_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
Defines a node type.
Definition BKE_node.hh:265
std::string ui_description
Definition BKE_node.hh:271
NodeGeometryExecFunction geometry_node_execute
Definition BKE_node.hh:385
const char * enum_name_legacy
Definition BKE_node.hh:274
NodeDeclareFunction declare
Definition BKE_node.hh:393