Skip to content

Commit adc75f3

Browse files
Fabien Servantservantftransperfect
authored andcommitted
Alembic exporter was not creating a valid abc
1 parent 9545f52 commit adc75f3

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/aliceVision/sfmDataIO/AlembicExporter.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,25 @@ void AlembicExporter::addSurveys(const sfmData::SurveyPoints & points)
623623
{
624624
OPoints outPoints(_dataImpl->_mvgSurveys, "surveys");
625625
OPointsSchema& pSchema = outPoints.getSchema();
626+
627+
//Build positions for abc visualisation
628+
std::vector<V3f> positions;
629+
for (const auto & [viewId, vsp] : points)
630+
{
631+
for (const auto & sp : vsp)
632+
{
633+
positions.emplace_back(sp.point3d[0], -sp.point3d[1], -sp.point3d[2]);
634+
}
635+
}
636+
637+
//Fake indices
638+
std::vector<Alembic::Util::uint64_t> ids(positions.size());
639+
std::iota(begin(ids), end(ids), 0);
640+
641+
OPointsSchema::Sample psamp(std::move(V3fArraySample(positions)), std::move(UInt64ArraySample(ids)));
642+
pSchema.set(psamp);
643+
644+
//Now, store information useful for AliceVision
626645
OCompoundProperty userProps = pSchema.getUserProperties();
627646

628647
std::vector<IndexT> indices;

0 commit comments

Comments
 (0)