Fix T76746: Alembic, wrong result importing back exported curves

In Alembic curve topology is stored with an array of values describing
how many points each sub-curve has. Instead of writing the number of
points for the current curve, the Alembic exporter would write the
accumulated number of points.

This error has existed since the initial implementation.
This commit is contained in:
Kévin Dietrich 2022-03-31 15:01:14 +02:00
parent eb4155cc1e
commit 4c1393c202
Notes: blender-bot 2023-02-14 08:35:51 +01:00
Referenced by issue #76746, Alembic: Wrong result when exporting and importing curves
1 changed files with 2 additions and 1 deletions

View File

@ -73,6 +73,7 @@ void ABCCurveWriter::do_write(HierarchyContext &context)
Nurb *nurbs = static_cast<Nurb *>(curve->nurb.first);
for (; nurbs; nurbs = nurbs->next) {
const size_t current_point_count = verts.size();
if (nurbs->bp) {
curve_basis = Alembic::AbcGeom::kNoBasis;
curve_type = Alembic::AbcGeom::kVariableOrder;
@ -142,7 +143,7 @@ void ABCCurveWriter::do_write(HierarchyContext &context)
}
orders.push_back(nurbs->orderu);
vert_counts.push_back(verts.size());
vert_counts.push_back(verts.size() - current_point_count);
}
Alembic::AbcGeom::OFloatGeomParam::Sample width_sample;