Does omniverse support custom SceneIndex plugin?

Hi,

I developed a SceneIndex plugin and integrated it into Omniverse.

While the plugin successfully loads, it doesn’t appear to be registered because TF_REGISTRY_FUNCTION is not called. I veryfiedthis by adding std::cout within the macro’s scope.

Does Omniverse support the registration of SceneIndex plugin?

Operating System:
Windows
Linux
Kit Version:
110 (Kit App Template)
109 (Kit App Template)
108 (Kit App Template)
107 (Kit App Template)
106 (Kit App Template)
105 (Launcher)
Kit Template:
USD Composer
USD Explorer
USD Viewer
Custom
GPU Hardware:
A series (Blackwell)
A series (ADA)
A series
50 series
40 series
30 series
GPU Driver:
Latest
Recommended (573.xx)
Other
Work Flow:
Main Issue:
Reproduction Steps:
Error Code:

What do you mean by “registered”? Registered with what or whom? If the extension works, that should be enough.

Hi Richard,

From what I understand, to use a custom SceneIndex, I need to register it to Hydra by calling HdSceneIndexPluginRegistry::GetInstance().RegisterSceneIndexForRenderer within the TF_REGISTRY_FUNCTION macro. To verify this, I added std::cout statement inside the macro, but it’s doesn’t seem to be executing.

I initially suspected Omniverse might not support custom ScenIndex registration because of Fabric integration, but base on your response, it sounds like it is indeed allowed?

I am not familiar with this, but this is from our AI.

Your understanding is almost right, but it’s missing an important distinction: registering a scene index plugin with Hydra 2.0 does use HdSceneIndexPluginRegistry::GetInstance().RegisterSceneIndexForRenderer inside TF_REGISTRY_FUNCTION, but that’s only one of the ways a custom scene index can be hooked into the pipeline. docs.omniverse.nvidia

What Hydra 2.0 expects

In Hydra 2.0, a scene index is any class deriving from HdSceneIndexBase (often via HdSingleInputFilteringSceneIndexBase) that participates in the scene-index graph. docs.omniverse.nvidia

You can integrate such a scene index in three main ways: docs.omniverse.nvidia

  • Renderer‑specific plugin
    Implement HdSceneIndexPlugin, and register it in a TF_REGISTRY_FUNCTION(HdSceneIndexPlugin) block using HdSceneIndexPluginRegistry::RegisterSceneIndexForRenderer(...). docs.omniverse.nvidia
    This is the pattern you’re quoting, and it’s how renderer‑specific filters are automatically inserted between the app’s merging scene index and the renderer.

  • Application‑specific registration at startup
    An app can call HdSceneIndexPluginRegistry::GetInstance().RegisterSceneIndexForRenderer directly at startup, passing a callback that returns your scene index given the input scene. docs.omniverse.nvidia
    The Hydra guide shows this as _AppendAppFilterSceneIndexCallback(...) registered from AppStartup(). docs.omniverse.nvidia

  • Manual insertion in your own scene-index graph
    If you own the Hydra integration (e.g., in a custom app or renderer), you can bypass the plugin registry and explicitly insert your scene index into the graph (for example via HdRenderIndex::InsertSceneIndex or by composing your own HdMergingSceneIndex chain). docs.omniverse.nvidia

Only the first two rely on RegisterSceneIndexForRenderer; manual insertion does not. docs.omniverse.nvidia

The TF_REGISTRY_FUNCTION pattern

The Hydra 2.0 Getting Started Guide gives exactly the pattern you described for a scene index plugin that should be auto‑loaded: docs.omniverse.nvidia

  • First, define your plugin type:
    TF_REGISTRY_FUNCTION(TfType)
    {
        HdSceneIndexPluginRegistry::Define<MyFilterPlugin>();
    }
    
  • Then, register it with the plugin registry:
    TF_REGISTRY_FUNCTION(HdSceneIndexPlugin)
    {
        const HdSceneIndexPluginRegistry::InsertionPhase insertionPhase = 1000;
    
        HdSceneIndexPluginRegistry::GetInstance().RegisterSceneIndexForRenderer(
            "GL",   // or "Prman", or "" for any renderer
            MyFilterPlugin,
            /*inputArgs=*/nullptr,
            insertionPhase,
            HdSceneIndexPluginRegistry::InsertionOrderAtEnd);
    }
    
  • Your MyFilterPlugin derives from HdSceneIndexPlugin and implements _AppendSceneIndex(...) to wrap the incoming scene index in your custom filter. docs.omniverse.nvidia

So: if you want a USD plugin that Hydra discovers via plugInfo and auto‑inserts in the renderer’s pipeline, then yes — this TF_REGISTRY_FUNCTION + RegisterSceneIndexForRenderer pattern is the recommended mechanism. docs.omniverse.nvidia

How this maps to Omniverse

Omniverse builds on standard Hydra 2.0 concepts: custom filters that should apply when a given renderer is active are typically implemented as HdSceneIndexPlugin subclasses plus plugInfo registration, exactly as in the upstream Hydra docs. github

However, Omniverse Kit also has its own higher‑level integration points (e.g., an extension managing Hydra renderers) and may insert additional scene indices on its own. In those cases:

  • If you are writing a generic Hydra 2.0 scene index plugin (usable in usdview or other Hydra apps), you should follow the plugin pattern above. docs.omniverse.nvidia
  • If you control the Omniverse app/extension and the Hydra setup, you can build or modify the scene‑index chain directly instead of relying on RegisterSceneIndexForRenderer. github

So the accurate statement is:

To expose a custom scene index as a Hydra 2.0 plugin that is auto‑discovered and auto‑inserted for specific renderers, you must register it via HdSceneIndexPluginRegistry::RegisterSceneIndexForRenderer from a TF_REGISTRY_FUNCTION(HdSceneIndexPlugin) block, and provide the corresponding plugInfo entry.

But it is not the only way to use a custom scene index in Omniverse/Hydra—manual insertion into your app’s scene‑index graph is also valid, and doesn’t require the registry. docs.omniverse.nvidia

Thank you for the information. I think the answer generally works but Omniverse doesn’t seem to support it.

This code in my extension displays a message.

TF_REGISTRY_FUNCTION(TfType)
{
std::cout << "test";
}

But, this doesn’t.

TF_REGISTRY_FUNCTION(HdSceneIndexPlugin)
{
std::cout << "test";
}

And even thought I call RegisterSceneIndexForRenderer in TF_REGISTRY_FUNCTION(TfType) to register my scene index, Hydra doesn’t seem to be utilizing it.