EntropyCanvas::USD::USDPluginGenerator
EntropyCanvas::USD::USDPluginGenerator
Section titled “EntropyCanvas::USD::USDPluginGenerator”Generates USD plugin metadata files (plugInfo.json) for monolithic static builds. More…
#include <USDPluginGenerator.h>
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| void | setAppName(const std::string & appName) Set the application name used for the plugin directory. |
| bool | registerPlugins() Register the generated plugin directory with USD’s PlugRegistry. |
| bool | initializePlugins(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. |
| bool | generatePluginMetadata() Generate all required plugInfo.json files for the monolithic USD build. |
Detailed Description
Section titled “Detailed Description”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
Public Functions Documentation
Section titled “Public Functions Documentation”function setAppName
Section titled “function setAppName”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.
function registerPlugins
Section titled “function registerPlugins”static bool registerPlugins()Register the generated plugin directory with USD’s PlugRegistry.
Return: true if registration succeeded.
Call this after generatePluginMetadata().
function initializePlugins
Section titled “function initializePlugins”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.
function getPluginDirectory
Section titled “function getPluginDirectory”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.
function getAppName
Section titled “function getAppName”static const std::string & getAppName()Get the current application name.
Return: The application name, or “EntropyApp” if not set.
function generatePluginMetadata
Section titled “function generatePluginMetadata”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