EntropyCanvas::UsdMeshExtractor
EntropyCanvas::UsdMeshExtractor
Section titled “EntropyCanvas::UsdMeshExtractor”Extracts mesh geometry from USD stages and files. More…
#include <UsdMeshExtractor.h>
Public Classes
Section titled “Public Classes”| Name | |
|---|---|
| struct | Options Extraction options. |
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| MeshExtractionResult | extractFromStage(const pxr::UsdStageRefPtr & stage, const Options & options =defaultOptions()) =default Extract meshes from an existing USD stage. |
| MeshExtractionResult | extractFromMemory(std::span< const uint8_t > data, const std::string & formatHint =“.usdc”, const Options & options =defaultOptions()) =default Extract meshes from in-memory USD data. |
| MeshExtractionResult | extractFromFile(const std::string & filePath, const Options & options =defaultOptions()) =default Extract meshes from a USD file. |
| Options | defaultOptions() Get default extraction options. |
Detailed Description
Section titled “Detailed Description”class EntropyCanvas::UsdMeshExtractor;Extracts mesh geometry from USD stages and files.
UsdMeshExtractor traverses USD stages and extracts UsdGeomMesh prims, converting them to a render-ready format (triangulated, indexed).
Features:
- Triangulates n-gon faces
- Extracts positions, normals, UVs
- Computes bounds
- Handles face-varying primvars
Usage: // From in-memory bytes (e.g., from asset system) auto result = UsdMeshExtractor::extractFromMemory(bytes, “.usdc”);
// From existing stage auto result = UsdMeshExtractor::extractFromStage(stagePtr);
// From file path auto result = UsdMeshExtractor::extractFromFile(“/path/to/mesh.usd”);
Public Functions Documentation
Section titled “Public Functions Documentation”function extractFromStage
Section titled “function extractFromStage”static MeshExtractionResult extractFromStage( const pxr::UsdStageRefPtr & stage, const Options & options =defaultOptions()) =defaultExtract meshes from an existing USD stage.
Parameters:
- stage USD stage pointer
- options Extraction options
Return: Extraction result with mesh data
function extractFromMemory
Section titled “function extractFromMemory”static MeshExtractionResult extractFromMemory( std::span< const uint8_t > data, const std::string & formatHint =".usdc", const Options & options =defaultOptions()) =defaultExtract meshes from in-memory USD data.
Parameters:
- data Raw USD file bytes (.usd, .usda, .usdc)
- formatHint File extension hint (e.g., “.usdc”, “.usda”)
- options Extraction options
Return: Extraction result with mesh data
function extractFromFile
Section titled “function extractFromFile”static MeshExtractionResult extractFromFile( const std::string & filePath, const Options & options =defaultOptions()) =defaultExtract meshes from a USD file.
Parameters:
- filePath Path to USD file
- options Extraction options
Return: Extraction result with mesh data
function defaultOptions
Section titled “function defaultOptions”static inline Options defaultOptions()Get default extraction options.
Updated on 2026-01-26 at 16:50:32 -0500