GltfAsset class final

The decoded result of a glTF or GLB file.

A ModelDocument, so materials, images and surfaces use the shared abstraction rather than glTF-specific types: the uploader and the OBJ decoder then speak the same language, and glTF-shaped concepts stay inside the decoder.

Inheritance

Constructors

GltfAsset({required List<ModelSurface> surfaces, required List<SurfaceMaterial> materials, required List<EncodedImage> images, required List<String> warnings, required List<ModelNode> nodes, required List<int> roots, List<AnimationClip> animations = const <AnimationClip>[], List<ModelSkin> skins = const <ModelSkin>[], List<ModelLight> lights = const <ModelLight>[], List<ModelCamera> cameras = const <ModelCamera>[], List<ModelSplat> splats = const <ModelSplat>[], DocumentAsset? asset, List<String> variants = const <String>[]})
A decoded file; every list not given is empty and asset null.
const

Properties

animations → List<AnimationClip>
Clips that drive nodes. Empty for formats that carry no animation.
final
asset → DocumentAsset?
What the source file said about itself. Null for a format that carries no such block, or a document nobody has set one on.
final
cameras → List<ModelCamera>
Cameras a node in nodes may point at, by ModelNode.cameraIndex. Empty for formats that carry none — OBJ and .f3d among them.
final
hashCode → int
The hash code for this object.
no setterinherited
images → List<EncodedImage>
The encoded images the materials' texture bindings refer to by index.
final
lights → List<ModelLight>
Punctual lights a node in nodes may point at, by ModelNode.lightIndex — fmt-28's own row. Empty for formats that carry no light, which is every one of them except glTF's own KHR_lights_punctual.
final
materials → List<SurfaceMaterial>
The materials surfaces refer to by index.
final
nodes → List<ModelNode>
The real glTF hierarchy, not the flat default: animation targets nodes by index, and a node that moves has to take its subtree with it.
final
roots → List<int>
Indices into nodes with no parent.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
skins → List<ModelSkin>
Skeletons. Empty for formats that carry no skinning.
final
splats → List<ModelSplat>
KHR_gaussian_splatting primitives, one per node that draws one.
final
surfaces → List<ModelSurface>
Every drawable piece of the model: a mesh, its material index and its transform.
final
triangleCount → int
Count of triangles across every surface's mesh.
no setterinherited
variants → List<String>
Names of the material variants a surface may switch to — KHR_materials_variants. A surface's own ModelSurface.variantMaterials says which material it wears in each, by index into this list. Empty for the models that come in one look, which is nearly all of them and every format but glTF and .f3d.
final
vertexCount → int
Count of vertices across every surface's mesh.
no setterinherited
warnings → List<String>
Non-fatal findings from decoding: ignored extensions, skipped primitives, unresolved references. Surfaced rather than logged so callers can decide whether to care.
final

Methods

computeBounds() → Aabb3
Bounds in the model's own space.
inherited
maskUnder(String name) → AnimationMask
The joints at and under the node called name, as a mask a layer takes.
inherited
maskUnderIndex(int root) → AnimationMask
The same, from an index into nodes.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited