Class AnimationEditorWindow

The AnimationEditorWindow class implements a DockableEditorWindow. The window allows the user to manipulate keyframes of animation curves, add/remove curves from an animation clip, and manipulate animation events.

Hierarchy (view full)

Constructors

Properties

Accessors

Methods

Events

Constructors

Properties

onPropertyRemoveSelected: (() => void)

Invoked when the user chose to remove all selected properties.

onResourceDirtyChanged: ((resource: Resource, isDirty: boolean) => void)

Called when the resource dirty state changed.

allowImportedClipModifications: boolean

Determines if imported clip can be modified.

windowContentPadding: RectOffset

The default window content padding to be used for editor windows.

windowPadding: number

The default window padding.

Accessors

  • get active(): boolean
  • Checks whether the window the currently active window in its container. This means the window's tab is active or the window is the only one in its container.

    Returns boolean

  • get allowObjectSelection(): boolean
  • Determines if the object selection can be changed.

    Returns boolean

  • set allowObjectSelection(value): void
  • Parameters

    • value: boolean

    Returns void

  • get animationClip(): AnimationClip
  • The animation clip currently loaded on the window. Can be assigned externally to change the clip being edited on the window.

    Returns AnimationClip

  • set animationClip(value): void
  • Parameters

    Returns void

  • get bounds(): Immutable<Rect2>
  • Returns the bounds of the window in pixels, relative to its parent container in points.

    Returns Immutable<Rect2>

  • get boundsInPixels(): Immutable<Rect2>
  • Returns the bounds of the window in pixels, relative to its parent container in pixels.

    Returns Immutable<Rect2>

  • get containerWindow(): EditorWindow
  • Gets the parent editor window this window is docked in. Can be null (for example when window is in the process of dragging and not visible).

    Returns EditorWindow

  • get contentBoundsInPixels(): Immutable<Rect2>
  • Returns the bounds of the contents of the window in pixels, regardless of whether the window is docked or not.

    Returns Immutable<Rect2>

  • get contentHeight(): number
  • Returns the height of the window contents in points.

    Returns number

  • get contentHeightInPixels(): number
  • Returns the height of the window contents in pixels.

    Returns number

  • get contentWidth(): number
  • Returns the width of the window contents in points.

    Returns number

  • get contentWidthInPixels(): number
  • Returns the width of the window contents in pixels.

    Returns number

  • get dpiScale(): number
  • Returns the DPI scale factor.

    Returns number

    The DPI scale is in relation to a 1x base resolution of 75 DPI.

  • get fps(): number
  • Sampling rate of the animation in frames per second. Determines granularity at which positions keyframes can be placed.

    Returns number

  • set fps(value): void
  • Parameters

    • value: number

    Returns void

  • get height(): number
  • Returns the height of the window in points.

    Returns number

  • get heightInPixels(): number
  • Sets the height of the window in pixels.

    Returns number

  • set heightInPixels(value): void
  • Parameters

    • value: number

    Returns void

  • get icon(): Image
  • Gets the icon for the window.

    Returns Image

  • set icon(value): void
  • Gets the icon for the window.

    Parameters

    Returns void

  • get isDestroyed(): boolean
  • Determines whether the window has been destroyed or not.

    Returns boolean

  • get isFocused(): boolean
  • Makes the window in or out focus. Surface can only be made in focus if it is active.

    Returns boolean

  • set isFocused(value): void
  • Checks whether the window currently has keyboard focus.

    Parameters

    • value: boolean

    Returns void

  • get isInitialized(): boolean
  • Checks has the TypeScript window been initialized.

    Returns boolean

  • get isPointerHovering(): boolean
  • Determines is the mouse pointer currently hovering over the editor window.

    Returns boolean

  • get left(): number
  • Returns the X position of the window in screen coordinates in points.

    Returns number

  • get localShortcutContext(): ShortcutContext
  • Specifies the local shortcut context. This context will be automatically disabled whenever the user switches focus from the context.

    Returns ShortcutContext

  • Returns MenuItemDelegate

  • Parameters

    Returns void

  • get name(): string
  • Gets a unique name for this window. This name will be used for referencing the window by other systems.

    Returns string

  • get pickedSceneObject(): UUID
  • Returns UUID

  • set pickedSceneObjectUUID(uuid): void
  • Sets the current picked scene object.

    Parameters

    Returns void

  • get position(): Immutable<Vector2>
  • Determines the position in which the key window is, in screen coordinates.

    Returns Immutable<Vector2>

  • get renderWindow(): RenderWindow
  • Gets the RenderWindow associated with this EditorWindow.

    Returns RenderWindow

  • get sceneObjectMode(): EnumValue<AnimationEditorSceneObjectMode, number>
  • Returns EnumValue<AnimationEditorSceneObjectMode, number>

  • set sceneObjectMode(value): void
  • Sets the scene object mode.

    Parameters

    • value: EnumValue<AnimationEditorSceneObjectMode, number>

    Returns void

  • get screenBoundsInPixels(): Immutable<Rect2>
  • Returns the bounds of the window in pixels, relative to its parent container in pixels.

    Returns Immutable<Rect2>

  • get shortcutContext(): ShortcutContext
  • Specifies the global shortcut context. This context will be always enabled as long as the window is active.

    Returns ShortcutContext

  • get shouldHandleInput(): boolean
  • Checks if the window should handle input. This can be used by window implementations to check before handling input events.

    Returns boolean

  • get title(): I18N
  • Gets the display name for the window. This is what editor users will see in the window title bar.

    Returns I18N

  • set title(value): void
  • Parameters

    Returns void

  • get top(): number
  • Returns the X position of the window in screen coordinates in points.

    Returns number

  • get ui(): UIPanel
  • Returns UIPanel

  • get undoRedo(): UndoRedo
  • Get the local undo redo of the window.

    Returns UndoRedo

  • get width(): number
  • Returns the width of the window in points.

    Returns number

  • get widthInPixels(): number
  • Sets the width of the window in pixels.

    Returns number

  • set widthInPixels(value): void
  • Parameters

    • value: number

    Returns void

