Namespace TriLibCore.Mappers
Classes
AnimationClipMapper
Provides a mechanism for post-processing or re-mapping UnityEngine.AnimationClip instances within the TriLib loading pipeline. Subclasses can override MapArray(AssetLoaderContext, AnimationClip[]) to manipulate or customize animation data (e.g., for retargeting, curve simplification, or special playback requirements).
AnimatorControllerMapper
Represents a Mapper used to process Animation Controller Clips.
AnimatorOverrideAnimationClipMapper
Provides a mechanism for applying an AnimatorOverrideController to the animator of a loaded model while processing animation clips. This mapper is designed to work with Animator Override Controllers, allowing you to override default animation clips with custom ones.
AutodeskInteractiveStandardMaterialMapper
A specialized StandardMaterialMapper that converts TriLib virtual materials into Autodesk Interactive materials. This mapper adjusts the material presets based on the currently active render pipeline (HDRP, URP, or Standard), and it forces the use of a Shader Variant Collection.
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.
ByBonesRootBoneMapper
Implements a root bone selection strategy by scanning a list of bones (Transform components) and choosing the one with the greatest number of child transforms. This mapper is useful when the asset hierarchy does not provide a clear root bone from naming conventions alone.
ByNameAnimatorOverrideAnimationClipMapper
Implements an AnimatorOverrideAnimationClipMapper that maps animation clips by matching their names to those defined in an Animator Override Controller. This mapper uses a configurable string comparison mode and a case-insensitivity option to determine if a loaded animation clip matches a key in the override controller.
ByNameHumanoidAvatarMapper
Implements a humanoid avatar mapping strategy by matching the names of loaded GameObjects with candidate bone names specified in a bone mapping list. For each human bone defined in the mapping, the first matching GameObject found in the model hierarchy is used. If a required bone is not found, a warning is issued.
ByNameLipSyncMapper
Provides a lip sync mapping strategy by searching for viseme matches in blend‐shape key names. This mapper searches through candidate names specified in VisemeCandidates and compares them with the names of blend‐shape keys found in the model's geometry. If a match is found (using the configured string comparison options), the corresponding blend‐shape key index is returned.
ByNameRootBoneMapper
Implements a root bone selection strategy by searching for a matching bone name within the loaded model’s hierarchy. This mapper iterates over a predefined list of candidate root bone names (e.g., "Hips", "Bip01", "Pelvis") and returns the first match found based on the configured string comparison settings.
ExternalDataMapper
Serves as an abstract base class for locating and opening external data streams within the TriLib loading workflow. Inheritors must override Map(AssetLoaderContext, string, out string) to define how resource filenames are resolved into Stream objects, allowing for custom logic such as path transformations, caching, or network retrieval.
FilePickerExternalDataMapper
Provides an external data mapping strategy for file picker–based workflows.
This mapper searches through a collection of file items (each with an associated stream)
to find one whose short filename matches the given originalFilename
.
If a match is found, the file’s stream is returned, along with its full name as the final path.
FilePickerTextureMapper
Provides functionality to load textures from a file picker selection. This mapper searches through the list of ItemWithStream objects (provided in the custom context data) to find a file whose short filename matches the filename specified in the TriLib ITexture. If a match is found, it opens the corresponding data stream.
HumanoidAvatarMapper
Provides functionality to convert a loaded model’s bones into a Unity humanoid avatar hierarchy. This class enforces humanoid-like orientations (e.g., T-pose) and aligns bone transforms to standardized directional vectors. Subclasses can extend this mapper to refine or modify default humanoid bone mapping processes.
LipSyncMapper
Provides a mechanism for mapping blend shapes within a model’s geometry to corresponding visemes (lip-sync shapes). This class can be extended to integrate TriLib-loaded models with custom lip-sync systems, enabling facial animation driven by audio or other input sources.
MaterialMapper
Serves as an abstract base class for converting TriLib virtual materials into Unity UnityEngine.Material objects. Classes inheriting from MaterialMapper must implement or override the provided methods and properties to handle specific pipeline requirements (e.g., Standard, HDRP, URP, custom shaders, etc.).
NameMapper
Provides a mechanism for generating custom UnityEngine.GameObject names in the scene, based on metadata from the source 3D model. By inheriting NameMapper and overriding Map(AssetLoaderContext, ModelNamingData, IModel, string), users can implement specialized naming schemes (e.g., appending model part numbers, classes, or other identifiers).
PerFilenameTextureMapper
Provides a texture mapping strategy which attempts to locate an external texture file whose name matches the filename of the source model. The search is performed in the directory where the model file is located.
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.
SimpleAnimationPlayerAnimationClipMapper
Implements an AnimationClipMapper that creates a SimpleAnimationPlayer for playing animation clips by index or name. When the animation type is set to Generic or Humanoid, and at least one animation clip is available, this mapper adds a SimpleAnimationPlayer to the model's root GameObject and assigns the animation clips to it.
StandardMaterialMapper
Converts TriLib virtual materials into Unity Standard materials. This mapper is designed to work with the Unity Standard shader and processes texture maps and various material properties (e.g., diffuse, glossiness, metallic, emission, normal, occlusion, and displacement) using an asynchronous coroutine pipeline.
TextureMapper
Provides a mechanism to locate and load texture data for a model, either by leveraging its original filename or tapping into embedded resources. TextureMapper can be subclassed to implement specialized texture-finding strategies—for instance, searching alternative file paths or retrieving assets from remote sources.
UserPropertiesMapper
Provides a mechanism for handling custom properties embedded within 3D model data. By subclassing UserPropertiesMapper, developers can intercept and process user-defined attributes (e.g., metadata or extended properties) attached to a model’s nodes, materials, or other elements.
VisemeCandidate
Represents a Viseme mapping candidate. A Lip-Sync Mapper may use this information to find suitable Blend-Shapes Keys.
ZipFileExternalDataMapper
Provides an external data mapping strategy for extracting data from Zip files.
This mapper searches through the entries of a Zip file (provided via custom context data)
for an entry whose short filename matches the specified originalFilename
.
If a match is found, it opens a stream for that Zip entry.
ZipFileTextureMapper
Provides a texture mapping strategy for extracting texture data from Zip files. This mapper retrieves a Zip file from the custom context data and iterates through its entries, comparing their names to the texture's filename. If a matching file is found, its stream is opened and assigned to the texture loading context.
glTF2StandardMaterialMapper
Converts TriLib virtual materials of glTF2 assets into Unity Standard materials, using shader properties and material presets appropriate for the currently active render pipeline.