Cleanup: Rename geometry set "curve" functions to "curves"

Ref T95355
This commit is contained in:
Hans Goudey 2022-02-28 10:53:30 -05:00
parent 9ec12c26f1
commit 245722866d
Notes: blender-bot 2023-02-13 16:22:03 +01:00
Referenced by issue #95355, New Curves data block
44 changed files with 81 additions and 81 deletions

View File

@ -413,9 +413,9 @@ struct GeometrySet {
static GeometrySet create_with_pointcloud(
PointCloud *pointcloud, GeometryOwnershipType ownership = GeometryOwnershipType::Owned);
/**
* Create a new geometry set that only contains the given curve.
* Create a new geometry set that only contains the given curves.
*/
static GeometrySet create_with_curve(
static GeometrySet create_with_curves(
Curves *curves, GeometryOwnershipType ownership = GeometryOwnershipType::Owned);
/* Utility methods for access. */
@ -436,9 +436,9 @@ struct GeometrySet {
*/
bool has_volume() const;
/**
* Returns true when the geometry set has a curve component that has a curve.
* Returns true when the geometry set has a curves component that has a curves data-block.
*/
bool has_curve() const;
bool has_curves() const;
/**
* Returns true when the geometry set has any data that is not an instance.
*/
@ -461,9 +461,9 @@ struct GeometrySet {
*/
const Volume *get_volume_for_read() const;
/**
* Returns a read-only curve or null.
* Returns a read-only curves data-block or null.
*/
const Curves *get_curve_for_read() const;
const Curves *get_curves_for_read() const;
/**
* Returns a mutable mesh or null. No ownership is transferred.
@ -478,9 +478,9 @@ struct GeometrySet {
*/
Volume *get_volume_for_write();
/**
* Returns a mutable curve or null. No ownership is transferred.
* Returns a mutable curves data-block or null. No ownership is transferred.
*/
Curves *get_curve_for_write();
Curves *get_curves_for_write();
/* Utility methods for replacement. */
/**
@ -498,7 +498,7 @@ struct GeometrySet {
void replace_volume(Volume *volume,
GeometryOwnershipType ownership = GeometryOwnershipType::Owned);
/**
* Clear the existing curve and replace it with the given one.
* Clear the existing curves data-block and replace it with the given one.
*/
void replace_curve(Curves *curves,
GeometryOwnershipType ownership = GeometryOwnershipType::Owned);

View File

@ -1490,7 +1490,7 @@ void BKE_displist_make_curveTypes(Depsgraph *depsgraph,
else {
GeometrySet geometry = evaluate_curve_type_object(depsgraph, scene, ob, for_render, dispbase);
if (geometry.has_curve()) {
if (geometry.has_curves()) {
/* Assign the evaluated curve to the object's "data_eval". In addition to the curve_eval
* added to the curve here, it will also contain a copy of the original curve's data. This is
* essential, because it maintains the expected behavior for evaluated curve data from before

View File

@ -187,7 +187,7 @@ bool GeometrySet::compute_boundbox_without_instances(float3 *r_min, float3 *r_ma
if (volume != nullptr) {
have_minmax |= BKE_volume_min_max(volume, *r_min, *r_max);
}
const Curves *curves = this->get_curve_for_read();
const Curves *curves = this->get_curves_for_read();
if (curves != nullptr) {
std::unique_ptr<CurveEval> curve = curves_to_curve_eval(*curves);
/* Using the evaluated positions is somewhat arbitrary, but it is probably expected. */
@ -260,7 +260,7 @@ const Volume *GeometrySet::get_volume_for_read() const
return (component == nullptr) ? nullptr : component->get_for_read();
}
const Curves *GeometrySet::get_curve_for_read() const
const Curves *GeometrySet::get_curves_for_read() const
{
const CurveComponent *component = this->get_component_for_read<CurveComponent>();
return (component == nullptr) ? nullptr : component->get_for_read();
@ -284,7 +284,7 @@ bool GeometrySet::has_volume() const
return component != nullptr && component->has_volume();
}
bool GeometrySet::has_curve() const
bool GeometrySet::has_curves() const
{
const CurveComponent *component = this->get_component_for_read<CurveComponent>();
return component != nullptr && component->has_curves();
@ -304,8 +304,8 @@ bool GeometrySet::has_realized_data() const
bool GeometrySet::is_empty() const
{
return !(this->has_mesh() || this->has_curve() || this->has_pointcloud() || this->has_volume() ||
this->has_instances());
return !(this->has_mesh() || this->has_curves() || this->has_pointcloud() ||
this->has_volume() || this->has_instances());
}
GeometrySet GeometrySet::create_with_mesh(Mesh *mesh, GeometryOwnershipType ownership)
@ -329,7 +329,7 @@ GeometrySet GeometrySet::create_with_pointcloud(PointCloud *pointcloud,
return geometry_set;
}
GeometrySet GeometrySet::create_with_curve(Curves *curves, GeometryOwnershipType ownership)
GeometrySet GeometrySet::create_with_curves(Curves *curves, GeometryOwnershipType ownership)
{
GeometrySet geometry_set;
if (curves != nullptr) {
@ -359,7 +359,7 @@ void GeometrySet::replace_curve(Curves *curves, GeometryOwnershipType ownership)
this->remove<CurveComponent>();
return;
}
if (curves == this->get_curve_for_read()) {
if (curves == this->get_curves_for_read()) {
return;
}
this->remove<CurveComponent>();
@ -413,7 +413,7 @@ Volume *GeometrySet::get_volume_for_write()
return component == nullptr ? nullptr : component->get_for_write();
}
Curves *GeometrySet::get_curve_for_write()
Curves *GeometrySet::get_curves_for_write()
{
CurveComponent *component = this->get_component_ptr<CurveComponent>();
return component == nullptr ? nullptr : component->get_for_write();

View File

@ -957,7 +957,7 @@ static const Curves *get_evaluated_curves_from_object(const Object *object)
{
GeometrySet *geometry_set_eval = object->runtime.geometry_set_eval;
if (geometry_set_eval) {
return geometry_set_eval->get_curve_for_read();
return geometry_set_eval->get_curves_for_read();
}
return nullptr;
}

View File

@ -1041,7 +1041,7 @@ static OrderedAttributes gather_generic_curve_attributes_to_propagate(
static void gather_curves_to_realize(const GeometrySet &geometry_set,
VectorSet<const Curves *> &r_curves)
{
if (const Curves *curves = geometry_set.get_curve_for_read()) {
if (const Curves *curves = geometry_set.get_curves_for_read()) {
if (curves->geometry.curve_size != 0) {
r_curves.add(curves);
}

View File

@ -137,7 +137,7 @@ static void node_geo_exec(GeoNodeExecParams params)
geometry_set = geometry::realize_instances_legacy(geometry_set);
if (!geometry_set.has_curve()) {
if (!geometry_set.has_curves()) {
params.set_default_remaining_outputs();
return;
}

View File

@ -19,7 +19,7 @@ static void node_geo_exec(GeoNodeExecParams params)
{
GeometrySet geometry_set = params.extract_input<GeometrySet>("Curve");
geometry_set = geometry::realize_instances_legacy(geometry_set);
if (!geometry_set.has_curve()) {
if (!geometry_set.has_curves()) {
params.set_output("Curve", geometry_set);
return;
}

View File

@ -56,7 +56,7 @@ static void node_geo_exec(GeoNodeExecParams params)
GeometrySet geometry_set = params.extract_input<GeometrySet>("Curve");
geometry_set = geometry::realize_instances_legacy(geometry_set);
if (!geometry_set.has_curve()) {
if (!geometry_set.has_curves()) {
params.set_output("Curve", geometry_set);
return;
}

View File

@ -236,7 +236,7 @@ static void node_geo_exec(GeoNodeExecParams params)
GeometrySet geometry_set = params.extract_input<GeometrySet>("Curve");
geometry_set = geometry::realize_instances_legacy(geometry_set);
if (!geometry_set.has_curve()) {
if (!geometry_set.has_curves()) {
params.set_output("Curve", geometry_set);
return;
}
@ -269,7 +269,7 @@ static void node_geo_exec(GeoNodeExecParams params)
}
new_curve->attributes = curve->attributes;
params.set_output("Curve", GeometrySet::create_with_curve(curve_eval_to_curves(*new_curve)));
params.set_output("Curve", GeometrySet::create_with_curves(curve_eval_to_curves(*new_curve)));
}
} // namespace blender::nodes::node_geo_legacy_curve_spline_type_cc

View File

@ -342,7 +342,7 @@ static void node_geo_exec(GeoNodeExecParams params)
geometry_set = geometry::realize_instances_legacy(geometry_set);
if (!geometry_set.has_curve()) {
if (!geometry_set.has_curves()) {
params.set_output("Geometry", geometry_set);
return;
}
@ -358,7 +358,7 @@ static void node_geo_exec(GeoNodeExecParams params)
*curves_to_curve_eval(*component.get_for_read()), cuts);
params.set_output("Geometry",
GeometrySet::create_with_curve(curve_eval_to_curves(*output_curve)));
GeometrySet::create_with_curves(curve_eval_to_curves(*output_curve)));
}
} // namespace blender::nodes::node_geo_legacy_curve_subdivide_cc

View File

@ -283,7 +283,7 @@ static void node_geo_exec(GeoNodeExecParams params)
geometry_set = geometry::realize_instances_legacy(geometry_set);
if (!geometry_set.has_curve()) {
if (!geometry_set.has_curves()) {
params.set_output("Geometry", GeometrySet());
return;
}

View File

@ -48,7 +48,7 @@ static void node_geo_exec(GeoNodeExecParams params)
std::unique_ptr<CurveEval> curve = geometry::mesh_to_curve_convert(
component, IndexMask(selected_edge_indices));
params.set_output("Curve", GeometrySet::create_with_curve(curve_eval_to_curves(*curve)));
params.set_output("Curve", GeometrySet::create_with_curves(curve_eval_to_curves(*curve)));
}
} // namespace blender::nodes::node_geo_legacy_mesh_to_curve_cc

View File

@ -84,7 +84,7 @@ static void node_geo_exec(GeoNodeExecParams params)
break;
}
case GEO_COMPONENT_TYPE_CURVE: {
if (geometry_set.has_curve()) {
if (geometry_set.has_curves()) {
const CurveComponent *component = geometry_set.get_component_for_read<CurveComponent>();
params.set_output("Point Count", component->attribute_domain_size(ATTR_DOMAIN_POINT));
params.set_output("Spline Count", component->attribute_domain_size(ATTR_DOMAIN_CURVE));

View File

@ -161,9 +161,9 @@ static Mesh *compute_hull(const GeometrySet &geometry_set)
positions_span = varray.get_internal_span();
}
if (geometry_set.has_curve()) {
if (geometry_set.has_curves()) {
const std::unique_ptr<CurveEval> curve = curves_to_curve_eval(
*geometry_set.get_curve_for_read());
*geometry_set.get_curves_for_read());
for (const SplinePtr &spline : curve->splines()) {
positions_span = spline->evaluated_positions();
total_size += positions_span.size();
@ -202,9 +202,9 @@ static Mesh *compute_hull(const GeometrySet &geometry_set)
offset += varray.size();
}
if (geometry_set.has_curve()) {
if (geometry_set.has_curves()) {
const std::unique_ptr<CurveEval> curve = curves_to_curve_eval(
*geometry_set.get_curve_for_read());
*geometry_set.get_curves_for_read());
for (const SplinePtr &spline : curve->splines()) {
Span<float3> array = spline->evaluated_positions();
positions.as_mutable_span().slice(offset, array.size()).copy_from(array);
@ -274,8 +274,8 @@ static Mesh *convex_hull_from_instances(const GeometrySet &geometry_set)
if (set.has_mesh()) {
read_positions(*set.get_component_for_read<MeshComponent>(), transforms, &coords);
}
if (set.has_curve()) {
read_curve_positions(*curves_to_curve_eval(*set.get_curve_for_read()), transforms, &coords);
if (set.has_curves()) {
read_curve_positions(*curves_to_curve_eval(*set.get_curves_for_read()), transforms, &coords);
}
}
return hull_from_bullet(nullptr, coords);

View File

@ -113,12 +113,12 @@ static Mesh *cdt_to_mesh(const blender::meshintersect::CDT_result<double> &resul
static void curve_fill_calculate(GeometrySet &geometry_set, const GeometryNodeCurveFillMode mode)
{
if (!geometry_set.has_curve()) {
if (!geometry_set.has_curves()) {
return;
}
const std::unique_ptr<CurveEval> curve = curves_to_curve_eval(
*geometry_set.get_curve_for_read());
*geometry_set.get_curves_for_read());
if (curve->splines().is_empty()) {
geometry_set.replace_curve(nullptr);
return;

View File

@ -572,7 +572,7 @@ static void calculate_curve_fillet(GeometrySet &geometry_set,
const std::optional<Field<int>> &count_field,
const bool limit_radius)
{
if (!geometry_set.has_curve()) {
if (!geometry_set.has_curves()) {
return;
}

View File

@ -14,11 +14,11 @@ static void node_declare(NodeDeclarationBuilder &b)
static void node_geo_exec(GeoNodeExecParams params)
{
GeometrySet curve_set = params.extract_input<GeometrySet>("Curve");
if (!curve_set.has_curve()) {
if (!curve_set.has_curves()) {
params.set_default_remaining_outputs();
return;
}
const std::unique_ptr<CurveEval> curve = curves_to_curve_eval(*curve_set.get_curve_for_read());
const std::unique_ptr<CurveEval> curve = curves_to_curve_eval(*curve_set.get_curves_for_read());
float length = 0.0f;
for (const SplinePtr &spline : curve->splines()) {
length += spline->length();

View File

@ -335,7 +335,7 @@ static void node_geo_exec(GeoNodeExecParams params)
r_center,
r_normal,
r_radius);
params.set_output("Curve", GeometrySet::create_with_curve(curve_eval_to_curves(*curve)));
params.set_output("Curve", GeometrySet::create_with_curves(curve_eval_to_curves(*curve)));
params.set_output("Center", r_center);
params.set_output("Normal", r_normal);
params.set_output("Radius", r_radius);
@ -350,7 +350,7 @@ static void node_geo_exec(GeoNodeExecParams params)
params.extract_input<bool>("Connect Center"),
params.extract_input<bool>("Invert Arc"));
params.set_output("Curve", GeometrySet::create_with_curve(curve_eval_to_curves(*curve)));
params.set_output("Curve", GeometrySet::create_with_curves(curve_eval_to_curves(*curve)));
break;
}
}

View File

@ -113,7 +113,7 @@ static void node_geo_exec(GeoNodeExecParams params)
params.extract_input<float3>("End Handle"),
std::max(params.extract_input<int>("Resolution"), 1),
mode);
params.set_output("Curve", GeometrySet::create_with_curve(curve_eval_to_curves(*curve)));
params.set_output("Curve", GeometrySet::create_with_curves(curve_eval_to_curves(*curve)));
}
} // namespace blender::nodes::node_geo_curve_primitive_bezier_segment_cc

View File

@ -203,7 +203,7 @@ static void node_geo_exec(GeoNodeExecParams params)
}
if (curve) {
params.set_output("Curve", GeometrySet::create_with_curve(curve_eval_to_curves(*curve)));
params.set_output("Curve", GeometrySet::create_with_curves(curve_eval_to_curves(*curve)));
}
else {
params.set_default_remaining_outputs();

View File

@ -111,7 +111,7 @@ static void node_geo_exec(GeoNodeExecParams params)
params.extract_input<float>("Length"));
}
params.set_output("Curve", GeometrySet::create_with_curve(curve_eval_to_curves(*curve)));
params.set_output("Curve", GeometrySet::create_with_curves(curve_eval_to_curves(*curve)));
}
} // namespace blender::nodes::node_geo_curve_primitive_line_cc

View File

@ -61,7 +61,7 @@ static void node_geo_exec(GeoNodeExecParams params)
params.extract_input<float3>("Middle"),
params.extract_input<float3>("End"),
std::max(params.extract_input<int>("Resolution"), 3));
params.set_output("Curve", GeometrySet::create_with_curve(curve_eval_to_curves(*curve)));
params.set_output("Curve", GeometrySet::create_with_curves(curve_eval_to_curves(*curve)));
}
} // namespace blender::nodes::node_geo_curve_primitive_quadratic_bezier_cc

View File

@ -264,7 +264,7 @@ static void node_geo_exec(GeoNodeExecParams params)
curve->add_spline(std::move(spline));
curve->attributes.reallocate(curve->splines().size());
params.set_output("Curve", GeometrySet::create_with_curve(curve_eval_to_curves(*curve)));
params.set_output("Curve", GeometrySet::create_with_curves(curve_eval_to_curves(*curve)));
}
} // namespace blender::nodes::node_geo_curve_primitive_quadrilateral_cc

View File

@ -86,7 +86,7 @@ static void node_geo_exec(GeoNodeExecParams params)
params.extract_input<float>("End Radius"),
params.extract_input<float>("Height"),
params.extract_input<bool>("Reverse"));
params.set_output("Curve", GeometrySet::create_with_curve(curve_eval_to_curves(*curve)));
params.set_output("Curve", GeometrySet::create_with_curves(curve_eval_to_curves(*curve)));
}
} // namespace blender::nodes::node_geo_curve_primitive_spiral_cc

View File

@ -83,7 +83,7 @@ static void node_geo_exec(GeoNodeExecParams params)
std::max(params.extract_input<float>("Outer Radius"), 0.0f),
params.extract_input<float>("Twist"),
std::max(params.extract_input<int>("Points"), 3));
GeometrySet output = GeometrySet::create_with_curve(curve_eval_to_curves(*curve));
GeometrySet output = GeometrySet::create_with_curves(curve_eval_to_curves(*curve));
if (params.output_is_required("Outer Points")) {
StrongAnonymousAttributeID attribute_output("Outer Points");

View File

@ -235,7 +235,7 @@ static std::unique_ptr<CurveEval> resample_curve(const CurveComponent *component
static void geometry_set_curve_resample(GeometrySet &geometry_set,
const SampleModeParam &mode_param)
{
if (!geometry_set.has_curve()) {
if (!geometry_set.has_curves()) {
return;
}

View File

@ -20,7 +20,7 @@ static void node_geo_exec(GeoNodeExecParams params)
GeometrySet geometry_set = params.extract_input<GeometrySet>("Curve");
geometry_set.modify_geometry_sets([&](GeometrySet &geometry_set) {
if (!geometry_set.has_curve()) {
if (!geometry_set.has_curves()) {
return;
}

View File

@ -122,7 +122,7 @@ class SampleCurveFunction : public fn::MultiFunction {
}
};
if (!geometry_set_.has_curve()) {
if (!geometry_set_.has_curves()) {
return return_default();
}

View File

@ -60,7 +60,7 @@ static void node_geo_exec(GeoNodeExecParams params)
bool has_bezier_spline = false;
geometry_set.modify_geometry_sets([&](GeometrySet &geometry_set) {
if (!geometry_set.has_curve()) {
if (!geometry_set.has_curves()) {
return;
}

View File

@ -362,7 +362,7 @@ static void node_geo_exec(GeoNodeExecParams params)
Field<bool> selection_field = params.extract_input<Field<bool>>("Selection");
geometry_set.modify_geometry_sets([&](GeometrySet &geometry_set) {
if (!geometry_set.has_curve()) {
if (!geometry_set.has_curves()) {
return;
}

View File

@ -324,7 +324,7 @@ static void node_geo_exec(GeoNodeExecParams params)
Field<int> cuts_field = params.extract_input<Field<int>>("Cuts");
geometry_set.modify_geometry_sets([&](GeometrySet &geometry_set) {
if (!geometry_set.has_curve()) {
if (!geometry_set.has_curves()) {
return;
}

View File

@ -28,8 +28,8 @@ static void geometry_set_curve_to_mesh(GeometrySet &geometry_set,
const bool fill_caps)
{
const std::unique_ptr<CurveEval> curve = curves_to_curve_eval(
*geometry_set.get_curve_for_read());
const Curves *profile_curves = profile_set.get_curve_for_read();
*geometry_set.get_curves_for_read());
const Curves *profile_curves = profile_set.get_curves_for_read();
if (profile_curves == nullptr) {
Mesh *mesh = bke::curve_to_wire_mesh(*curve);
@ -48,10 +48,10 @@ static void node_geo_exec(GeoNodeExecParams params)
GeometrySet profile_set = params.extract_input<GeometrySet>("Profile Curve");
const bool fill_caps = params.extract_input<bool>("Fill Caps");
bool has_curve = false;
bool has_curves = false;
curve_set.modify_geometry_sets([&](GeometrySet &geometry_set) {
if (geometry_set.has_curve()) {
has_curve = true;
if (geometry_set.has_curves()) {
has_curves = true;
geometry_set_curve_to_mesh(geometry_set, profile_set, fill_caps);
}
geometry_set.keep_only({GEO_COMPONENT_TYPE_MESH, GEO_COMPONENT_TYPE_INSTANCES});

View File

@ -321,12 +321,12 @@ static void node_geo_exec(GeoNodeExecParams params)
attribute_outputs.rotation_id = StrongAnonymousAttributeID("Rotation");
geometry_set.modify_geometry_sets([&](GeometrySet &geometry_set) {
if (!geometry_set.has_curve()) {
if (!geometry_set.has_curves()) {
geometry_set.keep_only({GEO_COMPONENT_TYPE_INSTANCES});
return;
}
const std::unique_ptr<CurveEval> curve = curves_to_curve_eval(
*geometry_set.get_curve_for_read());
*geometry_set.get_curves_for_read());
const Span<SplinePtr> splines = curve->splines();
curve->assert_valid_point_attributes();

View File

@ -500,7 +500,7 @@ static void geometry_set_curve_trim(GeometrySet &geometry_set,
Field<float> &start_field,
Field<float> &end_field)
{
if (!geometry_set.has_curve()) {
if (!geometry_set.has_curves()) {
return;
}
@ -515,7 +515,7 @@ static void geometry_set_curve_trim(GeometrySet &geometry_set,
const blender::VArray<float> &starts = evaluator.get_evaluated<float>(0);
const blender::VArray<float> &ends = evaluator.get_evaluated<float>(1);
std::unique_ptr<CurveEval> curve = curves_to_curve_eval(*geometry_set.get_curve_for_read());
std::unique_ptr<CurveEval> curve = curves_to_curve_eval(*geometry_set.get_curves_for_read());
MutableSpan<SplinePtr> splines = curve->splines();
threading::parallel_for(splines.index_range(), 128, [&](IndexRange range) {

View File

@ -1286,7 +1286,7 @@ void separate_geometry(GeometrySet &geometry_set,
some_valid_domain = true;
}
}
if (geometry_set.has_curve()) {
if (geometry_set.has_curves()) {
if (ELEM(domain, ATTR_DOMAIN_POINT, ATTR_DOMAIN_CURVE)) {
file_ns::separate_curve_selection(geometry_set, selection_field, domain, invert);
some_valid_domain = true;

View File

@ -521,7 +521,7 @@ static void duplicate_splines(GeometrySet &geometry_set,
const Field<bool> &selection_field,
IndexAttributes &attributes)
{
if (!geometry_set.has_curve()) {
if (!geometry_set.has_curves()) {
geometry_set.keep_only({GEO_COMPONENT_TYPE_INSTANCES});
return;
}
@ -530,7 +530,7 @@ static void duplicate_splines(GeometrySet &geometry_set,
const GeometryComponent &src_component = *geometry_set.get_component_for_read(
GEO_COMPONENT_TYPE_CURVE);
const std::unique_ptr<CurveEval> curve = curves_to_curve_eval(
*geometry_set.get_curve_for_read());
*geometry_set.get_curves_for_read());
const int domain_size = src_component.attribute_domain_size(ATTR_DOMAIN_CURVE);
GeometryComponentFieldContext field_context{src_component, ATTR_DOMAIN_CURVE};
FieldEvaluator evaluator{field_context, domain_size};
@ -788,7 +788,7 @@ static void duplicate_points_curve(const GeometryComponentType component_type,
CurveComponent &curve_component = geometry_set.get_component_for_write<CurveComponent>();
const std::unique_ptr<CurveEval> curve = curves_to_curve_eval(
*geometry_set.get_curve_for_read());
*geometry_set.get_curves_for_read());
Array<int> control_point_offsets = curve->control_point_offsets();
std::unique_ptr<CurveEval> new_curve = std::make_unique<CurveEval>();
@ -933,7 +933,7 @@ static void duplicate_points(GeometrySet &geometry_set,
const Field<bool> &selection_field,
IndexAttributes &attributes)
{
if (!geometry_set.has_mesh() && !geometry_set.has_curve() && !geometry_set.has_pointcloud()) {
if (!geometry_set.has_mesh() && !geometry_set.has_curves() && !geometry_set.has_pointcloud()) {
geometry_set.keep_only({GEO_COMPONENT_TYPE_INSTANCES});
return;
}

View File

@ -141,9 +141,9 @@ static void node_geo_exec(GeoNodeExecParams params)
bool has_bezier = false;
geometry_set.modify_geometry_sets([&](GeometrySet &geometry_set) {
if (geometry_set.has_curve()) {
if (geometry_set.has_curves()) {
const std::unique_ptr<CurveEval> curve = curves_to_curve_eval(
*geometry_set.get_curve_for_read());
*geometry_set.get_curves_for_read());
has_bezier = curve->has_spline_with_type(CURVE_TYPE_BEZIER);
set_position_in_component(mode,

View File

@ -44,7 +44,7 @@ static void node_geo_exec(GeoNodeExecParams params)
Field<float> radii_field = params.extract_input<Field<float>>("Radius");
geometry_set.modify_geometry_sets([&](GeometrySet &geometry_set) {
if (geometry_set.has_curve()) {
if (geometry_set.has_curves()) {
set_radius_in_component(
geometry_set.get_component_for_write<CurveComponent>(), selection_field, radii_field);
}

View File

@ -40,7 +40,7 @@ static void node_geo_exec(GeoNodeExecParams params)
Field<float> tilt_field = params.extract_input<Field<float>>("Tilt");
geometry_set.modify_geometry_sets([&](GeometrySet &geometry_set) {
if (geometry_set.has_curve()) {
if (geometry_set.has_curves()) {
set_tilt_in_component(
geometry_set.get_component_for_write<CurveComponent>(), selection_field, tilt_field);
}

View File

@ -40,7 +40,7 @@ static void node_geo_exec(GeoNodeExecParams params)
Field<bool> cyclic_field = params.extract_input<Field<bool>>("Cyclic");
geometry_set.modify_geometry_sets([&](GeometrySet &geometry_set) {
if (geometry_set.has_curve()) {
if (geometry_set.has_curves()) {
set_cyclic_in_component(
geometry_set.get_component_for_write<CurveComponent>(), selection_field, cyclic_field);
}

View File

@ -43,10 +43,10 @@ static void node_geo_exec(GeoNodeExecParams params)
bool only_poly = true;
geometry_set.modify_geometry_sets([&](GeometrySet &geometry_set) {
if (geometry_set.has_curve()) {
if (geometry_set.has_curves()) {
if (only_poly) {
const std::unique_ptr<CurveEval> curve = curves_to_curve_eval(
*geometry_set.get_curve_for_read());
*geometry_set.get_curves_for_read());
for (const SplinePtr &spline : curve->splines()) {
if (ELEM(spline->type(), CURVE_TYPE_BEZIER, CURVE_TYPE_NURBS)) {
only_poly = false;

View File

@ -298,7 +298,7 @@ static Map<int, int> create_curve_instances(GeoNodeExecParams &params,
layout.pivot_points.add_new(layout.char_codes[i], pivot_point);
}
GeometrySet geometry_set_curve = GeometrySet::create_with_curve(
GeometrySet geometry_set_curve = GeometrySet::create_with_curves(
curve_eval_to_curves(*curve_eval));
handles.add_new(layout.char_codes[i],
instance_component.add_reference(std::move(geometry_set_curve)));

View File

@ -778,7 +778,7 @@ static void node_geo_exec(GeoNodeExecParams params)
break;
}
case GEO_NODE_ATTRIBUTE_TRANSFER_NEAREST: {
if (geometry.has_curve() && !geometry.has_mesh() && !geometry.has_pointcloud()) {
if (geometry.has_curves() && !geometry.has_mesh() && !geometry.has_pointcloud()) {
params.error_message_add(NodeWarningType::Error,
TIP_("The source geometry must contain a mesh or a point cloud"));
return return_default();

View File

@ -126,7 +126,7 @@ static void translate_geometry_set(GeometrySet &geometry,
const float3 translation,
const Depsgraph &depsgraph)
{
if (Curves *curves = geometry.get_curve_for_write()) {
if (Curves *curves = geometry.get_curves_for_write()) {
std::unique_ptr<CurveEval> curve = curves_to_curve_eval(*curves);
curve->translate(translation);
geometry.replace_curve(curve_eval_to_curves(*curve));
@ -149,7 +149,7 @@ void transform_geometry_set(GeometrySet &geometry,
const float4x4 &transform,
const Depsgraph &depsgraph)
{
if (Curves *curves = geometry.get_curve_for_write()) {
if (Curves *curves = geometry.get_curves_for_write()) {
std::unique_ptr<CurveEval> curve = curves_to_curve_eval(*curves);
curve->transform(transform);
geometry.replace_curve(curve_eval_to_curves(*curve));