TriLib
Search Results for

    Show / Hide Table of Contents

    Class RootBoneMapper

    Provides functionality to locate a “root bone” for rigging or animation setup within the loaded model hierarchy. This can be essential when binding skin meshes or humanoid rigs, as well as customizing bone references in scripts.

    Inheritance
    object
    RootBoneMapper
    ByBonesRootBoneMapper
    ByNameRootBoneMapper
    Namespace: TriLibCore.Mappers
    Assembly: TriLibCore.dll
    Syntax
    public class RootBoneMapper : ScriptableObject

    Constructors

    RootBoneMapper()

    Declaration
    public RootBoneMapper()

    Methods

    Map(AssetLoaderContext)

    Attempts to find a root bone in the loaded model hierarchy, returning the UnityEngine.Transform to be used as the topmost bone for binding or rigging. This method is now marked as Obsolete; use Map(AssetLoaderContext, IList<Transform>) instead.

    Declaration
    [Obsolete("Please use the override that accepts a list of bones instead.")]
    public virtual Transform Map(AssetLoaderContext assetLoaderContext)
    Parameters
    Type Name Description
    AssetLoaderContext assetLoaderContext

    The AssetLoaderContext referencing loaded UnityEngine.GameObject data, user options, and other contextual information.

    Returns
    Type Description
    Transform

    The root bone UnityEngine.Transform if one is found or chosen; by default, the method returns assetLoaderContext.RootGameObject.transform.

    Map(AssetLoaderContext, IList<Transform>)

    Finds a suitable root bone from a provided list of potential bone transforms. This is the highest-level bone in the hierarchy that others descend from. Subclasses should override this method to implement more advanced selection logic (e.g., checking naming patterns, evaluating bone connections, etc.).

    Declaration
    public virtual Transform Map(AssetLoaderContext assetLoaderContext, IList<Transform> bones)
    Parameters
    Type Name Description
    AssetLoaderContext assetLoaderContext

    The AssetLoaderContext referencing the loaded model’s GameObjects, user-defined import options, and callbacks.

    IList<Transform> bones

    An ordered or unordered list of transforms that may qualify as bones in the skeleton hierarchy. Subclasses can evaluate these to decide which one is truly at the top of the chain.

    Returns
    Type Description
    Transform

    The UnityEngine.Transform chosen to serve as the root bone. By default, this method returns assetLoaderContext.RootGameObject.transform.

    Extension Methods

    IObjectExtensions.TryToDispose<T>(object)
    In this article
    Back to top Generated by DocFX