Class TimelineClip
Represents a clip on the timeline.
Inheritance
Namespace: UnityEngine.Timeline
Syntax
[Serializable]
public class TimelineClip : ICurvesOwner, ISerializationCallbackReceiver
Fields
kDefaultClipCaps
The default capabilities for a clip
Declaration
public static readonly ClipCaps kDefaultClipCaps
Field Value
Type | Description |
---|---|
ClipCaps |
kDefaultClipDurationInSeconds
The default length of a clip in seconds.
Declaration
public static readonly float kDefaultClipDurationInSeconds
Field Value
Type | Description |
---|---|
System.Single |
kTimeScaleMax
The maximum timescale allowed on a clip
Declaration
public static readonly double kTimeScaleMax
Field Value
Type | Description |
---|---|
System.Double |
kTimeScaleMin
The minimum timescale allowed on a clip
Declaration
public static readonly double kTimeScaleMin
Field Value
Type | Description |
---|---|
System.Double |
Properties
animationClip
If this contains an animation asset, returns the animation clip attached. Otherwise returns null.
Declaration
public AnimationClip animationClip { get; }
Property Value
Type | Description |
---|---|
AnimationClip |
asset
The PlayableAsset attached to the clip.
Declaration
public object asset { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
blendInCurveMode
The mode for calculating the blend curve of the overlap at the start of the clip
Declaration
public TimelineClip.BlendCurveMode blendInCurveMode { get; set; }
Property Value
Type | Description |
---|---|
TimelineClip.BlendCurveMode |
blendInDuration
The amount of overlap in seconds on the start of a clip.
Declaration
public double blendInDuration { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
blendOutCurveMode
The mode for calculating the blend curve of the overlap at the end of the clip
Declaration
public TimelineClip.BlendCurveMode blendOutCurveMode { get; set; }
Property Value
Type | Description |
---|---|
TimelineClip.BlendCurveMode |
blendOutDuration
The amount of overlap in seconds at the end of a clip.
Declaration
public double blendOutDuration { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
clipAssetDuration
The length, in seconds, of the PlayableAsset attached to the clip.
Declaration
public double clipAssetDuration { get; }
Property Value
Type | Description |
---|---|
System.Double |
clipCaps
Returns the capabilities supported by this clip.
Declaration
public ClipCaps clipCaps { get; }
Property Value
Type | Description |
---|---|
ClipCaps |
clipIn
Local offset time of the clip.
Declaration
public double clipIn { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
curves
An animation clip containing animated properties of the attached PlayableAsset
Declaration
public AnimationClip curves { get; }
Property Value
Type | Description |
---|---|
AnimationClip |
Remarks
This is where animated clip properties are stored.
displayName
The name displayed on the clip
Declaration
public string displayName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
duration
The length, in seconds, of the clip
Declaration
public double duration { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
easeInDuration
The ease in duration of the timeline clip in seconds. This only applies if the start of the clip is not overlapping.
Declaration
public double easeInDuration { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
easeOutDuration
The ease out duration of the timeline clip in seconds. This only applies if the end of the clip is not overlapping.
Declaration
public double easeOutDuration { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
easeOutTime
The time in seconds that the ease out begins
Declaration
public double easeOutTime { get; }
Property Value
Type | Description |
---|---|
System.Double |
end
The end time, in seconds of the clip
Declaration
public double end { get; }
Property Value
Type | Description |
---|---|
System.Double |
extrapolatedDuration
The length of the clip in seconds, including extrapolation.
Declaration
public double extrapolatedDuration { get; }
Property Value
Type | Description |
---|---|
System.Double |
extrapolatedStart
The start time of the clip, accounting for pre-extrapolation
Declaration
public double extrapolatedStart { get; }
Property Value
Type | Description |
---|---|
System.Double |
hasBlendIn
Returns whether the clip is blending in
Declaration
public bool hasBlendIn { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
hasBlendOut
Returns whether the clip is blending out
Declaration
public bool hasBlendOut { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
hasCurves
Whether this clip contains animated properties for the attached PlayableAsset.
Declaration
public bool hasCurves { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
This property is false if the curves property is null or if it contains no information.
hasPostExtrapolation
Is the clip being extrapolated past its end time?
Declaration
public bool hasPostExtrapolation { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
hasPreExtrapolation
Is the clip being extrapolated before its start time?
Declaration
public bool hasPreExtrapolation { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
mixInCurve
The animation curve used for calculating weights during an ease in or a blend in.
Declaration
public AnimationCurve mixInCurve { get; set; }
Property Value
Type | Description |
---|---|
AnimationCurve |
mixInDuration
The amount of the clip blending or easing in, in seconds
Declaration
public double mixInDuration { get; }
Property Value
Type | Description |
---|---|
System.Double |
mixInPercentage
The amount of the clip being used for ease or blend in as a percentage
Declaration
public float mixInPercentage { get; }
Property Value
Type | Description |
---|---|
System.Single |
mixOutCurve
The animation curve used for calculating weights during an ease out or a blend out.
Declaration
public AnimationCurve mixOutCurve { get; set; }
Property Value
Type | Description |
---|---|
AnimationCurve |
mixOutDuration
The amount of the clip blending or easing out, in seconds
Declaration
public double mixOutDuration { get; }
Property Value
Type | Description |
---|---|
System.Double |
mixOutPercentage
The amount of the clip being used for ease or blend out as a percentage
Declaration
public float mixOutPercentage { get; }
Property Value
Type | Description |
---|---|
System.Single |
mixOutTime
The time in seconds that an ease out or blend out starts
Declaration
public double mixOutTime { get; }
Property Value
Type | Description |
---|---|
System.Double |
parentTrack
Returns the TrackAsset to which this clip is attached.
Declaration
public TrackAsset parentTrack { get; set; }
Property Value
Type | Description |
---|---|
TrackAsset |
postExtrapolationMode
Returns whether the clip is being extrapolated past the end time.
Declaration
public TimelineClip.ClipExtrapolation postExtrapolationMode { get; }
Property Value
Type | Description |
---|---|
TimelineClip.ClipExtrapolation |
preExtrapolationMode
Returns whether the clip is being extrapolated before the start time.
Declaration
public TimelineClip.ClipExtrapolation preExtrapolationMode { get; }
Property Value
Type | Description |
---|---|
TimelineClip.ClipExtrapolation |
recordable
Returns whether this clip is recordable in editor
Declaration
public bool recordable { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
start
The start time, in seconds, of the clip
Declaration
public double start { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
timeScale
A speed multiplier for the clip;
Declaration
public double timeScale { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
CreateCurves(String)
Creates an AnimationClip to store animated properties for the attached PlayableAsset.
Declaration
public void CreateCurves(string curvesClipName)
Parameters
Type | Name | Description |
---|---|---|
System.String | curvesClipName | 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 curves already exists for this clip, this method produces no result regardless of the value specified for curvesClipName.
EvaluateMixIn(Double)
Given a time, returns the weight from the mix in
Declaration
public float EvaluateMixIn(double time)
Parameters
Type | Name | Description |
---|---|---|
System.Double | time | Time (relative to the timeline) |
Returns
Type | Description |
---|---|
System.Single |
EvaluateMixOut(Double)
Given a time, returns the weight from the mix out
Declaration
public float EvaluateMixOut(double time)
Parameters
Type | Name | Description |
---|---|---|
System.Double | time | Time (relative to the timeline) |
Returns
Type | Description |
---|---|
System.Single |
IsExtrapolatedTime(Double)
Given a time, returns whether it falls within the clips extrapolation
Declaration
public bool IsExtrapolatedTime(double sequenceTime)
Parameters
Type | Name | Description |
---|---|---|
System.Double | sequenceTime | The time relative to the timeline |
Returns
Type | Description |
---|---|
System.Boolean |
IsPostExtrapolatedTime(Double)
Given a time, returns whether it falls within the clip post-extrapolation
Declaration
public bool IsPostExtrapolatedTime(double sequenceTime)
Parameters
Type | Name | Description |
---|---|---|
System.Double | sequenceTime | The time relative to the timeline |
Returns
Type | Description |
---|---|
System.Boolean |
IsPreExtrapolatedTime(Double)
Given a time, returns whether it falls within the clip pre-extrapolation
Declaration
public bool IsPreExtrapolatedTime(double sequenceTime)
Parameters
Type | Name | Description |
---|---|---|
System.Double | sequenceTime | The time relative to the timeline |
Returns
Type | Description |
---|---|
System.Boolean |
ToLocalTime(Double)
Converts from global time to a clips local time.
Declaration
public double ToLocalTime(double time)
Parameters
Type | Name | Description |
---|---|---|
System.Double | time | time relative to the timeline |
Returns
Type | Description |
---|---|
System.Double | The local time with extrapolation applied |
ToLocalTimeUnbound(Double)
Converts from global time to local time of the clip
Declaration
public double ToLocalTimeUnbound(double time)
Parameters
Type | Name | Description |
---|---|---|
System.Double | time | The time relative to the timeline |
Returns
Type | Description |
---|---|
System.Double | The local time, ignoring any extrapolation or bounds |
ToString()
Outputs a more readable representation of the timeline clip as a string
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |