Interface IAnimationProcessor
Interface for processing animation clips. The animation clip/curve data may be processed towards a specific animation system.
Inherited Members
Namespace: Unity.Cloud.Gltfast.Animations
Assembly: Unity.Cloud.Gltfast.dll
Syntax
[MovedFrom(true, "GLTFast.Animations", "glTFast", null)]
public interface IAnimationProcessor : IDisposable
Remarks
A processor instance is created by an IAnimationProcessorFactory for a single import call (the conversion phase). Its lifetime ends when the conversion phase ends and Dispose() is invoked. Dispose() is the place to release scratch buffers and other temporary resources.
Methods
AddClip(int, string)
Initialize a new animation clip with the given name and index. Is called before any animation curves are added to the clip.
Declaration
void AddClip(int index, string name)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | glTF animation clip index. |
| string | name | glTF animation clip name. |
AddMorphTargetWeightCurves(int, int, int, string, INodeHierarchyInfo, ReadOnly, ReadOnly, Interpolation, IReadOnlyList<string>)
Adds a morph target weight curve to an animation clip.
Declaration
void AddMorphTargetWeightCurves(int clipIndex, int targetNode, int meshNumeration, string meshName, INodeHierarchyInfo nodeHierarchyInfo, NativeArray<float>.ReadOnly times, NativeArray<float>.ReadOnly values, Interpolation interpolation, IReadOnlyList<string> morphTargetNames = null)
Parameters
| Type | Name | Description |
|---|---|---|
| int | clipIndex | glTF animation clip index. |
| int | targetNode | glTF index of the targeted node. |
| int | meshNumeration | Target mesh number. A glTF mesh is converted into one or more MeshResult which are numbered consecutively. AddMesh(uint, string, MeshResult, IReadOnlyList<uint>, uint?, IReadOnlyList<float>, int) is called once for each of those MeshResults and the meshNumeration matches. |
| string | meshName | Name of the targeted Unity mesh. |
| INodeHierarchyInfo | nodeHierarchyInfo | Can be used to query hierarchical information and build an animation path string. |
| NativeArray<float>.ReadOnly | times | Time values. |
| NativeArray<float>.ReadOnly | values | Output morph target weight values. |
| Interpolation | interpolation | Interpolation type. |
| IReadOnlyList<string> | morphTargetNames | Morph targets' names. |
AddRotationCurves(int, int, INodeHierarchyInfo, ReadOnly, ReadOnly, Interpolation)
Adds a rotation curve to an animation clip.
Declaration
void AddRotationCurves(int clipIndex, int targetNode, INodeHierarchyInfo nodeHierarchyInfo, NativeArray<float>.ReadOnly times, NativeArray<quaternion>.ReadOnly values, Interpolation interpolation)
Parameters
| Type | Name | Description |
|---|---|---|
| int | clipIndex | glTF animation clip index. |
| int | targetNode | glTF index of the targeted node. |
| INodeHierarchyInfo | nodeHierarchyInfo | Can be used to query hierarchical information and build an animation path string. |
| NativeArray<float>.ReadOnly | times | Time values. |
| NativeArray<quaternion>.ReadOnly | values | Output rotation values. |
| Interpolation | interpolation | Interpolation type. |
AddScaleCurves(int, int, INodeHierarchyInfo, ReadOnly, ReadOnly, Interpolation)
Adds a local scale curve to an animation clip.
Declaration
void AddScaleCurves(int clipIndex, int targetNode, INodeHierarchyInfo nodeHierarchyInfo, NativeArray<float>.ReadOnly times, NativeArray<float3>.ReadOnly values, Interpolation interpolation)
Parameters
| Type | Name | Description |
|---|---|---|
| int | clipIndex | glTF animation clip index. |
| int | targetNode | glTF index of the targeted node. |
| INodeHierarchyInfo | nodeHierarchyInfo | Can be used to query hierarchical information and build an animation path string. |
| NativeArray<float>.ReadOnly | times | Time values. |
| NativeArray<float3>.ReadOnly | values | Output scale values. |
| Interpolation | interpolation | Interpolation type. |
AddTranslationCurves(int, int, INodeHierarchyInfo, ReadOnly, ReadOnly, Interpolation)
Adds a translation curve to an animation clip.
Declaration
void AddTranslationCurves(int clipIndex, int targetNode, INodeHierarchyInfo nodeHierarchyInfo, NativeArray<float>.ReadOnly times, NativeArray<float3>.ReadOnly values, Interpolation interpolation)
Parameters
| Type | Name | Description |
|---|---|---|
| int | clipIndex | glTF animation clip index. |
| int | targetNode | glTF index of the targeted node. |
| INodeHierarchyInfo | nodeHierarchyInfo | Can be used to query hierarchical information and build an animation path string. |
| NativeArray<float>.ReadOnly | times | Time values. |
| NativeArray<float3>.ReadOnly | values | Output translation values. |
| Interpolation | interpolation | Interpolation type. |
Complete()
Signals that the conversion phase has finished and all animation curves have been added. Implementations may finalize their internal state and optionally return a factory that produces appliers to attach the processed animation data to instantiated scenes.
Declaration
IDataInstanceApplierFactory Complete()
Returns
| Type | Description |
|---|---|
| IDataInstanceApplierFactory | An IDataInstanceApplierFactory that creates instance appliers for the processed animation data, or null if no per-instance application is required. |