Is there a way to disable / enable plugin

Hello!
I am searching for a way to disable a plugin through plugInfo.json or during runtime.
I would expect something like :

{
    "Includes": [ "*/resources/" ],
    "Excludes": [ "myPlugin/resources" ]
}

Or something in PlugRegistry.
But nothing was found. Anyone has an idea?

Thanks!

Hi @colin, there isn’t any such plugInfo-based mechanism. Internally, we add a pixarInit.cpp into our build of libplug, which defines a second, lower-priority ARCH_CONSTRUCTOR that further modifies the search paths used by the PlugRegistry. We do some really boutique stuff in there, like decide which of a set of Presto plugins to load, depending on which RenderMan version our configuration is using, and also excluding whole classes of plugins depending on what DCC is using USD.
Don’t know if that’s helpful, and I haven’t asked around about how we’d feel about adding a plugInfo-based exclusion mechanism. I could imagine it being tricky if multiple plugInfos could express exclusions, and/especially if exclusions about paths that are not subpaths of the dir containing the plugInfo…

Thanks @spiff for the clarification.
It’s help a bit :slight_smile:

Wanted to follow up here on @Manuel.Koster’s ASWF slack here, for greater visibility. We discussed the problem of “From a potential multitude of plugins vying to fulfill a particular extension point, how can you flexibly and reliably select one?”

What seemed both flexible and following precedent to us is something like what we provide for the (incredibly undiscoverable, currently) TfEnvSettings mechanism. That is, you get to have a single configuration file (which we’d propose would be json) that can contain a sub-dictionary for any extension point (e.g. ArResolver, HioImage, SdfFileFormat, etc) that the extension can document its contents and use to select among competitors.

By default it would live in the top-level of the build install, but you’d be able to configure its defaul location as part of the build, and override via env var for systems where env var support is reasonable.

We would likely make critical plugin points protect themselves from overrides for reliability/reproducibility, such as the usd, usda, usdc, and usdz FileFormat extensions/plugins, whereas others might simply warn but allow you to override (usdAbc, usdMtlx ?)

This mechanism might be amenable also to @colin 's original desire to specify include/exclude rules for Plug discovery itself…

Thank you very much @spiff ! Something like this global extension/plugin config would definitely work for us!

I’ve created a GH issue for this functionality. Plugin/Extension loading & choosing configuration · Issue #3902 · PixarAnimationStudios/OpenUSD