EntropyCanvas::UsdLightSerializer
EntropyCanvas::UsdLightSerializer
Section titled “EntropyCanvas::UsdLightSerializer”Serializes Light components to USD using native UsdLux types. More…
#include <UsdLightSerializer.h>
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| bool | write(pxr::UsdStageRefPtr stage, const pxr::SdfPath & path, const Light & light) Write a Light component to a USD stage at the given path. |
| bool | read(pxr::UsdStageRefPtr stage, const pxr::SdfPath & path, Light & outLight) Read a Light component from a USD prim. |
Detailed Description
Section titled “Detailed Description”class EntropyCanvas::UsdLightSerializer;Serializes Light components to USD using native UsdLux types.
Maps Light components to:
- LightType::Sphere -> UsdLuxSphereLight (with UsdLuxShapingAPI for spot behavior)
- LightType::Distant -> UsdLuxDistantLight
Extension fields (range, bounceFactor, shadowResolution, shadowCascadeCount) are written as dynamic attributes with the entropyRender: namespace prefix.
Public Functions Documentation
Section titled “Public Functions Documentation”function write
Section titled “function write”static bool write( pxr::UsdStageRefPtr stage, const pxr::SdfPath & path, const Light & light)Write a Light component to a USD stage at the given path.
Parameters:
- stage USD stage to write to
- path Prim path for the light
- light Light component data
Return: true if successful
Creates the appropriate UsdLux prim type based on lightType and sets all standard UsdLux attributes. Extension fields are written as custom attributes with entropyRender: prefix.
function read
Section titled “function read”static bool read( pxr::UsdStageRefPtr stage, const pxr::SdfPath & path, Light & outLight)Read a Light component from a USD prim.
Parameters:
- stage USD stage to read from
- path Prim path of the light
- outLight Output light component
Return: true if successful
Reads UsdLux light attributes and extension fields back into a Light component structure.
Updated on 2026-01-26 at 17:14:35 -0500