18 b.use_custom_socket_order();
19 b.allow_any_socket_order();
21 .supported_type({GeometryComponent::Type::Curve, GeometryComponent::Type::GreasePencil})
22 .description(
"Curves to change the normals on");
23 b.add_output<
decl::Geometry>(
"Curve").propagate_all().align_with_previous();
28 .description(
"Mode for curve normal evaluation");
30 .default_value({0.0f, 0.0f, 1.0f})
55 Field<bool>(std::make_shared<bke::EvaluateOnDomainInput>(
56 selection_field, AttrDomain::Curve)),
71 for (
const int layer_index : grease_pencil.layers().index_range()) {
72 Drawing *drawing = grease_pencil.get_eval_drawing(grease_pencil.layer(layer_index));
73 if (drawing ==
nullptr) {
111 params.set_output(
"Curve", std::move(geometry_set));
118 ntype.
ui_name =
"Set Curve Normal";
119 ntype.
ui_description =
"Set the evaluation mode for curve normals";
Low-level operations for curves.
Low-level operations for grease pencil.
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_SET_CURVE_NORMAL
#define NOD_REGISTER_NODE(REGISTER_FUNC)
MutableAttributeAccessor attributes_for_write()
void tag_normals_changed()
MutableSpan< int8_t > normal_mode_for_write()
bke::CurvesGeometry & strokes_for_write()
void set_selection(Field< bool > selection)
IndexMask get_evaluated_selection_as_mask() 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)
void foreach_real_geometry(bke::GeometrySet &geometry, FunctionRef< void(bke::GeometrySet &geometry_set)> fn)
void masked_fill(MutableSpan< T > data, const T &value, const IndexMask &mask)
static void node_register()
static void set_curve_normal(bke::CurvesGeometry &curves, const NormalMode mode, const fn::FieldContext &curve_context, const fn::FieldContext &point_context, const Field< bool > &selection_field, const Field< float3 > &custom_normal)
static void node_declare(NodeDeclarationBuilder &b)
static void set_grease_pencil_normal(GreasePencil &grease_pencil, const NormalMode mode, const Field< bool > &selection_field, const Field< float3 > &custom_normal)
static void node_geo_exec(GeoNodeExecParams params)
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
const EnumPropertyItem rna_enum_curve_normal_mode_items[]
Curves * get_curves_for_write()
GreasePencil * get_grease_pencil_for_write()
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare