Blender V5.0
blender::nodes::node_geo_set_shade_smooth_cc Namespace Reference

Functions

static void node_declare (NodeDeclarationBuilder &b)
static void node_layout (uiLayout *layout, bContext *, PointerRNA *ptr)
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 set_sharp (Mesh &mesh, const AttrDomain domain, const StringRef name, const Field< bool > &selection, const Field< bool > &sharpness)
static void node_geo_exec (GeoNodeExecParams params)
static void node_rna (StructRNA *srna)
static void node_register ()

Function Documentation

◆ node_declare()

void blender::nodes::node_geo_set_shade_smooth_cc::node_declare ( NodeDeclarationBuilder & b)
static

◆ node_geo_exec()

void blender::nodes::node_geo_set_shade_smooth_cc::node_geo_exec ( GeoNodeExecParams params)
static

◆ node_init()

void blender::nodes::node_geo_set_shade_smooth_cc::node_init ( bNodeTree * ,
bNode * node )
static

Definition at line 38 of file node_geo_set_shade_smooth.cc.

References bNode::custom1.

Referenced by node_register().

◆ node_layout()

void blender::nodes::node_geo_set_shade_smooth_cc::node_layout ( uiLayout * layout,
bContext * ,
PointerRNA * ptr )
static

Definition at line 33 of file node_geo_set_shade_smooth.cc.

References uiLayout::prop(), ptr, and UI_ITEM_R_EXPAND.

Referenced by node_register().

◆ node_register()

◆ node_rna()

void blender::nodes::node_geo_set_shade_smooth_cc::node_rna ( StructRNA * srna)
static

◆ set_sharp()

void blender::nodes::node_geo_set_shade_smooth_cc::set_sharp ( Mesh & mesh,
const AttrDomain domain,
const StringRef name,
const Field< bool > & selection,
const Field< bool > & sharpness )
static

◆ try_removing_sharp_attribute()

bool blender::nodes::node_geo_set_shade_smooth_cc::try_removing_sharp_attribute ( Mesh & mesh,
const StringRef name,
const Field< bool > & selection,
const Field< bool > & sharpness )
static

When the sharp_face attribute doesn't exist, all faces are considered smooth. If all faces are selected and the sharp value is a constant false value, we can remove the attribute instead as an optimization to avoid storing it and propagating it in the future.

Definition at line 48 of file node_geo_set_shade_smooth.cc.

References blender::fn::FieldNode::depends_on_input(), blender::fn::evaluate_constant_field(), name, and blender::fn::GFieldBase< NodePtr >::node().

Referenced by set_sharp().