API

Interface UsdAssetContainer

Scene-independent USD result. Pass to addToScene; remove before calling disposeUsd.

interface UsdAssetContainer {
    animationGroups?: AnimationGroup[];
    camera?: Camera;
    cameras?: Camera[];
    clearColor?: GPUColorDict;
    diagnostics: UsdDiagnostics;
    entities: (SceneNode | LightBase)[];
    flowGraphRuntimes?: Promise<readonly FgRuntime[]>;
    flowGraphs?: LoadedFlowGraph[];
    materialVariants?: MaterialVariantData;
    skeletons?: Skeleton[];
    xmpMetadata?: { assetPacket?: unknown; packets: unknown[] };
}

Hierarchy (View Summary)

Index
animationGroups?: AnimationGroup[]

Animation groups from the file. addToScene() registers them with the scene-owned AnimationManager by default.

camera?: Camera

Camera parsed from the file. addToScene() sets it as scene.camera when present.

cameras?: Camera[]

Cameras imported after enableGltfCameras() is called, in node-encounter order. Each is parented to its source node, so it inherits that node's animation and hierarchy live. Unlike camera, addToScene() never auto-activates one — pick one explicitly and assign it to scene.camera.

clearColor?: GPUColorDict

Scene background color declared in the file. addToScene() applies it to scene.clearColor.

diagnostics: UsdDiagnostics
entities: (SceneNode | LightBase)[]

Scene entities. glTF: [root TransformNode]. .babylon: root nodes + lights.

flowGraphRuntimes?: Promise<readonly FgRuntime[]>

Resolves after addToScene() has instantiated all loaded flow graphs.

flowGraphs?: LoadedFlowGraph[]

Flow graphs parsed from the file (glTF KHR_interactivity). addToScene() binds and runs them via the scene's frame loop.

materialVariants?: MaterialVariantData

KHR_materials_variants data. Use selectVariant() / getVariantNames() to interact.

skeletons?: Skeleton[]

Bone-control handles, one per glTF skin. Present only when enableBoneControl() was called before loading; otherwise undefined. Drive bones via getBoneByName() + the setBone* functions.

xmpMetadata?: { assetPacket?: unknown; packets: unknown[] }

KHR_xmp_json_ld metadata. packets are the JSON-LD packets declared at the document level; assetPacket is the packet referenced by asset (if any).