Simple3D
Search Results for

    Show / Hide Table of Contents

    Class GltfModel

    A binary glTF asset, with reusable geometry, skeletons and embedded images.

    Inheritance
    object
    GltfModel
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Simple3D.Core
    Assembly: Simple3D.Core.dll
    Syntax
    public sealed class GltfModel

    Properties

    | Edit this page View Source

    Expressions

    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>
    | Edit this page View Source

    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>
    | Edit this page View Source

    Images

    Encoded images in glTF order.

    Declaration
    public IReadOnlyList<GltfImage> Images { get; }
    Property Value
    Type Description
    IReadOnlyList<GltfImage>
    | Edit this page View Source

    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 Source

    ApplyExpressions(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.

    | Edit this page View Source

    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.

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX