24 .supported_type({GeometryComponent::Type::Curve, GeometryComponent::Type::GreasePencil})
25 .description(
"Curve to convert to a mesh using the given profile");
28 .supported_type(GeometryComponent::Type::Curve)
29 .
description(
"Curves that are swept along the main curve");
30 b.add_input<
decl::Float>(
"Scale").default_value(1.0f).min(0.0f).field_on({0}).description(
31 "Scale of the profile at each point");
34 "If the profile spline is cyclic, fill the ends of the generated mesh with N-gons");
50 evaluator.
add(scale_field);
55 curves, profile_curves->
geometry.wrap(), profile_scales, fill_caps, attribute_filter);
73 Array<Mesh *> mesh_by_layer(grease_pencil.layers().size(),
nullptr);
75 for (
const int layer_index : grease_pencil.layers().index_range()) {
76 const Drawing *drawing = grease_pencil.get_eval_drawing(grease_pencil.layer(layer_index));
77 if (drawing ==
nullptr) {
84 curves, profile_set, context, scale_field, fill_caps, attribute_filter);
125 const bool fill_caps =
params.extract_input<
bool>(
"Fill Caps");
136 curves.geometry.wrap(), profile_set, context, scale_field, fill_caps, attribute_filter);
137 if (
mesh !=
nullptr) {
151 params.set_output(
"Mesh", std::move(curve_set));
159 ntype.
ui_name =
"Curve to Mesh";
161 "Convert curves into a mesh, optionally with a custom profile shape defined by curves";
Low-level operations for curves.
Low-level operations for grease pencil.
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_CURVE_TO_MESH
#define NOD_REGISTER_NODE(REGISTER_FUNC)
static void remember_deformed_positions_if_necessary(GeometrySet &geometry)
void replace(Instances *instances, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
int add_reference(const InstanceReference &reference)
void add_instance(int instance_handle, const float4x4 &transform)
bke::MutableAttributeAccessor attributes_for_write()
const bke::CurvesGeometry & strokes() const
int add(GField field, GVArray *varray_ptr)
const GVArray & get_evaluated(const int field_index) const
void * MEM_dupallocN(const void *vmemh)
void node_register_type(bNodeType &ntype)
void copy_attributes(const AttributeAccessor src_attributes, AttrDomain src_domain, AttrDomain dst_domain, const AttributeFilter &attribute_filter, MutableAttributeAccessor dst_attributes)
Mesh * curve_to_mesh_sweep(const CurvesGeometry &main, const CurvesGeometry &profile, const VArray< float > &scales, bool fill_caps, const bke::AttributeFilter &attribute_filter={})
Mesh * curve_to_wire_mesh(const CurvesGeometry &curve, const bke::AttributeFilter &attribute_filter={})
bke::GeometrySet join_geometries(Span< bke::GeometrySet > geometries, const bke::AttributeFilter &attribute_filter, const std::optional< Span< bke::GeometryComponent::Type > > &component_types_to_join=std::nullopt, bool allow_merging_instance_references=true)
void foreach_real_geometry(bke::GeometrySet &geometry, FunctionRef< void(bke::GeometrySet &geometry_set)> fn)
void debug_randomize_mesh_order(Mesh *mesh)
static void node_declare(NodeDeclarationBuilder &b)
static void node_geo_exec(GeoNodeExecParams params)
static void grease_pencil_to_mesh(GeometrySet &geometry_set, const GeometrySet &profile_set, const Field< float > &scale_field, const bool fill_caps, const AttributeFilter &attribute_filter)
static void node_register()
static Mesh * curve_to_mesh(const bke::CurvesGeometry &curves, const GeometrySet &profile_set, const fn::FieldContext &context, const Field< float > &scale_field, const bool fill_caps, const AttributeFilter &attribute_filter)
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
static MatBase identity()
void keep_only(Span< GeometryComponent::Type > component_types)
GeometryComponent & get_component_for_write(GeometryComponent::Type component_type)
const GreasePencil * get_grease_pencil() const
const Curves * get_curves() const
bool has_grease_pencil() const
void replace_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void replace_grease_pencil(GreasePencil *grease_pencil, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare
static GeometrySet from_instances(Instances *instances, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
static GeometrySet from_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)