We are in the unfortunate situation where we need to link two instances of USD into the same process. We have different namespaces for the two instances but it appears that the plugin loading system doesn’t namespace or distinguish things in a way where the two versions are isolated on MacOS.
Here is the part of the callstack where usd moves between the two usd instances: (libusd_ms.dylib -->bananausdplug.dylib)
frame #18: 0x00000003ff52c164 bananausd_tf.dylib`bananaInternal_v23_2__pxrReserved__::Tf_RegistryInit::Add(libName="MFB_ALT_PACKAGE_NAME", func=(bananausd_plug.dylib`bananaInternal_v23_2__pxrReserved__::_Tf_RegistryFunction31(bananaInternal_v23_2__pxrReserved__::TfDebug*, void*) at debugCodes.cpp:32), typeName="TfDebug")(void*, void*), char const*) at registryManager.cpp:630:13
frame #19: 0x00000003ff490834 bananausd_tf.dylib`void bananaInternal_v23_2__pxrReserved__::Tf_RegistryInit::Add<bananaInternal_v23_2__pxrReserved__::TfDebug, void>(libName="MFB_ALT_PACKAGE_NAME", func=(bananausd_plug.dylib`bananaInternal_v23_2__pxrReserved__::_Tf_RegistryFunction31(bananaInternal_v23_2__pxrReserved__::TfDebug*, void*) at debugCodes.cpp:32), typeName="TfDebug")(bananaInternal_v23_2__pxrReserved__::TfDebug*, void*), char const*) at registryManager.h:150:9
frame #20: 0x00000003fea51f58 bananausd_plug.dylib`bananaInternal_v23_2__pxrReserved__::_Tf_RegistryAdd31((null)=0x00006000066ab7e0) at debugCodes.cpp:31:1
frame #21: 0x00000004c5c512c8 libusd_ms.dylib`pxrInternal_v0_23__pxrReserved__::(anonymous namespace)::AddImage(mach_header const*, long) + 168
frame #22: 0x00000004c5c511c8 libusd_ms.dylib`pxrInternal_v0_23__pxrReserved__::(anonymous namespace)::InstallDyldCallbacks() + 72
frame #23: 0x00000001882b81d8 dyld`invocation function for block in dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const::$_0::operator()() const + 168
frame #24: 0x00000001882f9e94 dyld`invocation function for block in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 340
frame #25: 0x00000001882ed1a4 dyld`invocation function for block in dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 528
Any thoughts on how we can make this work?