Skip to content

Commit

Permalink
Merge pull request #825 from charlesfleche/dev_667_support_recent_ale…
Browse files Browse the repository at this point in the history
…mbic

Fix compatibility for AbcCoreOgawa::ReadArchive with Alembic>=1.7.9

(Internal change: 1973396)
  • Loading branch information
pixar-oss committed May 29, 2019
2 parents 10310a3 + 4f5601e commit 7d481ef
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pxr/usd/plugin/usdAbc/alembicReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,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,
"Use mmap when reading from an Ogawa archive.");
#endif

namespace {

using namespace ::Alembic::AbcGeom;
Expand Down Expand Up @@ -1370,8 +1376,16 @@ _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;
}

Expand Down

0 comments on commit 7d481ef

Please sign in to comment.