Class SceneKeyWindow

A KeyWindow type that can open a scene with viewport, outliner and inspectors to edit it.

Hierarchy (view full)

Implements

Constructors

Properties

Accessors

Methods

addComponentToScene addFatComponentObjectToScene addSceneObject addStaticMeshObjectToScene addTemplateInstanceToScene beginTutorial center clearUndoRedoHistory close createDefaultLayout createEditorCameraForCurrentUser createEditorWindow createTutorial didRedo didUndo dockDockableEditorWindow dockEditorWindow ensureViewportCamera findExistingViewportCameraForUser focusOnOutlinerOrScene freezeDockableEditorWindow freezeEditorWindow getDockableEditorWindow getDockableLayout getScriptEditorWindow initializeInternal isSceneLoadAvailable isUserListControlSupported isUsingMainToolBarStyle loadSceneFromPath loadSceneFromUUID loadState lockKeyWindow onActiveChanged onCloseRequested onDestroy onEditorUpdate onEditorUpdateLate onInitialize onWindowDPIChanged onWindowFocusChanged onWindowResized onWindowTitleDirty openDockableEditorWindow openEditorWindow queueFrameCapture raise recreateOnModuleReload redo resetLayout saveScene saveState screenToWindowPosition setCurrentScene setDockableLayout setMaximumSize setMinimumSize setPosition setPositionInPixels setSize setSizeInPixels showScenePlayingMessageBox toggleToolbarItem undo unlockKeyWindow updateAsyncResourceLoad updateCloudSyncAutoSaveTimer updateToolbarItemState updateToolbarItemStates willRedo willUndo windowToScreenPosition allScenesStopped dropSceneObjectToGround duplicateSceneObjectToPosition getSceneKeyWindows isAnySceneModified moveSceneObjectToPosition openTypeScriptInternal openWindow openWithScene openWithSceneUUID saveAllScenes stopAllScenes

Events

Constructors

Properties

_libraryWindow: LibraryWindow

SceneKeyWindow.libraryWindow

_outlinerWindow: OutlinerWindow

SceneKeyWindow.outlinerWindow

_resourceDiscussionWindow: ResourceDiscussionWindow

An instance to the ResourceDiscussionWindow owned by this instance Editor.ResourceDiscussionWindow

_sceneInstance: SceneInstance
_scenePlayData: ScenePlayData
_sceneResourceHandle: ResourceHandle<Scene>
_sceneWindow: SceneWindow

SceneKeyWindow.sceneWindow

_viewportCamera: ViewportCamera
_viewportSettingsWindow: ViewportSettingsWindow

SceneKeyWindow.viewportSettingsWindow

onRedo: ((command: UndoableCommandBase) => void)

Event callback called whenever a undoable command is redone in this key window UndoRedo stack.

Type declaration

onUndo: ((command: UndoableCommandBase) => void)

Event callback called whenever a undoable command is undone in this key window UndoRedo stack.

Type declaration

onUndoableCommandRegistered: ((command: UndoableCommandBase) => void)

Event callback called whenever a new undoable command is registered with this key window UndoRedo stack.

Type declaration

    • (command): void
    • Parameters

      Returns void

pingSceneObject: ((sceneObject: SceneObject) => void)

Pings the scene object, highlighting it in its respective editors.

Type declaration

    • (sceneObject): void
    • Parameters

      Returns void

sceneDidChangeDirtyState: ((isDirty: boolean) => void)

Event callback called whenever the scene becomes dirty or clean.

scenePlayDataDidEnterPlayState: (() => void)

Event callback called whenever the engine enters in play mode.

scenePlayDataDidEnterStopState: (() => void)

Event callback called whenever the engine exists play mode.

scenePlayDataDidPause: (() => void)

Event callback called whenever the engine pauses the play mode.

scenePlayDataDidUnpause: (() => void)

Event callback called whenever the engine unpauses the play mode.

scenePlayDataWillBackupScene: (() => void)

Event callback called whenever the engine performs a backup of the scene.

defaultObjectCameraPlacementDistance = 5

The default distance used when spawning objects in front of the camera.

kCloudSyncSaveTimerInSeconds: number

The duration between cloud sync auto save when the scene becomes dirty.

kFrameCaptureDelay: number

Seconds to wait before starting frame capture.

kI18NConvertingScene: string
kI18NLoadingScene: string
kI18NNoEditorCamera: string
kI18NNoSceneLoaded: string

Accessors

  • 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 height(): number
  • Sets the height of the window in points.

    Returns number

  • set height(value): void
  • Parameters

    • value: number

    Returns void

  • 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 implementsISceneSelectionStateAware(): true
  • The interface marker for the ISceneSelectionStateAware interface.

    Returns true

  • get isActive(): boolean
  • Determines if the key window's tab is visible.

    Returns boolean

  • set isActive(value): void
  • Parameters

    • value: boolean

    Returns void

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

    Returns boolean

  • get isFocused(): boolean
  • Checks whether the window currently has keyboard focus.

    Returns boolean

  • set isFocused(value): void
  • Parameters

    • value: boolean

    Returns void

  • get isSceneDirty(): boolean
  • Determines if the scene is dirty.

    Returns boolean

  • get isSceneLoaded(): boolean
  • Determines if a scene is fully loaded and active.

    Returns boolean

  • get isSceneLoadInProgress(): boolean
  • Virtual

    Determines if a scene is currently being loaded asynchronously.

    Returns boolean

  • get isSceneStopped(): boolean
  • Determines if the scene is currenty not playing or paused.

    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

  • get mainCamera(): Camera
  • The camera that renders the scene from the player's perspective.

    Returns Camera

  • get owningContainerWindow(): EditorWindow
  • Gets the window of the owning container. The owning container is window that serves as the host for one or multiple key windows.

    Returns EditorWindow

  • 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 sceneLoadProgress(): number
  • Virtual

    Gets the progress value of the current async scene load in the range [0...1].

    Returns number

  • get sceneLoadProgressString(): string
  • Gets the progress value of the current async scene load as preformatted string.

    Returns string

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

    Returns ShortcutContext

  • get toolBar(): UIToolBar
  • Gets the primary tool bar element.

    Returns UIToolBar

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

    Returns number

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

    Returns UndoRedo

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

    Returns number

  • set width(value): void
  • Parameters

    • value: number

    Returns void

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

    Returns number

  • set widthInPixels(value): void
  • Parameters

    • value: number

    Returns void

  • get windowTitle(): I18N
  • Determines the human name to display on the window title or it's tab.

    Returns I18N

    A string that contains a human readable name for the key window.

  • set windowTitle(value): void
  • Parameters

    Returns void

  • get current(): KeyWindow
  • The currently active key window. Usually this value is null, but can be set to the current window inside an Update call or when calling an event callback for menu or toolbar items.

    Returns KeyWindow

