RSX Code Reference
    Preparing search index...

    Class SceneKeyWindow

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

    Hierarchy (View Summary)

    Implements

    Index
    addComponentToScene addFatComponentObjectToScene addSceneObject addStaticMeshObjectToScene addTemplateInstanceToScene beginTutorial center clearUndoRedoHistory close createDefaultLayout createEditorWindow createTemplateFromSelection createTutorialFactory determineContentReadOnly didRedo didTransitionScene didUndo dockDockableEditorWindow dockEditorWindow ensureViewportCamera focusOnOutlinerOrScene freezeDockableEditorWindow freezeEditorWindow getDockableEditorWindow getDockableLayout getScriptEditorWindow initializeInternal invalidateWindowTitle 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 findKeyWindowForSceneUUID getSceneKeyWindows isAnySceneModified moveSceneObjectToPosition openTypeScriptInternal openWindow openWithScene openWithSceneUUID pingPickedMaterialInLibrary saveAllScenes selectPickedMaterialInLibrary stopAllScenes
    _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

    onLibraryEntryRemove: (entry: LibraryEntry) => void

    Called by the project library whenever a library entry is removed.

    Type Declaration

    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

    pingSceneObject: (sceneObject: SceneObject) => void

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

    Type Declaration

    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.

    cloudSyncSaveTimerInSeconds: number

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

    defaultObjectCameraPlacementDistance: 5

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

    frameCaptureDelay: number

    Seconds to wait before starting frame capture.

    i18NConvertingScene: string
    i18NLoadingScene: string
    i18NNoEditorCamera: string
    i18NNoSceneLoaded: string
    • 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: number): void

      Parameters

      • value: number

      Returns void

    • get heightInPixels(): number

      Sets the height of the window in pixels.

      Returns number

    • set heightInPixels(value: number): void

      Parameters

      • value: number

      Returns void

    • get icon(): Image

      Gets the icon for the window.

      Returns Image

    • set icon(value: Image): 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: boolean): 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: boolean): 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 keyWindow(): KeyWindowBase

      Gets the key window which owns this window.

      Returns KeyWindowBase

    • 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 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 styleSheet(): StyleSheet

      Sets the stylesheet for this window's UI surface.

      Returns StyleSheet

    • set styleSheet(value: StyleSheet): void

      Sets the stylesheet for this window's UI surface.

      Parameters

      Returns void

    • 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 transitionedSceneOrigin(): SceneInstance

      The scene that was transitioned from, if any.

      Returns SceneInstance

      This property is only available when the scene of the key window is currently playing.

    • 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: number): void

      Parameters

      • value: number

      Returns void

    • get widthInPixels(): number

      Sets the width of the window in pixels.

      Returns number

    • set widthInPixels(value: number): 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: I18N): 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

    • 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.

      • Optionalparent: SceneObject

        The parent scene object.

      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

    • Centers the window within it's parent window.

      Returns void

    • Virtual

      Closes the key window.

      Returns void

    • Creates a template from the selected scene objects or from a given array of scene objects. The user will be asked for a file path for the template.

      Parameters

      • OptionalselectedSceneObjects: SceneObject[]

        Optional override for the selected scene objects. If given, the template will be created from these objects instead of the scene selection.

      Returns void

    • 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

    • Creates the editorCamera scene object, if necessary.

      Returns void

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

      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 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

    • 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.

      • OptionalonFailure: () => void

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

      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.

      • OptionaldestroyScene: boolean

      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

    • 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.

      • OptionalonCancel: () => void

        The delegate when the action has been canceled

      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

    • Gets all open SceneKeyWindow instances.

      Parameters

      • requireLoadedScenes: boolean

      Returns SceneKeyWindow[]

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

      Returns boolean

    • 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.

      • OptionalforceNewWindow: boolean

      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.

      • OptionalforceNewWindow: boolean

      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.

      • OptionalonAbort: () => void

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

      • OptionalignoreKeyWindows: SceneKeyWindow[]

        The optional key windows that should be ignored.

      Returns void

    • Stops all scenes from playing the simulation.

      Returns boolean

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

    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>]>

    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.

    onSceneDeltaApplied: Event<[SceneObject]>

    Triggered when a scene delta is applied to the scene instance currently opened in this key window.

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

    onTemplateInstanceUpdateFailed: Event<[SceneObject]>

    Triggered when a template instance update for a template instance in the scene instance currently opened in this key window failed.

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

    onToolbarBuild: Event<[]>

    Event triggered when the toolbar is being built.

    onResize: Event<[]>

    Event triggered once the window is resized.

    onMove: Event<[]>

    Event triggered once the window is moved.

    onClose: Event<[]>

    Event triggered when the window is closed.

    onFocusChangedInternal: Event<[isFocused: boolean]>