API Reference · Model and texture loading

GltfModel

Namespace: Ava3D

public sealed class GltfModel

Everything a .glb had in it: the nodes, and the clips, shapes and materials that drive them.

GltfLoader.Load hands back a Scene and throws the rest away, which is right for a file that is only geometry. GltfLoader.LoadModel hands back this instead, and it is the door to everything a character file carries.

It is one GltfInstance placed in one GltfModel.Scene. GltfModel.Asset is the file it came from, and a second copy of the model is model.Asset.Instantiate().AddTo(model.Scene) — no second parse, no second upload.

Properties

MemberDescription
Animator Animator { get; }

The player for GltfModel.Clips. Always present, and does nothing at all until something is played — a file with no clips gets an animator with no states rather than a null to check.

IReadOnlyList<AppearanceParameter> Appearance { get; }

Everything adjustable about this model, described well enough to build a panel from without knowing what the model is: a slider per shape parameter over its own range, a colour control per named material.

This is the reason the names are discovered rather than declared. A caller that walks this list works on the next character too.

GltfAsset Asset { get; }

The file, read once. Instantiate it again for another copy of the model.

IReadOnlyList<AnimationClip> Clips { get; }

The clips the file declared, in its own order. Empty for a file with no animation.

IReadOnlyList<GltfDiagnostic> Diagnostics { get; }

What the reader could not carry over from the file. See GltfAsset.Diagnostics.

GltfInstance Instance { get; }

The instance this model is: the same nodes, clips and materials, as one object.

MaterialLookup Materials { get; }

The materials, by the names the file gave them.

Node Root { get; }

The node the file's own roots hang from. Move this to move the model.

Scene Scene { get; }

The scene the model was loaded into. Assign it to Ava3DView.Scene.

MorphShapes Shape { get; }

The morph targets, as named parameters. See MorphShapes for the pairing.

IReadOnlyList<Skin> Skins { get; }

The skeletons the file declared, if any.

See also