Skip to content

Commit

Permalink
Update AiMsgSetConsoleFlags to use AiUniverse argument (#1003) (#1004)
Browse files Browse the repository at this point in the history
Co-authored-by: Julian Hodgson <[email protected]>
  • Loading branch information
jhodgson and Julian Hodgson authored Jan 14, 2022
1 parent a7603f0 commit 577842d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion ndr/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,14 @@ UsdStageRefPtr NdrArnoldGetShaderDefs()
auto stage = UsdStage::CreateInMemory("__ndrArnoldShaderDefs.usda");

// We expect the existing arnold universe to load the plugins.
const auto hasActiveUniverse = AiUniverseIsActive();
const auto hasActiveUniverse = AiArnoldIsActive();
if (!hasActiveUniverse) {
AiBegin(AI_SESSION_BATCH);
#if ARNOLD_VERSION_NUMBER >= 70100
AiMsgSetConsoleFlags(nullptr, AI_LOG_NONE);
#else
AiMsgSetConsoleFlags(AI_LOG_NONE);
#endif
}

auto* nodeIter = AiUniverseGetNodeEntryIterator(AI_NODE_SHADER);
Expand Down
2 changes: 1 addition & 1 deletion translator/reader/registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void UsdArnoldReaderRegistry::RegisterPrimitiveReaders()
// If a universe is already active, we can just use it, otherwise we need to
// call AiBegin.
// But if we do so, we'll have to call AiEnd() when we finish
if (!AiUniverseIsActive()) {
if (!AiArnoldIsActive()) {
AiBegin();
universeCreated = true;
}
Expand Down
2 changes: 1 addition & 1 deletion translator/writer/registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ UsdArnoldWriterRegistry::UsdArnoldWriterRegistry(bool writeBuiltin)
// If a universe is already active, we can just use it, otherwise we need to
// call AiBegin.
// But if we do so, we'll have to call AiEnd() when we finish
if (!AiUniverseIsActive()) {
if (!AiArnoldIsActive()) {
AiBegin();
universeCreated = true;
}
Expand Down

0 comments on commit 577842d

Please sign in to comment.