# Unable to link plugins using plugregistry

**URL:** <https://forum.aousd.org/t/unable-to-link-plugins-using-plugregistry/2282>\
**Category:** USD\
**Created:** [March 5, 2025, 9:23am UTC](https://forum.aousd.org/t/unable-to-link-plugins-using-plugregistry/2282 "2025-03-05T09:23:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JasonDikken](https://avatars.discourse-cdn.com/v4/letter/j/50afbb/32.png) [@JasonDikken](https://forum.aousd.org/u/JasonDikken)\
**Post date:** [March 5, 2025, 9:23am UTC](https://forum.aousd.org/t/unable-to-link-plugins-using-plugregistry/2282/1 "2025-03-05T09:23:37Z")

</div>

**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

```auto
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](https://sea2.discourse-cdn.com/flex016/images/transparent.png)

### 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.

---

<div class="post-metadata">

**Author:** ![AbsolutViktor](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@AbsolutViktor](https://forum.aousd.org/u/AbsolutViktor)\
**Post date:** [March 6, 2025, 1:34pm UTC](https://forum.aousd.org/t/unable-to-link-plugins-using-plugregistry/2282/2 "2025-03-06T13:34:47Z")

</div>

You can try passing them in a vector such as this: [Universal Scene Description: PlugRegistry Class Reference](https://openusd.org/dev/api/class_plug_registry.html#a43fe0749d24f0dd2a909a6abf2d427f9), instead of doing it once for each plugin 🙂

---

<div class="post-metadata">

**Author:** ![spiff](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/spiff/32/22_2.png) [@spiff](https://forum.aousd.org/u/spiff)\
**Post date:** [March 6, 2025, 6:44pm UTC](https://forum.aousd.org/t/unable-to-link-plugins-using-plugregistry/2282/3 "2025-03-06T18:44:35Z")

</div>

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
