From fa309b574a27994d201f95a06008b62fb9f41774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles=20Fl=C3=A8che?= Date: Wed, 17 Apr 2019 14:31:32 -0400 Subject: [PATCH 1/2] Fix compatibility for AbcCoreOgawa::ReadArchive with Alembic>=1.7.9 --- pxr/usd/plugin/usdAbc/alembicReader.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pxr/usd/plugin/usdAbc/alembicReader.cpp b/pxr/usd/plugin/usdAbc/alembicReader.cpp index 60b30d628f..245c2eb62a 100644 --- a/pxr/usd/plugin/usdAbc/alembicReader.cpp +++ b/pxr/usd/plugin/usdAbc/alembicReader.cpp @@ -95,6 +95,12 @@ TF_DEFINE_ENV_SETTING( USD_ABC_XFORM_PRIM_COLLAPSE, true, "Collapse Xforms containing a single geometry into a single geom Prim in USD"); +#if ALEMBIC_LIBRARY_VERSION >= 10709 +TF_DEFINE_ENV_SETTING( + USD_ABC_READ_ARCHIVE_USE_MMAP, false, + "Collapse Xforms containing a single geometry into a single geom Prim in USD"); +#endif + namespace { using namespace ::Alembic::AbcGeom; @@ -1369,8 +1375,13 @@ _ReaderContext::_OpenOgawa( std::recursive_mutex** mutex) const { *format = "Ogawa"; + #if ALEMBIC_LIBRARY_VERSION >= 10709 + *result = IArchive(Alembic::AbcCoreOgawa::ReadArchive(_GetNumOgawaStreams(), TfGetEnvSetting(USD_ABC_READ_ARCHIVE_USE_MMAP)), + filePath, ErrorHandler::kQuietNoopPolicy); + #else *result = IArchive(Alembic::AbcCoreOgawa::ReadArchive(_GetNumOgawaStreams()), filePath, ErrorHandler::kQuietNoopPolicy); + #endif return *result; } From 4f5601ecd49150dccbd51147f488d89c0509f637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles=20Fl=C3=A8che?= Date: Wed, 15 May 2019 20:36:30 -0400 Subject: [PATCH 2/2] Update USD_ABC_READ_ARCHIVE_USE_MMAP environment variable doc --- pxr/usd/plugin/usdAbc/alembicReader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pxr/usd/plugin/usdAbc/alembicReader.cpp b/pxr/usd/plugin/usdAbc/alembicReader.cpp index 245c2eb62a..9981e586c3 100644 --- a/pxr/usd/plugin/usdAbc/alembicReader.cpp +++ b/pxr/usd/plugin/usdAbc/alembicReader.cpp @@ -98,7 +98,7 @@ TF_DEFINE_ENV_SETTING( #if ALEMBIC_LIBRARY_VERSION >= 10709 TF_DEFINE_ENV_SETTING( USD_ABC_READ_ARCHIVE_USE_MMAP, false, - "Collapse Xforms containing a single geometry into a single geom Prim in USD"); + "Use mmap when reading from an Ogawa archive."); #endif namespace {