Skip to content

Commit 46d1910

Browse files
Merge pull request #2037 from alicevision/dev/updateExport
ExportAlembic has an option to export point cloud
2 parents 306356c + f17823f commit 46d1910

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

meshroom/aliceVision/ExportAlembic.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ class ExportAlembic(desc.AVCommandLineNode):
2828
value=24.0,
2929
range=(1.0, 60.0, 1.0),
3030
),
31+
desc.BoolParam(
32+
name="exportLandmarks",
33+
label="Export Landmarks",
34+
description="If true, export SfM landmarks.",
35+
value=False,
36+
),
3137
desc.ChoiceParam(
3238
name="verboseLevel",
3339
label="Verbose Level",

meshroom/aliceVision/ExportMaya.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,13 @@ def processChunk(self, chunk):
154154
abcString = f'AbcImport -mode open -fitTimeRange "{alembic}";'
155155

156156
mesh = chunk.node.mesh.value
157-
objString = f'file -import -type "OBJ" -ignoreVersion -ra true -mbl true -mergeNamespacesOnClash false -namespace "mesh" -options "mo=1" -pr -importTimeRange "combine" "{mesh}";'
157+
objString = ''
158+
if len(mesh) > 0:
159+
if mesh.lower().endswith('.obj'):
160+
objString = f'file -import -type "OBJ" -ignoreVersion -ra true -mbl true -mergeNamespacesOnClash false -namespace "mesh" -options "mo=1" -pr -importTimeRange "combine" "{mesh}";'
161+
else:
162+
chunk.logger.error("Undefined mesh format for maya import")
163+
158164

159165
framePath = chunk.node.images.value.replace('<INTRINSIC_ID>', str(minIntrinsicId)).replace('<FILESTEM>', minFrameName)
160166

src/software/export/main_exportAlembic.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ int aliceVision_main(int argc, char** argv)
3434

3535
// User optional parameters
3636
double frameRate = 24.0;
37+
bool exportLandmarks = false;
3738

3839
// clang-format off
3940
po::options_description requiredParams("Required parameters");
@@ -46,7 +47,9 @@ int aliceVision_main(int argc, char** argv)
4647
po::options_description optionalParams("Optional parameters");
4748
optionalParams.add_options()
4849
("frameRate", po::value<double>(&frameRate)->default_value(frameRate),
49-
"Define the camera's Frames per seconds.");
50+
"Define the camera's Frames per seconds.")
51+
("exportLandmarks", po::value<bool>(&exportLandmarks)->default_value(exportLandmarks),
52+
"Are the landmarks exported ?.");
5053
// clang-format on
5154

5255
CmdLine cmdline("AliceVision exportAnimatedCamera");
@@ -180,5 +183,11 @@ int aliceVision_main(int argc, char** argv)
180183
}
181184
}
182185

186+
if (exportLandmarks)
187+
{
188+
sfmData::LandmarksUncertainty emptyUncertainty;
189+
exporter.addLandmarks(sfmData.getLandmarks(), emptyUncertainty, false, false);
190+
}
191+
183192
return EXIT_SUCCESS;
184193
}

0 commit comments

Comments
 (0)