docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class TimelineClip

    A range bar on a TimelineTrack.

    Inheritance
    object
    CallbackEventHandler
    Focusable
    VisualElement
    BaseVisualElement
    TimelinePart
    TimelineClip
    Implements
    IEventHandler
    IResolvedStyle
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IContextOverrideElement
    IAdditionalDataHolder
    Inherited Members
    TimelinePart.axis
    TimelinePart.timeline
    TimelinePart.TimeToX(float)
    BaseVisualElement.contextPrefix
    BaseVisualElement.densityOverride
    BaseVisualElement.themeOverride
    BaseVisualElement.langOverride
    BaseVisualElement.layoutDirectionOverride
    BaseVisualElement.preferredTooltipPlacementOverride
    BaseVisualElement.tooltipDelayMsOverride
    BaseVisualElement.GetLayoutDirectionUssClassName(Dir)
    VisualElement.disabledUssClassName
    VisualElement.SetActivePseudoState(bool)
    VisualElement.SetCheckedPseudoState(bool)
    VisualElement.Focus()
    VisualElement.SendEvent(EventBase)
    VisualElement.SetEnabledFromHierarchy(bool)
    VisualElement.SetEnabled(bool)
    VisualElement.MarkDirtyRepaint()
    VisualElement.IsMarkedForRepaint()
    VisualElement.ContainsPoint(Vector2)
    VisualElement.Overlaps(Rect)
    VisualElement.DoMeasure(float, VisualElement.MeasureMode, float, VisualElement.MeasureMode)
    VisualElement.ToString()
    VisualElement.GetClasses()
    VisualElement.ClearClassList()
    VisualElement.AddToClassList(string)
    VisualElement.RemoveFromClassList(string)
    VisualElement.ToggleInClassList(string)
    VisualElement.EnableInClassList(string, bool)
    VisualElement.ClassListContains(string)
    VisualElement.FindAncestorUserData()
    VisualElement.SetBinding(BindingId, Binding)
    VisualElement.GetBinding(BindingId)
    VisualElement.TryGetBinding(BindingId, out Binding)
    VisualElement.GetBindingInfos()
    VisualElement.GetBindingInfos(List<BindingInfo>)
    VisualElement.HasBinding(BindingId)
    VisualElement.ClearBinding(BindingId)
    VisualElement.ClearBindings()
    VisualElement.GetHierarchicalDataSourceContext()
    VisualElement.GetDataSourceContext(BindingId)
    VisualElement.TryGetDataSourceContext(BindingId, out DataSourceContext)
    VisualElement.TryGetLastBindingToUIResult(in BindingId, out BindingResult)
    VisualElement.TryGetLastBindingToSourceResult(in BindingId, out BindingResult)
    VisualElement.Add(VisualElement)
    VisualElement.Insert(int, VisualElement)
    VisualElement.Remove(VisualElement)
    VisualElement.RemoveAt(int)
    VisualElement.Clear()
    VisualElement.ElementAt(int)
    VisualElement.IndexOf(VisualElement)
    VisualElement.Children()
    VisualElement.Sort(Comparison<VisualElement>)
    VisualElement.BringToFront()
    VisualElement.SendToBack()
    VisualElement.PlaceBehind(VisualElement)
    VisualElement.PlaceInFront(VisualElement)
    VisualElement.RemoveFromHierarchy()
    VisualElement.GetFirstOfType<T>()
    VisualElement.GetFirstAncestorOfType<T>()
    VisualElement.Contains(VisualElement)
    VisualElement.FindCommonAncestor(VisualElement)
    VisualElement.viewDataKey
    VisualElement.userData
    VisualElement.canGrabFocus
    VisualElement.focusController
    VisualElement.disablePlayModeTint
    VisualElement.usageHints
    VisualElement.transform
    VisualElement.scaledPixelsPerPoint
    VisualElement.layout
    VisualElement.contentRect
    VisualElement.paddingRect
    VisualElement.worldBound
    VisualElement.localBound
    VisualElement.worldTransform
    VisualElement.hasActivePseudoState
    VisualElement.hasInactivePseudoState
    VisualElement.hasHoverPseudoState
    VisualElement.hasCheckedPseudoState
    VisualElement.hasEnabledPseudoState
    VisualElement.hasDisabledPseudoState
    VisualElement.hasFocusPseudoState
    VisualElement.hasRootPseudoState
    VisualElement.pickingMode
    VisualElement.name
    VisualElement.enabledInHierarchy
    VisualElement.enabledSelf
    VisualElement.languageDirection
    VisualElement.visible
    VisualElement.generateVisualContent
    VisualElement.dataSource
    VisualElement.dataSourcePath
    VisualElement.dataSourceType
    VisualElement.experimental
    VisualElement.hierarchy
    VisualElement.cacheAsBitmap
    VisualElement.parent
    VisualElement.panel
    VisualElement.contentContainer
    VisualElement.visualTreeAssetSource
    VisualElement.this[int]
    VisualElement.childCount
    VisualElement.schedule
    VisualElement.style
    VisualElement.resolvedStyle
    VisualElement.customStyle
    VisualElement.styleSheets
    VisualElement.tooltip
    Focusable.Blur()
    Focusable.focusable
    Focusable.tabIndex
    Focusable.delegatesFocus
    CallbackEventHandler.RegisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.RegisterCallbackOnce<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.RegisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TUserArgsType, TrickleDown)
    CallbackEventHandler.RegisterCallbackOnce<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TUserArgsType, TrickleDown)
    CallbackEventHandler.RegisterCallback<TEventType>(EventCallback<TEventType>, CallbackOptions)
    CallbackEventHandler.RegisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TUserArgsType, CallbackOptions)
    CallbackEventHandler.UnregisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType>(EventCallback<TEventType>, CallbackOptions)
    CallbackEventHandler.UnregisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, CallbackOptions)
    CallbackEventHandler.UnregisterAllRemovableCallbacks()
    CallbackEventHandler.HasTrickleDownHandlers()
    CallbackEventHandler.HasBubbleUpHandlers()
    CallbackEventHandler.ExecuteDefaultActionAtTarget(EventBase)
    CallbackEventHandler.HandleEventBubbleUp(EventBase)
    CallbackEventHandler.HandleEventTrickleDown(EventBase)
    CallbackEventHandler.ExecuteDefaultAction(EventBase)
    CallbackEventHandler.NotifyPropertyChanged(in BindingId)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Unity.AppUI.UI
    Assembly: Unity.AppUI.dll
    Syntax
    [UxmlElement]
    public class TimelineClip : TimelinePart, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IContextOverrideElement, IAdditionalDataHolder
    Remarks

    Drag the body to move the clip and either edge to resize it. Both gestures snap to the Timeline's step and are clamped inside [0, duration], and a resize never takes the clip below minDuration. The geometry is committed once on release through changed, not on every pointer tick, so one drag is one edit; dragMove reports the live geometry in between for previews.

    Examples
    var clip = new TimelineClip { start = 4f, duration = 12f, label = "Walk" };
    clip.changed += (start, duration) => Persist(start, duration);
    track.Add(clip);

    Constructors

    TimelineClip()

    Default constructor.

    Declaration
    public TimelineClip()

    Fields

    defaultMinDuration

    The smallest duration a resize will leave, in time units.

    Declaration
    public const float defaultMinDuration = 0.5
    Field Value
    Type Description
    float

    dragHandleIconUssClassName

    The styling class of the icon inside a handle-variant clip's drag handle.

    Declaration
    public const string dragHandleIconUssClassName = "appui-timeline__clip-drag-handle-icon"
    Field Value
    Type Description
    string

    dragHandleUssClassName

    The styling class of a frame clip's drag handle strip.

    Declaration
    public const string dragHandleUssClassName = "appui-timeline__clip-drag-handle"
    Field Value
    Type Description
    string

    edgeUssClassName

    The styling class of a clip resize edge.

    Declaration
    public const string edgeUssClassName = "appui-timeline__clip-edge"
    Field Value
    Type Description
    string

    fillUssClassName

    The styling class of a frame clip's translucent body.

    Declaration
    public const string fillUssClassName = "appui-timeline__clip-fill"
    Field Value
    Type Description
    string

    frameColorUssClassName

    The styling class prefix carrying a frame clip's hue.

    Declaration
    public const string frameColorUssClassName = "appui-timeline__clip--frame-"
    Field Value
    Type Description
    string

    frameUssClassName

    The styling class applied while the clip is a placement frame.

    Declaration
    public const string frameUssClassName = "appui-timeline__clip--frame"
    Field Value
    Type Description
    string

    labelUssClassName

    The styling class of the clip's label.

    Declaration
    public const string labelUssClassName = "appui-timeline__clip-label"
    Field Value
    Type Description
    string

    maxFrameHandleHeight

    The tallest a frame clip's handle strip gets, in pixels.

    Declaration
    public const float maxFrameHandleHeight = 22
    Field Value
    Type Description
    float

    ussClassName

    The TimelineClip main styling class.

    Declaration
    public const string ussClassName = "appui-timeline__clip"
    Field Value
    Type Description
    string

    variantUssClassName

    The styling class prefix carrying the clip's variant.

    Declaration
    public const string variantUssClassName = "appui-timeline__clip--"
    Field Value
    Type Description
    string

    Properties

    color

    The bar fill. Unset falls back to the track colour, then to the stylesheet.

    Declaration
    [Tooltip("The bar fill. Unset falls back to the track colour.")]
    [CreateProperty]
    [UxmlAttribute]
    public Optional<Color> color { get; set; }
    Property Value
    Type Description
    Optional<Color>

    draggable

    Whether dragging the body moves the clip.

    Declaration
    [Tooltip("Whether dragging the body moves the clip.")]
    [CreateProperty]
    [UxmlAttribute]
    public bool draggable { get; set; }
    Property Value
    Type Description
    bool

    duration

    The clip's length, in time units.

    Declaration
    [Tooltip("The clip's length, in time units.")]
    [CreateProperty]
    [UxmlAttribute]
    public float duration { get; set; }
    Property Value
    Type Description
    float

    frame

    Whether the clip renders as a translucent placement frame.

    Declaration
    [Tooltip("Whether the clip renders as a translucent placement frame.")]
    [CreateProperty]
    [UxmlAttribute]
    public bool frame { get; set; }
    Property Value
    Type Description
    bool
    Remarks

    A frame marks where something sits without claiming the lane the way a solid clip does: the body is translucent and pointer-transparent, so a click passes through to the lane behind it, and only the handle strip along the top drags the frame.

    frameColor

    The hue a frame clip takes. Purple by default.

    Declaration
    [Tooltip("The hue a frame clip takes.")]
    [CreateProperty]
    [UxmlAttribute]
    public TimelineFrameColor frameColor { get; set; }
    Property Value
    Type Description
    TimelineFrameColor

    frameHeight

    An explicit height for a frame clip, in pixels, drawn from the lane top. Zero, the default, fills the lane.

    Declaration
    [Tooltip("An explicit height for a frame clip, in pixels. Zero fills the lane.")]
    [CreateProperty]
    [UxmlAttribute]
    public float frameHeight { get; set; }
    Property Value
    Type Description
    float
    Remarks

    The handle strip is the smaller of this and maxFrameHandleHeight, so a tall frame does not turn its whole body into a drag surface.

    label

    The text drawn inside the bar.

    Declaration
    [Tooltip("The text drawn inside the bar.")]
    [CreateProperty]
    [UxmlAttribute]
    public string label { get; set; }
    Property Value
    Type Description
    string

    minDuration

    The smallest duration a resize will leave, in time units.

    Declaration
    [Tooltip("The smallest duration a resize will leave, in time units.")]
    [CreateProperty]
    [UxmlAttribute]
    public float minDuration { get; set; }
    Property Value
    Type Description
    float

    resizable

    Whether dragging an edge resizes the clip. Until assigned, it follows the variant: true for a Bar, false for the handle and surface variants, which draw no span to take hold of.

    Declaration
    [Tooltip("Whether dragging an edge resizes the clip.")]
    [CreateProperty]
    [UxmlAttribute]
    public bool resizable { get; set; }
    Property Value
    Type Description
    bool

    selected

    Whether the clip draws its selected outline.

    Declaration
    [Tooltip("Whether the clip draws its selected outline.")]
    [CreateProperty]
    [UxmlAttribute]
    public bool selected { get; set; }
    Property Value
    Type Description
    bool

    start

    The clip's start on the time axis, in time units.

    Declaration
    [Tooltip("The clip's start on the time axis, in time units.")]
    [CreateProperty]
    [UxmlAttribute]
    public float start { get; set; }
    Property Value
    Type Description
    float

    variant

    How the clip draws its span. Bar by default.

    Declaration
    [Tooltip("How the clip draws its span.")]
    [CreateProperty]
    [UxmlAttribute]
    public TimelineClipVariant variant { get; set; }
    Property Value
    Type Description
    TimelineClipVariant
    Remarks

    For a track whose lane already shows the span, a bar would say it twice: Handle draws only a drag handle at the clip's start, and Surface draws nothing, so the lane itself is what you take hold of to move the clip.

    Methods

    GetFrameColorUssClassName(TimelineFrameColor)

    Declaration
    public static string GetFrameColorUssClassName(TimelineFrameColor enumValue)
    Parameters
    Type Name Description
    TimelineFrameColor enumValue
    Returns
    Type Description
    string

    GetVariantUssClassName(TimelineClipVariant)

    Declaration
    public static string GetVariantUssClassName(TimelineClipVariant enumValue)
    Parameters
    Type Name Description
    TimelineClipVariant enumValue
    Returns
    Type Description
    string

    OnAxisChanged()

    Re-project this part onto the current axis.

    Declaration
    protected override void OnAxisChanged()
    Overrides
    TimelinePart.OnAxisChanged()
    Remarks

    Called on attach and on every axis change — a scale, zoom, pan, playhead, tick or selection change. Guard against a null axis.

    Events

    changed

    Raised once on release with the committed start and duration.

    Declaration
    public event Action<float, float> changed
    Event Type
    Type Description
    Action<float, float>

    clicked

    Raised when the clip body is clicked without dragging.

    Declaration
    public event Action clicked
    Event Type
    Type Description
    Action

    doubleClicked

    Raised when the clip is double-clicked.

    Declaration
    public event Action doubleClicked
    Event Type
    Type Description
    Action

    dragMove

    Raised on every pointer move during a drag with the live start and duration.

    Declaration
    public event Action<float, float> dragMove
    Event Type
    Type Description
    Action<float, float>

    Implements

    IEventHandler
    IResolvedStyle
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IContextOverrideElement
    IAdditionalDataHolder

    Extension Methods

    VisualElementExtensions.FindNavController(VisualElement)
    RegisterUpdateCallbackExtensions.RegisterUpdateCallback(VisualElement, EventCallback<UpdateEvent>)
    RegisterUpdateCallbackExtensions.UnregisterUpdateCallback(VisualElement, EventCallback<UpdateEvent>)
    VisualElementExtensions.EnableDynamicTransform(VisualElement, bool)
    VisualElementExtensions.EnablePicking(VisualElement, bool)
    VisualElementExtensions.GetChildren<T>(VisualElement, bool)
    VisualElementExtensions.GetContextProvider<T>(VisualElement)
    VisualElementExtensions.GetContextProvider<T>(VisualElement, string)
    VisualElementExtensions.GetContext<T>(VisualElement)
    VisualElementExtensions.GetContext<T>(VisualElement, string)
    VisualElementExtensions.GetExclusiveRootElement(VisualElement)
    VisualElementExtensions.GetLastAncestorOfType<T>(VisualElement)
    VisualElementExtensions.GetPreferredTooltipPlacement(VisualElement)
    VisualElementExtensions.GetSelfContext<T>(VisualElement)
    VisualElementExtensions.GetSelfContext<T>(VisualElement, string)
    VisualElementExtensions.GetTooltipContent(VisualElement)
    VisualElementExtensions.GetTooltipTemplate(VisualElement)
    VisualElementExtensions.HasAncestorOfType<T>(VisualElement, bool)
    VisualElementExtensions.HasAncestorsOfType<T>(VisualElement)
    VisualElementExtensions.IsContextProvider<T>(VisualElement)
    VisualElementExtensions.IsContextProvider<T>(VisualElement, string)
    VisualElementExtensions.IsInvisible(VisualElement)
    VisualElementExtensions.IsOnScreen(VisualElement)
    VisualElementExtensions.ProvideContext<T>(VisualElement, string, T)
    VisualElementExtensions.ProvideContext<T>(VisualElement, T)
    VisualElementExtensions.RegisterContextChangedCallback<T>(VisualElement, string, EventCallback<ContextChangedEvent<T>>)
    VisualElementExtensions.RegisterContextChangedCallback<T>(VisualElement, EventCallback<ContextChangedEvent<T>>)
    VisualElementExtensions.SetPreferredTooltipPlacement(VisualElement, OptionalEnum<PopoverPlacement>)
    VisualElementExtensions.SetTooltipContent(VisualElement, VisualElementExtensions.TooltipContentCallback)
    VisualElementExtensions.SetTooltipTemplate(VisualElement, VisualElement)
    VisualElementExtensions.UnregisterContextChangedCallback<T>(VisualElement, string, EventCallback<ContextChangedEvent<T>>)
    VisualElementExtensions.UnregisterContextChangedCallback<T>(VisualElement, EventCallback<ContextChangedEvent<T>>)
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)