22 b.use_custom_socket_order();
23 b.allow_any_socket_order();
24 b.add_default_layout();
26 .supported_type(GeometryComponent::Type::Mesh)
28 b.add_output<
decl::Geometry>(
"Mesh",
"Geometry").propagate_all().align_with_previous();
30 b.add_input<
decl::Bool>(
"Shade Smooth").default_value(
true).field_on_all();
40 node->
custom1 = int16_t(AttrDomain::Face);
62 mesh.attributes_for_write().remove(
name);
72 const int domain_size = mesh.
attributes().domain_size(domain);
73 if (domain_size == 0) {
98 domain == AttrDomain::Face ?
"sharp_face" :
"sharp_edge",
103 params.set_output(
"Geometry", std::move(geometry_set));
121 ntype.
ui_name =
"Set Shade Smooth";
123 "Control the smoothness of mesh normals around each face by changing the \"shade smooth\" "
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_SET_SHADE_SMOOTH
#define NOD_REGISTER_NODE(REGISTER_FUNC)
#define NOD_inline_enum_accessors(member)
bool depends_on_input() const
const FieldNode & node() const
void node_register_type(bNodeType &ntype)
bool try_capture_field_on_geometry(MutableAttributeAccessor attributes, const fn::FieldContext &field_context, const StringRef attribute_id, AttrDomain domain, const fn::Field< bool > &selection, const fn::GField &field)
Field< bool > invert_boolean_field(const Field< bool > &field)
void evaluate_constant_field(const GField &field, void *r_value)
void foreach_real_geometry(bke::GeometrySet &geometry, FunctionRef< void(bke::GeometrySet &geometry_set)> fn)
static void node_declare(NodeDeclarationBuilder &b)
static void node_rna(StructRNA *srna)
static void set_sharp(Mesh &mesh, const AttrDomain domain, const StringRef name, const Field< bool > &selection, const Field< bool > &sharpness)
static void node_init(bNodeTree *, bNode *node)
static bool try_removing_sharp_attribute(Mesh &mesh, const StringRef name, const Field< bool > &selection, const Field< bool > &sharpness)
static void node_register()
static void node_layout(uiLayout *layout, bContext *, PointerRNA *ptr)
static void node_geo_exec(GeoNodeExecParams params)
PropertyRNA * RNA_def_node_enum(StructRNA *srna, const char *identifier, const char *ui_name, const char *ui_description, const EnumPropertyItem *static_items, const EnumRNAAccessors accessors, std::optional< int > default_value, const EnumPropertyItemFunc item_func, const bool allow_animation)
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
const EnumPropertyItem rna_enum_attribute_domain_edge_face_items[]
Mesh * get_mesh_for_write()
std::string ui_description
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare
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)