Class GltfModel
A binary glTF asset, with reusable geometry, skeletons and embedded images.
Inherited Members
Namespace: Simple3D.Core
Assembly: Simple3D.Core.dll
Syntax
public sealed class GltfModel
Properties
| Edit this page View SourceExpressions
VRM expressions, keyed by lowercase preset or exact custom name. VRM 1 presets also expose VRM 0 aliases.
Declaration
public IReadOnlyDictionary<string, GltfExpression> Expressions { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyDictionary<string, GltfExpression> |
HumanoidBones
VRM bone names mapped to joint indices in the skeleton of the first skin; unmapped nodes are omitted.
Declaration
public IReadOnlyDictionary<string, int> HumanoidBones { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyDictionary<string, int> |
Images
Encoded images in glTF order.
Declaration
public IReadOnlyList<GltfImage> Images { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<GltfImage> |
Skeletons
Skeletons, one per armature: skins whose shared joints have equal inverse bind matrices are merged. Joints are ordered parents-first.
Declaration
public IReadOnlyList<Skeleton> Skeletons { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<Skeleton> |
Methods
| Edit this page View SourceApplyExpressions(Shape, IReadOnlyDictionary<string, float>)
Blends named expressions into every node of shape (at any depth) that uses a bound mesh,
keeping the pose and transforms. Unknown names and nonfinite intensities are ignored.
Declaration
public Shape ApplyExpressions(Shape shape, IReadOnlyDictionary<string, float> intensities)
Parameters
| Type | Name | Description |
|---|---|---|
| Shape | shape | |
| IReadOnlyDictionary<string, float> | intensities |
Returns
| Type | Description |
|---|---|
| Shape |
Remarks
The result shows exactly the supplied expressions: expressions left out return to neutral. Intensities clamp to
[0,1]; binary expressions snap at 0.5. Contributions sum and clamp per target. Every mesh bound by any of the model's
expressions gets new weights (replacing its mesh.weights defaults); other meshes keep theirs. Meshes absent from the
shape are skipped.
CreateShape(Func<GltfImage, Texture2D>?)
Creates the default scene. Without a decoder, textures use only their base color.
Declaration
public Shape CreateShape(Func<GltfImage, Texture2D>? decodeImage = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<GltfImage, Texture2D> | decodeImage |
Returns
| Type | Description |
|---|---|
| Shape |
Remarks
Decoded textures are cached per image for this call. Coordinates remain right-handed, +Y up, with counterclockwise front faces. UV V is flipped to the bottom-left convention of Texture2D.