Methods

  • Registers a new animation property.

    Parameters

    Returns void

    UIPropertyPicker.onElementSelected

  • Add support to the given Drop data type.

    Parameters

    • osDropType: EnumValue<OSDropDataType, number>

      The type of the data from OS to support.

    • actionName: string

      The text representing the action of dropping into this window.

    Returns void

  • Applies any changes made to the animation curves and events to the actual animation clip resource.

    Returns void

  • Closes the window but keeps it on the dock manager. Calling raise will make it visible again.

    Returns void

  • Deselects a animation property field, hiding the curve display from the curve display UI element.

    Parameters

    • path: string

      Path of the field to hide.

    Returns void

  • Discards any changes made to the resource and reloads the clip.

    Returns void

  • Iterates over all elements of a property and calls the provided action for every element with the current value of the property. Only works with floating point (any dimension), integer, color and boolean property types. Since reported values are always floating point booleans are encoded as -1.0f for false and 1.0f for true, and integers are converted to floating point.

    Parameters

    • property: InspectableProperty

      Property whose elements to iterate over.

    • callback: ((elementValue: number, elementIndex: number) => void)

      Callback to trigger for each element. The callback receives the current value of the property's element and the sequential index of the element.

        • (elementValue, elementIndex): void
        • Parameters

          • elementValue: number
          • elementIndex: number

          Returns void

    Returns void

  • Iterates over all element of a property, calls the provided action which returns a new value to be assigned to the property element. Only works with floating point (any dimension), integer, color and boolean property types. Since reported values are always floating point booleans are encoded as -1.0f for false and 1.0f for true, and integers are converted to floating point.

    Parameters

    • property: InspectableProperty

      Property whose elements to iterate over.

    • callback: ((elementIndex: number) => number)

      Callback to trigger for each element. The callback receives the current value of the property's element and the sequential index of the element.

        • (elementIndex): number
        • Parameters

          • elementIndex: number

          Returns number

    Returns void

  • If a path has sub-elements (e.g. .x, .r), returns a path without those elements. Otherwise returns the original path.

    Parameters

    • path: string

      Path to check.

    Returns string

    Path without sub-elements.

  • Checks if one curve field path a parent of the other.

    Parameters

    • child: string

      Path to check if it is a child of parent.

    • parent: string

      Path to check if it is a parent of child.

    Returns boolean

    True if child is a child of parent.

  • Refreshes the contents of the curve and property display by loading animation curves from the provided animation clip.

    Parameters

    Returns void

  • Locks the animation property with the specified path.

    Parameters

    • path: string

      Path of the field.

    • isLocked: boolean

      True if locked.

    Returns void

    UIPropertyPicker.onElementSelected

  • Virtual

    Method to override to implement destruction of custom windows. Called by the engine before the window is destroyed.

    Returns void

  • Virtual

    Method to override to implement custom behavior of a window, called by the engine once per frame.

    Returns void

  • Virtual

    Method to override to implement custom behavior of a window, called by the engine once per frame, once all the windows had their onEditorUpdate() method called.

    Returns void

  • Virtual

    Method to override to implement initialization of custom windows. Called by the engine after window creation.

    Parameters

    • options: any

    Returns void

  • Virtual

    Called whenever window visibility changed.

    Parameters

    • isVisible: boolean

    Returns void

    Implementing classes must call super.

  • Virtual

    Triggered whenever the window gains or loses focus.

    Parameters

    • inFocus: boolean

      True if focus was gained, false otherwise.

    Returns void

  • Virtual

    Triggered whenever the window size changes.

    Parameters

    • width: number

      New width of the window in pixels.

    • height: number

      New height of the window in pixels.

    Returns void

  • Brings the editor window to focus. If it is docked, it's dock container will switch to the window's tab or if undocked the floating window will gain focus.

    Returns void

  • Iterates over all curve path fields and records their current state. If the state differs from the current curve values, new keyframes are added.

    Parameters

    • time: number

      Time for which to record the state, in seconds.

    Returns boolean

    True if any changes were recorded, false otherwise.

  • Refocuses all curves in the canvas so all curves fit into the current viewport.

    Returns void

  • Removes the animation property with the specified path.

    Parameters

    • path: string

      Path of the field.

    Returns void

    UIPropertyPicker.onElementSelected

  • Deletes all currently selected properties, removing them their curves permanently.

    Returns void

  • Saves any changes made to the animation curves and events to the actual animation clip resource and saves the resources in the library.

    Returns void

  • Selects all curve properties and their elements to be active.

    Parameters

    • OptionalmaximumCurveCount: number

    Returns void

    The curve path will be active for the subpaths.

  • Selects a new animation property field, making the curve display in the curve display UI element.

    Parameters

    Returns void

  • Makes the window active in its container. This means the widgets tab is active and the window is visible.

    Returns void

  • Changes the currently selected frame in the curve display.

    Parameters

    • frameIndex: number

      Index of the frame to select.

    Returns void

  • Defines the window maximum width and height in points.

    Parameters

    • maxWidth: number
    • maxHeight: number

    Returns void

  • Defines the window minimum width and height in points.

    Parameters

    • minWidth: number

      The minimum width of the window in points.

    • minHeight: number

      The minimum height of the window in points.

    Returns void

  • Moves the window on the desktop. Coordinates are in screen space using points.

    Parameters

    • x: number
    • y: number

    Returns void

  • Moves the window on the desktop. Coordinates are in screen space using pixels.

    Parameters

    • x: number
    • y: number

    Returns void

  • Resizes the window using a width and height in points.

    Parameters

    • width: number
    • height: number

    Returns void

  • Resizes the window using a width and height in pixels.

    Parameters

    • width: number
    • height: number

    Returns void

  • Calculates an unique color for each animation curve.

    Returns void

  • Updates the curve display with currently selected curves.

    Returns void

  • Updates the UI element displaying the current animation properties.

    Returns void

  • Updates the currently targeted SceneObject based on the selection mode.

    Parameters

    • OptionalforceUpdate: boolean

    Returns void

  • Updates the window based on the current state.

    Returns void

Events

onResized: Event<[number, number], void>

Triggered whenever window size changes.

onDPIChanged: Event<[], void>

Triggered whenever window's screen dpi changes.

onMoved: Event<[number, number], void>

Triggered whenever window position changes.

onFocusChanged: Event<[boolean], void>

Triggered whenever window receives or loses focus.

onOSDropEnter: Event<[number, number], void>

Triggered when the user do a OS drag on top of this window.

onOSDropLeave: Event<[], void>

Triggered when the user leaves the mouse from a OS drop.

onOSDropCommit: Event<[number, number, readonly Immutable<OSDropData>[]], void>

Triggered when the user actually drops something on top of this window.

onFocusChangedInternal: Event<[boolean], void>