Skip to content

Commit e56757c

Browse files
Update src/aliceVision/sfmDataIO/UsdExporter.cpp
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 4ca1517 commit e56757c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/aliceVision/sfmDataIO/UsdExporter.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,18 @@ UsdExporter::UsdExporter(const std::string & filename, double frameRate)
3838

3939
void UsdExporter::terminate()
4040
{
41-
_stage->SetStartTimeCode(_startTimeCode);
42-
_stage->SetEndTimeCode(_endTimeCode);
41+
// If no frames have been exported, _startTimeCode will still be at its sentinel value.
42+
// In that case, avoid writing invalid start/end time codes to the USD stage.
43+
if (_startTimeCode == std::numeric_limits<IndexT>::max())
44+
{
45+
ALICEVISION_LOG_WARNING("UsdExporter::terminate called but no frames have been exported; "
46+
"skipping start/end time code settings.");
47+
}
48+
else
49+
{
50+
_stage->SetStartTimeCode(_startTimeCode);
51+
_stage->SetEndTimeCode(_endTimeCode);
52+
}
4353

4454
_stage->Save();
4555
}

0 commit comments

Comments
 (0)