Unable to link plugins using plugregistry

Issue: Only the first plugin directory gets registered in USD’s PlugRegistry

I’m trying to register multiple USD plugins using pxr::PlugRegistry::RegisterPlugins(). However, only the first directory string it reads gets registered, and the others are ignored. I’m doing this manually, since I’m an intern and I’m trying to export objects from a simulation model.

Code snippet:

cpp

pxr::PlugRegistry::GetInstance().RegisterPlugins("path/to/plugin1");
pxr::PlugRegistry::GetInstance().RegisterPlugins("path/to/plugin2");
pxr::PlugRegistry::GetInstance().RegisterPlugins("path/to/plugin3");

Only plugin1 gets registered, while plugin2 and plugin3 are missing when I try to retrieve them with GetPluginWithName(). It does matter what order I put the plugins in since only the first string (or even the first string in a string vector) gets registered.

Screenshot 2025-02-27 150803

What I found:

It seems that USD caches plugin discovery on the first call to RegisterPlugins(), so calling it multiple times with different paths doesn’t work. I tried looping.

Can anyone explain if I’m doing anything wrong? I’m also open to other solutions to link the plugins.

You can try passing them in a vector such as this: Universal Scene Description: PlugRegistry Class Reference, instead of doing it once for each plugin :slight_smile:

Hi @JasonDikken , that is very much counter to our expectations. You should be able to register more plugins at any time… the PlugRegistry will send out notifications to clients/subsystems that may need to be aware that new plugins have been discovered.

The only thing we can think of that may be blocking you is that Plug will issue an error if you try to register more than one plugin of the same name, though you should also see an error issued if that is the case.

Cheers,
–spiff