From 4c1393c202d41422c16d7ccb04f90a3661525f6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dietrich?= Date: Thu, 31 Mar 2022 15:01:14 +0200 Subject: 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. --- source/blender/io/alembic/exporter/abc_writer_curves.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/io/alembic/exporter/abc_writer_curves.cc b/source/blender/io/alembic/exporter/abc_writer_curves.cc index 95f296c2cf7..07bce8fcf7a 100644 --- a/source/blender/io/alembic/exporter/abc_writer_curves.cc +++ b/source/blender/io/alembic/exporter/abc_writer_curves.cc @@ -73,6 +73,7 @@ void ABCCurveWriter::do_write(HierarchyContext &context) Nurb *nurbs = static_cast(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; -- cgit v1.2.3