Search Results for

    Show / Hide Table of Contents

    Class SkinnedModel

    Skinned model asset that contains model object made of meshes that can be rendered on the GPU using skeleton bones skinning.

    Inheritance
    System.Object
    Object
    Asset
    BinaryAsset
    ModelBase
    SkinnedModel
    Inherited Members
    ModelBase.SetupMaterialSlots(Int32)
    ModelBase.GetSlot(String)
    ModelBase.GetLOD(Int32)
    ModelBase.GetMesh(Int32, Int32)
    ModelBase.GetMeshes(MeshBase[], Int32)
    ModelBase.Save(Boolean, String)
    ModelBase.MinScreenSize
    ModelBase.MaterialSlots
    ModelBase.MaterialSlotsCount
    ModelBase.LoadedLODs
    ModelBase.LODsCount
    BinaryAsset.Reimport()
    BinaryAsset.ImportPath
    Asset.Reload()
    Asset.WaitForLoaded(Double)
    Asset.GetReferences()
    Asset.Save(String)
    Asset.ToString()
    Asset.ReferencesCount
    Asset.Path
    Asset.IsLoaded
    Asset.LastLoadFailed
    Asset.IsVirtual
    Asset.ShouldDeleteFileOnUnload
    Asset.MemoryUsage
    Object.__unmanagedPtr
    Object.__internalId
    Object.Finalize()
    Object.As<T>()
    Object.NewValue(Type)
    Object.New(String)
    Object.Find<T>(Guid, Boolean)
    Object.Find(Guid, Type, Boolean)
    Object.TryFind<T>(Guid)
    Object.TryFind(Guid, Type)
    Object.Destroy(Object, Single)
    Object.DestroyNow(Object)
    Object.Destroy<T>(T, Single)
    Object.Equals(Object)
    Object.GetUnmanagedPtr(Object)
    Object.GetUnmanagedInterface(Object, Type)
    Object.FromUnmanagedPtr(IntPtr)
    Object.MapObjectID(Guid)
    Object.RemapObjectID(Guid)
    Object.GetHashCode()
    Object.ID
    Object.TypeName
    Namespace: FlaxEngine
    Assembly: FlaxEngine.CSharp.dll
    Syntax
    [Unmanaged]
    public class SkinnedModel : ModelBase

    Constructors

    SkinnedModel()

    Initializes a new instance of the SkinnedModel.

    Declaration
    public SkinnedModel()

    Fields

    MaxBones

    The maximum allowed amount of skeleton bones to be used with skinned model.

    Declaration
    public const int MaxBones = 256
    Field Value
    System.Int32

    Properties

    BlendShapes

    Gets the blend shapes names used by the skinned model meshes (from LOD 0 only).

    Declaration
    [Unmanaged]
    public string[] BlendShapes { get; }
    Property Value
    System.String[]

    Bones

    Gets the skeleton bones hierarchy.

    Declaration
    [Unmanaged]
    public SkeletonBone[] Bones { get; }
    Property Value
    SkeletonBone[]

    LODs

    Model level of details. The first entry is the highest quality LOD0 followed by more optimized versions.

    Declaration
    [Unmanaged]
    public SkinnedModelLOD[] LODs { get; }
    Property Value
    SkinnedModelLOD[]

    Nodes

    Gets the skeleton nodes hierarchy.

    Declaration
    [Unmanaged]
    public SkeletonNode[] Nodes { get; }
    Property Value
    SkeletonNode[]

    SkeletonRetargets

    Gets or sets or sets the skeleton retarget entries (accessed in Editor only).

    Declaration
    [Unmanaged]
    public SkinnedModel.SkeletonRetarget[] SkeletonRetargets { get; set; }
    Property Value
    SkinnedModel.SkeletonRetarget[]

    Methods

    FindBone(Int32)

    Finds the bone that is using a given node index.

    Declaration
    [Unmanaged]
    public int FindBone(int nodeIndex)
    Parameters
    System.Int32 nodeIndex

    The index of the node.

    Returns
    System.Int32

    The index of the bone or -1 if not found.

    FindBone(String)

    Finds the bone with the given name.

    Declaration
    [Unmanaged]
    public int FindBone(string name)
    Parameters
    System.String name

    The name of the node used by the bone.

    Returns
    System.Int32

    The index of the bone or -1 if not found.

    FindNode(String)

    Finds the node with the given name.

    Declaration
    [Unmanaged]
    public int FindNode(string name)
    Parameters
    System.String name

    The name of the node.

    Returns
    System.Int32

    The index of the node or -1 if not found.

    GetBox(Matrix, Int32)

    Gets the model bounding box in custom matrix world space (rig pose transformed by matrix, not animated).

    Declaration
    [Unmanaged]
    public BoundingBox GetBox(Matrix world, int lodIndex = 0)
    Parameters
    Matrix world

    The transformation matrix.

    System.Int32 lodIndex

    The Level Of Detail index.

    Returns
    BoundingBox

    The bounding box.

    GetBox(Int32)

    Gets the model bounding box in local space (rig pose, not animated).

    Declaration
    [Unmanaged]
    public BoundingBox GetBox(int lodIndex = 0)
    Parameters
    System.Int32 lodIndex

    The Level Of Detail index.

    Returns
    BoundingBox

    The bounding box.

    SetupLODs(Int32[])

    Setups the model LODs collection including meshes creation.

    Declaration
    [Unmanaged]
    public bool SetupLODs(int[] meshesCountPerLod)
    Parameters
    System.Int32[] meshesCountPerLod

    The meshes count per lod array (amount of meshes per LOD).

    Returns
    System.Boolean

    True if failed, otherwise false.

    SetupSkeleton(SkeletonNode[])

    Setups the skinned model skeleton. Uses the same nodes layout for skeleton bones and calculates the offset matrix by auto.

    Declaration
    [Unmanaged]
    public bool SetupSkeleton(SkeletonNode[] nodes)
    Parameters
    SkeletonNode[] nodes

    The nodes hierarchy. The first node must be a root one (with parent index equal -1).

    Returns
    System.Boolean

    True if failed, otherwise false.

    SetupSkeleton(SkeletonNode[], SkeletonBone[], Boolean)

    Setups the skinned model skeleton.

    Declaration
    [Unmanaged]
    public bool SetupSkeleton(SkeletonNode[] nodes, SkeletonBone[] bones, bool autoCalculateOffsetMatrix)
    Parameters
    SkeletonNode[] nodes

    The nodes hierarchy. The first node must be a root one (with parent index equal -1).

    SkeletonBone[] bones

    The bones hierarchy.

    System.Boolean autoCalculateOffsetMatrix

    If true then the OffsetMatrix for each bone will be auto-calculated by the engine, otherwise the provided values will be used.

    Returns
    System.Boolean

    True if failed, otherwise false.

    Extension Methods

    Extensions.ReflectiveCompare<T>(T, T)
    Extensions.DeepClone<T>(T)
    Extensions.RawClone<T>(T)
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat