Class BlendShapeMapper
Allows developers to implement a custom mechanism for blend shape playback instead of Unity’s built-in system. By overriding methods in this class, you can perform specialized setup for blend shapes, remap animation curves, or otherwise customize how blend shape data is applied at runtime.
Namespace: TriLibCore.Mappers
Assembly: TriLibCore.dll
Syntax
public class BlendShapeMapper : ScriptableObject
Constructors
BlendShapeMapper()
Declaration
public BlendShapeMapper()
Properties
AnimationCurveSourceType
Indicates the source type (e.g., SkinnedMeshRenderer
or another component)
for blend shape animation curves. Override to specify a different type if
not using the default Unity setup.
Declaration
public virtual Type AnimationCurveSourceType { get; }
Property Value
Type | Description |
---|---|
Type |
Methods
MapAnimationCurve(AssetLoaderContext, int)
Provides a way to remap the animation property name or path when creating animation curves for blend shape keys, effectively controlling how TriLib’s loaded blend shape animations are interpreted in Unity. Override this if your system requires a different naming scheme.
Declaration
public virtual string MapAnimationCurve(AssetLoaderContext assetLoaderContext, int blendShapeIndex)
Parameters
Type | Name | Description |
---|---|---|
AssetLoaderContext | assetLoaderContext | References the model loading data, including loaded objects, user settings, and runtime information. |
int | blendShapeIndex | The index of the blend shape within the mesh. This value can be used to determine the naming or structure of animation curves. |
Returns
Type | Description |
---|---|
string | A new or adjusted string representing the animation curve property to which
this blend shape should be keyed. |
Setup(AssetLoaderContext, IGeometryGroup, GameObject, List<IBlendShapeKey>)
Performs initial configuration for the specified geometryGroup
,
applying the blend shape data to the provided meshGameObject
.
Override this method to implement a custom blend shape playback system
(e.g., a custom runtime script or different naming conventions).
Declaration
public virtual void Setup(AssetLoaderContext assetLoaderContext, IGeometryGroup geometryGroup, GameObject meshGameObject, List<IBlendShapeKey> blendShapeKeys)
Parameters
Type | Name | Description |
---|---|---|
AssetLoaderContext | assetLoaderContext | The AssetLoaderContext containing references to loaded objects, loading options, and callbacks. |
IGeometryGroup | geometryGroup | The geometry group (mesh data and related structures) containing the blend shape keys. |
GameObject | meshGameObject | The UnityEngine.GameObject to which the blend shape mesh is bound. Often hosts a UnityEngine.SkinnedMeshRenderer if using Unity’s default system. |
List<IBlendShapeKey> | blendShapeKeys | A list of IBlendShapeKey objects referencing the blend shapes (morph targets) available for this mesh. |