Class AnimationTrack
A Timeline track used for playing back animations on an Animator.
Inherited Members
Namespace: UnityEngine.Timeline
Syntax
[Serializable]
[TrackClipType(typeof(AnimationPlayableAsset), false)]
[TrackBindingType(typeof(Animator))]
[ExcludeFromPreset]
public class AnimationTrack : TrackAsset, IPlayableAsset, IPropertyPreview, ICurvesOwner, ISerializationCallbackReceiver, ILayerable
Properties
applyAvatarMask
Specifies whether to apply the AvatarMask to the track.
Declaration
public bool applyAvatarMask { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
applyOffsets
Specifies whether to apply track offsets to all clips on the track.
Declaration
[Obsolete("applyOffset is deprecated. Use trackOffset instead", true)]
public bool applyOffsets { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
This can be used to offset all clips on a track, in addition to the clips individual offsets.
avatarMask
Specifies the AvatarMask to be applied to all clips on the track.
Declaration
public AvatarMask avatarMask { get; set; }
Property Value
Type | Description |
---|---|
AvatarMask |
Remarks
Applying an AvatarMask to an animation track will allow discarding portions of the animation being applied on the track.
eulerAngles
The euler angle representation of the rotation offset of the entire track.
Declaration
public Vector3 eulerAngles { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
inClipMode
Specifies whether the Animation Track has clips, or is in infinite mode.
Declaration
public bool inClipMode { get; }
Property Value
Type | Description |
---|---|
Boolean |
infiniteClip
An AnimationClip storing the data for an infinite track.
Declaration
public AnimationClip infiniteClip { get; }
Property Value
Type | Description |
---|---|
AnimationClip |
Remarks
The value of this property is null when the AnimationTrack is in Clip Mode.
infiniteClipOffsetEulerAngles
The euler angle representation of the rotation offset of the track when in infinite mode.
Declaration
public Vector3 infiniteClipOffsetEulerAngles { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
infiniteClipOffsetPosition
The translation offset of a track in infinite mode.
Declaration
public Vector3 infiniteClipOffsetPosition { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
infiniteClipOffsetRotation
The rotation offset of a track in infinite mode.
Declaration
public Quaternion infiniteClipOffsetRotation { get; set; }
Property Value
Type | Description |
---|---|
Quaternion |
infiniteClipPostExtrapolation
The saved state of post-extrapolation for clips when converted to infinite mode.
Declaration
public TimelineClip.ClipExtrapolation infiniteClipPostExtrapolation { get; set; }
Property Value
Type | Description |
---|---|
TimelineClip.ClipExtrapolation |
infiniteClipPreExtrapolation
The saved state of pre-extrapolation for clips converted to infinite mode.
Declaration
public TimelineClip.ClipExtrapolation infiniteClipPreExtrapolation { get; set; }
Property Value
Type | Description |
---|---|
TimelineClip.ClipExtrapolation |
matchTargetFields
Specifies which fields to match when aligning offsets of clips.
Declaration
public MatchTargetFields matchTargetFields { get; set; }
Property Value
Type | Description |
---|---|
MatchTargetFields |
openClipOffsetEulerAngles
Euler angle representation of the rotation offset of the track when in infinite mode. This property is obsolete. Use infiniteClipOffsetEulerAngles instead.
Declaration
[Obsolete("openClipOffsetEulerAngles has been deprecated. Use infiniteClipOffsetEulerAngles instead. (UnityUpgradable) -> infiniteClipOffsetEulerAngles", true)]
public Vector3 openClipOffsetEulerAngles { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
openClipOffsetPosition
Translation offset of a track in infinite mode. This property is obsolete. Use infiniteClipOffsetPosition instead.
Declaration
[Obsolete("openClipOffsetPosition has been deprecated. Use infiniteClipOffsetPosition instead. (UnityUpgradable) -> infiniteClipOffsetPosition", true)]
public Vector3 openClipOffsetPosition { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
openClipOffsetRotation
Rotation offset of a track in infinite mode. This property is obsolete. Use infiniteClipOffsetRotation instead.
Declaration
[Obsolete("openClipOffsetRotation has been deprecated. Use infiniteClipOffsetRotation instead. (UnityUpgradable) -> infiniteClipOffsetRotation", true)]
public Quaternion openClipOffsetRotation { get; set; }
Property Value
Type | Description |
---|---|
Quaternion |
openClipPostExtrapolation
Saved state of post-extrapolation for clips converted to infinite mode. This property is obsolete. Use infiniteClipPostExtrapolation instead.
Declaration
[Obsolete("openClipPostExtrapolation has been deprecated. Use infiniteClipPostExtrapolation instead. (UnityUpgradable) -> infiniteClipPostExtrapolation", true)]
public TimelineClip.ClipExtrapolation openClipPostExtrapolation { get; set; }
Property Value
Type | Description |
---|---|
TimelineClip.ClipExtrapolation |
openClipPreExtrapolation
Saved state of pre-extrapolation for clips converted to infinite mode. This property is obsolete. Use infiniteClipPreExtrapolation instead.
Declaration
[Obsolete("openClipPreExtrapolation has been deprecated. Use infiniteClipPreExtrapolation instead. (UnityUpgradable) -> infiniteClipPreExtrapolation", true)]
public TimelineClip.ClipExtrapolation openClipPreExtrapolation { get; set; }
Property Value
Type | Description |
---|---|
TimelineClip.ClipExtrapolation |
outputs
Returns a description of the PlayableOutputs that will be created by this track.
Declaration
public override IEnumerable<PlayableBinding> outputs { get; }
Property Value
Type | Description |
---|---|
IEnumerable<PlayableBinding> |
Overrides
position
The translation offset of the entire track.
Declaration
public Vector3 position { get; set; }
Property Value
Type | Description |
---|---|
Vector3 |
rotation
The rotation offset of the entire track, expressed as a quaternion.
Declaration
public Quaternion rotation { get; set; }
Property Value
Type | Description |
---|---|
Quaternion |
trackOffset
Specifies what is used to set the starting position and orientation of an Animation Track.
Declaration
public TrackOffset trackOffset { get; set; }
Property Value
Type | Description |
---|---|
TrackOffset |
Remarks
Track Offset is only applied when the Animation Track contains animation that modifies the root Transform.
Methods
CalculateItemsHash()
Declaration
protected override int CalculateItemsHash()
Returns
Type | Description |
---|---|
Int32 |
Overrides
CreateClip(AnimationClip)
Creates a TimelineClip on this track that uses an AnimationClip.
Declaration
public TimelineClip CreateClip(AnimationClip clip)
Parameters
Type | Name | Description |
---|---|---|
AnimationClip | clip | Source animation clip of the resulting TimelineClip. |
Returns
Type | Description |
---|---|
TimelineClip | A new TimelineClip which has an AnimationPlayableAsset asset attached. |
CreateInfiniteClip(String)
Creates an AnimationClip that stores the data for an infinite track.
Declaration
public void CreateInfiniteClip(string infiniteClipName)
Parameters
Type | Name | Description |
---|---|---|
String | infiniteClipName | The name of the AnimationClip to create. This method does not ensure unique names. If you want a unique clip name, you must provide one. See ObjectNames.GetUniqueName for information on a method that creates unique names. |
Remarks
If an infiniteClip already exists, this method produces no result, even if you provide a different value for infiniteClipName.
CreateRecordableClip(String)
Creates a TimelineClip, AnimationPlayableAsset and an AnimationClip. Use this clip to record in a timeline.
Declaration
public TimelineClip CreateRecordableClip(string animClipName)
Parameters
Type | Name | Description |
---|---|---|
String | animClipName | The name of the AnimationClip to create. This method does not ensure unique names. If you want a unique clip name, you must provide one. See ObjectNames.GetUniqueName for information on a method that creates unique names. |
Returns
Type | Description |
---|---|
TimelineClip | Returns a new TimelineClip with an AnimationPlayableAsset asset attached. |
Remarks
When used from the editor, this method attempts to save the created recordable clip to the TimelineAsset. The TimelineAsset must already exist in the AssetDatabase to save the recordable clip. If the TimelineAsset does not exist, the recordable clip is still created but it is not saved.
GatherProperties(PlayableDirector, IPropertyCollector)
Called by the Timeline Editor to gather properties requiring preview.
Declaration
public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
Parameters
Type | Name | Description |
---|---|---|
PlayableDirector | director | The PlayableDirector invoking the preview |
IPropertyCollector | driver | PropertyCollector used to gather previewable properties |
Overrides
OnCreateClip(TimelineClip)
Used to initialize default values on a newly created clip
Declaration
protected override void OnCreateClip(TimelineClip clip)
Parameters
Type | Name | Description |
---|---|---|
TimelineClip | clip | The clip added to the track |
Overrides
Explicit Interface Implementations
ILayerable.CreateLayerMixer(PlayableGraph, GameObject, Int32)
Creates a mixer that blends track mixers.
Declaration
Playable ILayerable.CreateLayerMixer(PlayableGraph graph, GameObject go, int inputCount)
Parameters
Type | Name | Description |
---|---|---|
PlayableGraph | graph | The graph where the mixer playable will be added. |
GameObject | go | The GameObject that requested the graph. |
Int32 | inputCount | The number of inputs on the mixer. There should be an input for each playable from each clip. |
Returns
Type | Description |
---|---|
Playable | Returns |