Class TimelineClip
Represents a clip on the timeline.
Implements
Inherited Members
Namespace: UnityEngine.Timeline
Assembly: Unity.Timeline.dll
Syntax
[Serializable]
public class TimelineClip : 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 |
---|---|
float |
kTimeScaleMax
The maximum timescale allowed on a clip
Declaration
public static readonly double kTimeScaleMax
Field Value
Type | Description |
---|---|
double |
kTimeScaleMin
The minimum timescale allowed on a clip
Declaration
public static readonly double kTimeScaleMin
Field Value
Type | Description |
---|---|
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 |
---|---|
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 |
---|---|
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 |
---|---|
double |
clipAssetDuration
The length, in seconds, of the PlayableAsset attached to the clip.
Declaration
public double clipAssetDuration { get; }
Property Value
Type | Description |
---|---|
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 |
---|---|
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 |
---|---|
string |
duration
The length, in seconds, of the clip
Declaration
public double duration { get; set; }
Property Value
Type | Description |
---|---|
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 |
---|---|
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 |
---|---|
double |
easeOutTime
The time in seconds that the ease out begins
Declaration
public double easeOutTime { get; }
Property Value
Type | Description |
---|---|
double |
eastOutTime
eastOutTime property is obsolete use easeOutTime property instead
Declaration
[Obsolete("Use easeOutTime instead (UnityUpgradable) -> easeOutTime", true)]
public double eastOutTime { get; }
Property Value
Type | Description |
---|---|
double |
end
The end time, in seconds of the clip
Declaration
public double end { get; }
Property Value
Type | Description |
---|---|
double |
exposedParameters
exposedParameter is deprecated and will be removed in a future release
Declaration
[Obsolete("exposedParameter is deprecated and will be removed in a future release", true)]
public List<string> exposedParameters { get; }
Property Value
Type | Description |
---|---|
List<string> |
extrapolatedDuration
The length of the clip in seconds, including extrapolation.
Declaration
public double extrapolatedDuration { get; }
Property Value
Type | Description |
---|---|
double |
extrapolatedStart
The start time of the clip, accounting for pre-extrapolation
Declaration
public double extrapolatedStart { get; }
Property Value
Type | Description |
---|---|
double |
hasBlendIn
Returns whether the clip is blending in
Declaration
public bool hasBlendIn { get; }
Property Value
Type | Description |
---|---|
bool |
hasBlendOut
Returns whether the clip is blending out
Declaration
public bool hasBlendOut { get; }
Property Value
Type | Description |
---|---|
bool |
hasCurves
Whether this clip contains animated properties for the attached PlayableAsset.
Declaration
public bool hasCurves { get; }
Property Value
Type | Description |
---|---|
bool |
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 |
---|---|
bool |
hasPreExtrapolation
Is the clip being extrapolated before its start time?
Declaration
public bool hasPreExtrapolation { get; }
Property Value
Type | Description |
---|---|
bool |
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 |
---|---|
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 |
---|---|
float |
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 |
---|---|
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 |
---|---|
float |
mixOutTime
The time in seconds that an ease out or blend out starts
Declaration
public double mixOutTime { get; }
Property Value
Type | Description |
---|---|
double |
parentTrack
Returns the TrackAsset to which this clip is attached.
Declaration
[Obsolete("parentTrack is deprecated and will be removed in a future release. Use GetParentTrack() and TimelineClipExtensions::MoveToTrack() or TimelineClipExtensions::TryMoveToTrack() instead.", false)]
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 |
---|---|
bool |
start
The start time, in seconds, of the clip
Declaration
public double start { get; set; }
Property Value
Type | Description |
---|---|
double |
timeScale
A speed multiplier for the clip;
Declaration
public double timeScale { get; set; }
Property Value
Type | Description |
---|---|
double |
underlyingAsset
underlyingAsset property is obsolete. Use asset property instead
Declaration
[Obsolete("underlyingAsset property is obsolete. Use asset property instead", true)]
public Object underlyingAsset { get; set; }
Property Value
Type | Description |
---|---|
Object |
Methods
ConformEaseValues()
Use this method to adjust ease in and ease out values to avoid overlapping.
Declaration
public void ConformEaseValues()
Remarks
Ease values will be adjusted to respect the ratio between ease in and ease out.
CreateCurves(string)
Creates an AnimationClip to store animated properties for the attached PlayableAsset.
Declaration
public void CreateCurves(string curvesClipName)
Parameters
Type | Name | Description |
---|---|---|
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 |
---|---|---|
double | time | Time (relative to the timeline) |
Returns
Type | Description |
---|---|
float |
EvaluateMixOut(double)
Given a time, returns the weight from the mix out
Declaration
public float EvaluateMixOut(double time)
Parameters
Type | Name | Description |
---|---|---|
double | time | Time (relative to the timeline) |
Returns
Type | Description |
---|---|
float |
GetParentTrack()
Get the TrackAsset to which this clip is attached.
Declaration
public TrackAsset GetParentTrack()
Returns
Type | Description |
---|---|
TrackAsset | the parent TrackAsset |
IsExtrapolatedTime(double)
Given a time, returns whether it falls within the clip's extrapolation
Declaration
public bool IsExtrapolatedTime(double sequenceTime)
Parameters
Type | Name | Description |
---|---|---|
double | sequenceTime | The time relative to the timeline |
Returns
Type | Description |
---|---|
bool | True if |
IsPostExtrapolatedTime(double)
Given a time, returns whether it falls within the clip's post-extrapolation
Declaration
public bool IsPostExtrapolatedTime(double sequenceTime)
Parameters
Type | Name | Description |
---|---|---|
double | sequenceTime | The time relative to the timeline |
Returns
Type | Description |
---|---|
bool | True if |
IsPreExtrapolatedTime(double)
Given a time, returns whether it falls within the clip's pre-extrapolation
Declaration
public bool IsPreExtrapolatedTime(double sequenceTime)
Parameters
Type | Name | Description |
---|---|---|
double | sequenceTime | The time relative to the timeline |
Returns
Type | Description |
---|---|
bool | True if |
ToLocalTime(double)
Converts from global time to a clips local time.
Declaration
public double ToLocalTime(double time)
Parameters
Type | Name | Description |
---|---|---|
double | time | time relative to the timeline |
Returns
Type | Description |
---|---|
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 |
---|---|---|
double | time | The time relative to the timeline |
Returns
Type | Description |
---|---|
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 |
---|---|
string |