Methods

  • Generates a Component for the currently selected SceneObject, or creates a new one on demand.

    Type Parameters

    Parameters

    • type: ClassOf<T>

      The component type to create

    • OptionalcreateNewSceneObject: boolean

      True to always create a new scene object, otherwise will be assigned to selected.

    • OptionalautoResolveDiffs: boolean

      Automatically resolve the diffs, set to false if you need to resolve manually.

    • OptionalspawnInfront: boolean

      True to spawn the object infront of the camera, otherwise at scene root.

    Returns T

    The newly created component.

  • Adds a FatComponent to the specified parent SceneObject.

    Type Parameters

    Parameters

    • type: ClassOf<T>

      The fat component type to create

    • Optionalparent: SceneObject

      The parent scene object.

    • OptionalautoResolveDiffs: boolean

      Automatically resolve the diffs, set to false if you need to resolve manually.

    • OptionalselectNewObject: boolean

      Automatically select and focus the object.

    • OptionalspawnInfront: boolean

      True to spawn the object infront of the camera, otherwise at scene root.

    Returns SceneObject

  • Adds a new SceneObject, or creates a new one on demand.

    Parameters

    • Optionalparent: SceneObject

      The optional parent scene object.

    • OptionalautoResolveDiffs: boolean

      Automatically resolve the diffs, set to false if you need to resolve manually.

    • OptionalspawnInfront: boolean

      True to spawn the object infront of the camera, otherwise at scene root.

    Returns SceneObject

    The newly created scene object.

  • Adds the specified mesh to the scene as StaticMesh.

    Parameters

    • mesh: Mesh

      The mesh

    • Optionalparent: SceneObject
    • OptionalcolliderShapeInformation: any

      The collider Shape Information

    • OptionalselectNewObject: boolean

    Returns SceneObject

  • Adds a template instance for the specified template and returns its newly created root node.

    Parameters

    Returns SceneObject

  • Begins the tutorial for the key window.

    Returns void

  • Centers the window within it's parent window.

    Returns void

  • Virtual

    Closes the key window.

    Returns void

  • Creates a new EditorWindow for usage on this KeyWindow. If the window was already opened before, the window won't be made visible.

    Parameters

    • windowType: Type

      The type of the editor window to be created.

    Returns DockableEditorWindow

    The newly created editor window.

  • Virtual

    A method called internally after the last action is redone.

    Returns void

  • Virtual

    A method called internally after the last action is undone.

    Returns void

  • Docks the specified window to the key window. If the window does not exist yet, a new instance will be created.

    Type Parameters

    Parameters

    • type: ClassOf<T>

      Type of window to dock.

    • Optionallocation: EnumValue<DockLocation, number>

      The dock location.

    • Optionalreference: DockableEditorWindow

      The reference window. The location will determine how and where the new window will be docked.

    • OptionalrelativeSize: number

      The relative size of the new window. Setting it to 0.5, causes dockwindows to be splitted equally.

    Returns T

    Instance of the docked window.

  • Docks a new EditorWindow into the given location.

    Parameters

    • windowType: Type

      The type of the editor window to be docked.

    • location: EnumValue<DockLocation, number>

      The relative location to dock the window to, relative to reference.

    • reference: DockableEditorWindow

      The reference window. Used to determine the meaning location.

    • OptionalrelativeSize: number

      The relative size of the docked window. Setting it to 0.5, causes both the first and second window to have the same size.

    Returns DockableEditorWindow

    The editor window instance of the given type.

  • Creates the editorCamera scene object, if necessary.

    Returns void

  • Finds in the current loaded scene a Scene Object that represents the Editor Camera.

    Parameters

    Returns SceneObject

    The Scene Object of the Editor Camera. Null if not found.

  • Sets keyboard focus to the Hierarchy or Scene windows if open.

    Returns void

  • Sets the given window type as locked. Disables undocking or docking of other windows on the same space. Will also hide the tab bar and the window title.

    Type Parameters

    Parameters

    • type: ClassOf<T>

      The type that represents the window to be marked as locked.

    Returns void

  • Freezes the dockable editor window of type windowType.

    Parameters

    • windowType: Type

      The type of the window to freeze.

    Returns void

  • Virtual

    Determines if the key window can load different scenes.

    Returns boolean

    True if the scene can be changed

  • Virtual

    Gets whether this KeyWindow should display the User List control on the main menu title bar.

    Returns boolean

  • Virtual

    Gets whether this KeyWindow should use the main toolbar style.

    Returns boolean

  • Virtual

    Loads the scene from the specified library path.

    Parameters

    Returns boolean

  • Virtual

    Loads the Scene with the specified uuid.

    Parameters

    • uuid: Const<UUID>

      The scene UUID.

    • OptionalpreloadWithoutDependencies: boolean

      Optional, determines if the scene will be loaded without dependencies. Dependencies will be then streamed in as they become available.

    Returns boolean

    true if the load was started.

  • Virtual

    Loads the key window state to the one represented by state.

    Parameters

    • stateObject: any

    Returns void

  • Locks the window to prevent it from closing.

    Returns void

  • 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

    Triggered whenever the window's screen dpi changes.

    Returns void

  • 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

  • Invoked when the window title must be rebuilt.

    Returns void

  • Type Parameters

    Parameters

    • type: ClassOf<T>

      Type of window to open.

    • OptionalraiseWindow: boolean

      True to raise the window if already opened, but in the background.

    Returns T

    Instance of the open window.

    If the window is already open, the existing instance will be returned.

  • Captures the GPU commands for the next rendered frame after the specified delay.

    Returns void

  • Brings the key window to the top.

    Returns void

  • Virtual

    Determines if the key window must be recreated when the specified module is being reloaded. This is an important task to do if the key window edits classes from the module that is being reloaded. In that case, the key window must be recreated - otherwise, it references outdated classes which results in undefined behavior that can destabilize the application.

    The following are possible modules:

    • rsx - rsx.Editor - rsx.Project - rsx.Project.Editor

    Parameters

    • moduleName: string

      The fully qualified name of the module to be reloaded.

    Returns boolean

  • Executes the last command on the redo stack (last command we called undo on), re-applying its operation.

    Returns void

  • Resets the key window layout to the default.

    Returns void

  • Virtual

    Saves the scene to its resource location. If the scene is currently playing, a prompt appears to stop the scene.

    Parameters

    • isUserConfirmationRequired: boolean

      Determines if the user has to confirm the save operation.

    • OptionalonSuccess: (() => void)

      Action called when the operation succeeds.

        • (): void
        • Returns void

    • OptionalonFailure: (() => void)

      Action called when saving the scene failed, or the user declined to save.

        • (): void
        • Returns void

    Returns void

  • Virtual

    Saves the current key window state. This state can be persisted to disk or saved in memory and later restored by calling LoadState().

    Returns any

    An object that represents the KeyWindow saved state.

  • Changes the currently active scene.

    Parameters

    • sceneInstance: SceneInstance

      The new SceneInstance, pass null to unload the scene and release all handles.

    • OptionalsceneUUID: UUID

      The UUID for the Scene resource.

    Returns void

  • Virtual

    Sets a predefined dockable editor window layout.

    Parameters

    Returns void

    This will override any existing windows on the current layout.

  • 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

  • Shows a message box if the scene is currently playing. The user can then stop the scene and the onSceneStopped delegate is invoked.

    Parameters

    • title: I18N

      The message box title.

    • message: I18N

      The message box message.

    • secondaryMessage: I18N

      The message box's secondary message

    • OptionalonSceneStopped: (() => void)

      The deleagte when the scene has been stopped.

        • (): void
        • Returns void

    • OptionalonCancel: (() => void)

      The delegate when the action has been canceled

        • (): void
        • Returns void

    Returns boolean

    true if the scene is already stopped

  • Toggles an existing toolbar button into an on or off state which changes the visuals of the button.

    Parameters

    • name: string

      Name of the existing button to toggle.

    • isToggled: boolean

      True to toggle on, false to toggle off.

    Returns void

  • Executes the last command on the undo stack, undoing its operations.

    Returns void

  • Unlocks the window to allow to be closed by the user.

    Returns void

  • Virtual

    Updates the asynchronous loading process.

    Returns void

  • Virtual

    Updates the cloud sync auto-save timer. The timer is initialized, once the scene becomes dirty.

    Returns boolean

  • Toggles an existing toolbar button into an on or off state which changes the visuals of the button.

    Parameters

    • name: string

      Name of the existing button to toggle.

    Returns void

  • Updates the toggle state of all main toolbar buttons in the toolbar.

    Returns void

  • Virtual

    A method called internally before the last action is redone.

    Returns void

  • Virtual

    A method called internally before the last action is undone.

    Returns void

  • Determines if all active SceneKeyWindow instances are stopped.

    Returns boolean

  • Drops the sceneObject to the ground.

    Parameters

    Returns void

    The drop is performed using the PhysicsScene of the ´sceneInstance. If no colliders are available below the sceneObject`, the drop cannot be performed.

    This is currently disabled because there is a bug in PhysX 4.1 that the BVH is not updated when a query is made.

  • Duplicates the sceneObjects to the picked position.

    Parameters

    Returns void

  • Gets all open SceneKeyWindow instances.

    Parameters

    • requireLoadedScenes: boolean

    Returns SceneKeyWindow[]

  • Determines if any of the active SceneKeyWindow instances is modified.

    Returns boolean

  • Moves the sceneObjects to the picked position.

    Parameters

    Returns void

  • Internal method used by the managed side to open a newly created KeyWindow object instance.

    Parameters

    • keyWindow: KeyWindow

      The key window instance.

    • state: any

    Returns void

  • Opens and creates a new KeyWindow of the specified type. If state is not null, loadState is also called with the given value for state.

    Type Parameters

    Parameters

    • type: ClassOf<T>
    • Optionalstate: any

      An optional initial state for the key window.

    Returns T

    An instance to the newly created key window.

  • Opens a new SceneKeyWindow with the given scene. A new instance of the scene will be created.

    Parameters

    • Optionalscene: Scene

      The scene to be loaded in the key window.

    Returns SceneKeyWindow

    The newly created key window.

  • Opens a new SceneKeyWindow with the given sceneUUID. A new instance of the scene will be created.

    Parameters

    • sceneUUID: Const<UUID>

      The scene UUID to be loaded in the key window.

    • OptionalpreloadWithoutDependencies: boolean

      Optional, determines if the scene will be loaded without dependencies. Dependencies will be then streamed in as they become available.

    Returns SceneKeyWindow

    The newly created key window.

  • Presents the save dialog for each open scene that is dirty. If the scene has already been saved to disk, the dialog will not be dispayed. Instead, the scene will be saved directly. The dialogs are presented in sequential fashion.

    Parameters

    • isUserConfirmationRequired: boolean

      True if the user should be prompted to save the scene.

    • OptionalonSuccess: (() => void)

      The callback that is invoked when all scenes have been saved.

        • (): void
        • Returns void

    • OptionalonAbort: (() => void)

      The callback that is invoked when the user aborts the save operation.

        • (): void
        • Returns void

    • OptionalignoreKeyWindows: SceneKeyWindow[]

      The optional key windows that should be ignored.

    Returns void

  • Stops all scenes from playing the simulation.

    Returns boolean

Events

onScenePlayDataStateChanged: Event<[SceneInstance, EnumValue<ScenePlayState, number>], void>

Triggered when the scene play data state changes, e.g. when the scene starts simulation.

This is a convenience event that abstracts the ScenePlayData events so consumers do not have to manually subscribe and unsubscribe when the SceneKeyWindow loads another scene.

onScenePlayDataBackup: Event<[SceneInstance, EnumValue<ScenePlayState, number>], void>

Triggered before backing up the scene to perform a revertable action such as simulating the scene.

This is a convenience event that abstracts the ScenePlayData events so consumers do not have to manually subscribe and unsubscribe when the SceneKeyWindow loads another scene.

onToolbarBuild: Event<[], void>

Event triggered when the toolbar is being built.

onResize: Event<[], void>

Event triggered once the window is resized.

onMove: Event<[], void>

Event triggered once the window is moved.

onClose: Event<[], void>

Event triggered when the window is closed.

onFocusChangedInternal: Event<[boolean], void>