Skip to content

EntropyCanvas::USD::USDPluginGenerator

Generates USD plugin metadata files (plugInfo.json) for monolithic static builds. More…

#include <USDPluginGenerator.h>

Name
voidsetAppName(const std::string & appName)
Set the application name used for the plugin directory.
boolregisterPlugins()
Register the generated plugin directory with USD’s PlugRegistry.
boolinitializePlugins(const std::string & appName ="")
Convenience method that generates and registers plugins in one call.
std::optional< std::filesystem::path >getPluginDirectory()
Get the directory where plugin metadata will be written.
const std::string &getAppName()
Get the current application name.
boolgeneratePluginMetadata()
Generate all required plugInfo.json files for the monolithic USD build.
class EntropyCanvas::USD::USDPluginGenerator;

Generates USD plugin metadata files (plugInfo.json) for monolithic static builds.

In a monolithic USD build, all plugin code is statically linked into the executable, but USD still requires plugInfo.json files to discover and register plugin types (file formats, asset resolvers, etc.) at runtime.

This generator creates the necessary JSON files in an app-specific location:

  • Windows: LOCALAPPDATA%/{appName}/USD
  • Linux: ~/.cache/Entropy/{appName}/USD
  • macOS: ~/Library/Application Support/{appName}/USD
static void setAppName(
const std::string & appName
)

Set the application name used for the plugin directory.

Parameters:

  • appName The application name (e.g., “CanvasEngine”, “MyApp”)

Must be called before any other methods.

static bool registerPlugins()

Register the generated plugin directory with USD’s PlugRegistry.

Return: true if registration succeeded.

Call this after generatePluginMetadata().

static bool initializePlugins(
const std::string & appName =""
)

Convenience method that generates and registers plugins in one call.

Parameters:

  • appName Optional app name. If provided, calls setAppName() first.

Return: true if generation and registration both succeeded.

static std::optional< std::filesystem::path > getPluginDirectory()

Get the directory where plugin metadata will be written.

Return: Path to the plugin directory, or nullopt on failure.

Creates the directory if it doesn’t exist.

static const std::string & getAppName()

Get the current application name.

Return: The application name, or “EntropyApp” if not set.

static bool generatePluginMetadata()

Generate all required plugInfo.json files for the monolithic USD build.

Return: true if all plugins were generated successfully.

Should be called once during application initialization, before any USD operations.


Updated on 2026-01-26 at 17:14:35 -0500