RSX Code Reference
    Preparing search index...

    Class SceneObjectUndoRedo

    The SceneObjectUndoRedo class provides undo helpers for scene objects that can be undone through the editor's undo-redo system.

    Index
    • Parameters

      • OptionalisInternalConstructor: boolean

      Returns SceneObjectUndoRedo

    • Records the current state of the provided SceneObject headers. A diff is automatically generated after the callback has been invoked. If a change is detected an UndoableCommand will be created.

      Parameters

      • undoRedo: UndoRedo

        The undo/redo information structure.

      • sceneObjects: SceneObject[]
      • description: string

        The name of the undo command.

      • callback: () => void

        The callback that performs the change.

      • OptionalisGroupable: boolean

        Determines if the command should be grouped with similar commands.

      Returns void

      The SceneObjectHeader only contains primary properties such as name, transform, active and similar basal properties. All components of the sceneObject as well as child objects are ignored. To track changes to Component or children use createUndoForSceneObject instead. Use this API for performance critical situations.

    • Records the complete state of the provided SceneObject including changes to Component objects assigned to the scene object. Optionally, all child objects can be recorded. A diff is generated with a call to commitActiveOperations. If a change is detected an UndoableCommand will be created.

      Parameters

      • undoRedo: UndoRedo

        The undo/redo information structure.

      • sceneObject: SceneObject

        Scene object to record.

      • hierarchy: boolean

        Determines if the child objects will be recorded as well, otherwise just the provided object.

      • description: string

        Optional description specifying the type of changes about to be made.

      • OptionalisGroupable: boolean

        Determines if the command should be grouped with similar commands.

      Returns void

      If you only modify basic SceneObject properties such as name or the transform values, it's better to use the more lightweight recordSceneObjectHeader API instead.

    • Break the template link for some scene objects.

      Parameters

      • undoRedo: UndoRedo
      • sceneObjects: SceneObject[]

        The scene objects to break the template link.

      • description: string

        The description of the command to show in the command history.

      Returns void

    • Clone a scene object.

      Parameters

      • undoRedo: UndoRedo
      • sceneObject: SceneObject

        The scene object to clone.

      • description: string

        The description of the command to show in the command history.

      Returns SceneObject

      The cloned scene object.

    • Clone scene objects.

      Parameters

      • undoRedo: UndoRedo
      • sceneObjects: SceneObject[]

        The scene objects to clone.

      • transforms: Immutable<Matrix4>[]

        The transforms to apply to the cloned objects.

      • description: string

        The description of the command to show in the command history.

      Returns SceneObject[]

      The cloned scene objects.

    • Create a new scene object.

      Parameters

      • undoRedo: UndoRedo
      • sceneInstance: SceneInstance
      • name: string

        The name of the new object.

      • description: string

        The description of the command to show in the command history.

      Returns SceneObject

      The new scene object.

    • Create a new scene object with a fat component.

      Parameters

      • undoRedo: UndoRedo
      • sceneInstance: SceneInstance
      • fatComponent: FatComponent

        The fat component.

      • name: string

        The name of the new object.

      • description: string

        The description of the command to show in the command history.

      Returns SceneObject

      The new scene object.

    • Records the complete state of the provided SceneObject including changes to Component objects assigned to the scene object. Optionally, all child objects can be recorded. A diff is automatically generated after the callback has been invoked. If a change is detected an UndoableCommand will be created.

      Parameters

      • undoRedo: UndoRedo

        The undo/redo information structure.

      • sceneObject: SceneObject

        Scene object.

      • description: string

        The name of the undo command.

      • callback: () => unknown

        The callback that performs the change.

      • OptionalisRecursive: boolean

        Set to true to include changes to children of the sceneObject

      • OptionalisGroupable: boolean

        Determines if the command should be grouped with similar commands.

      Returns boolean

      True when an undo operation was committed and retained.

      If you only modify basic SceneObject properties such as name or the transform values, it's better to use the more lightweight createUndoForSceneObjectHeaders API instead.

    • Delete a scene object.

      Parameters

      • undoRedo: UndoRedo
      • sceneObject: SceneObject

        The scene object to delete.

      • description: string

        The description of the command to show in the command history.

      Returns void

    • Delete scene objects.

      Parameters

      • undoRedo: UndoRedo
      • sceneObjects: SceneObject[]

        The scene objects to delete.

      • description: string

        The description of the command to show in the command history.

      Returns void

    • Group scene objects under a common parent.

      Parameters

      • undoRedo: UndoRedo
      • sceneObjects: SceneObject[]

        The scene objects to group.

      • description: string

        The description of the command to show in the command history.

      Returns SceneObject

      The new parent of the group.

    • Inverts the lock state of a list of scene objects and puts an undo command to revert the operation on the undo stack.

      Parameters

      Returns void

    • Inverts the visibility of a list of scene objects and puts an undo command to revert the operation on the undo stack.

      Parameters

      Returns void

    • Create a new component instance based on data in the clipboard.

      Parameters

      • undoRedo: UndoRedo
      • object: SceneObject

        The object under which the component will be pasted.

      • description: string

        The description of the command to show in the command history.

      Returns boolean

      true if the component could be created and added to the object

    • Create new scene object instances based on any SceneObject data in the clipboard.

      Parameters

      • undoRedo: UndoRedo
      • parent: SceneObject

        The parent under which the scene objects will be pasted.

      • description: string

        The description of the command to show in the command history.

      Returns boolean

      true if any objects were created.

    • Creates a brand new scene object and begins a recordSceneObject operation on the newly created scene object. Both the creation and the initially recorded set of data will be recorded as a single undo/redo command. Generally you want to call this when creating a new scene object and immediately make some initial changes to it (such as adding component or modifying their properties).

      Parameters

      • undoRedo: UndoRedo

        The undo/redo information structure.

      • sceneObject: SceneObject

        Newly created scene object on which to initiate the record operation on.

      • OptionalisGroupable: boolean

        Determines if the command should be grouped with similar commands.

      Returns void

    • Records the current state of the provided SceneObject header, and generates a diff with a call to commitActiveOperations. If a change is detected an UndoableCommand will be created.

      Parameters

      • undoRedo: UndoRedo

        The undo/redo information structure.

      • sceneObject: SceneObject

        Scene object to record the state of.

      • fieldPath: string

        Name to the field which should be focused when performing the undo/redo operation.

      • Optionaldescription: string

        Description of the undo command.

      • OptionalisGroupable: boolean

        Determines if the command should be grouped with similar commands.

      Returns void

      The SceneObjectHeader only contains primary properties such as name, transform, active and similar basal properties. All components of the sceneObject as well as child objects are ignored. To track changes to Component or children use recordSceneObject instead.

    • Records the current state of the provided SceneObject headers, and generates a diff with a call to commitActiveOperations. If a change is detected an UndoableCommand will be created.

      Parameters

      • undoRedo: UndoRedo

        The undo/redo information structure.

      • sceneObjects: SceneObject[]

        Scene objects to record the state of.

      • description: string

        Description of the undo command.

      • OptionalisGroupable: boolean

        Determines if the command should be grouped with similar commands.

      Returns void

      The SceneObjectHeader only contains primary properties such as name, transform, active and similar basal properties. All components of the sceneObject as well as child objects are ignored. To track changes to Component or children use recordSceneObject instead. Use this API for performance critical situations.

    • Removes a component from its bound object and destroys it.

      Parameters

      • undoRedo: UndoRedo
      • component: Component

        The component which should be removed from the scene object it is attached to.

      • description: string

        The description of the command to show in the command history.

      Returns void

    • Place a scene object under a new parent.

      Parameters

      • undoRedo: UndoRedo
      • sceneObject: SceneObject

        The scene object to reparent.

      • newParent: SceneObject

        The new parent to place the object under.

      • description: string

        The description of the command to show in the command history.

      Returns void

    • Place scene objects under a new parent.

      Parameters

      • undoRedo: UndoRedo
      • sceneObjects: SceneObject[]

        The scene objects to reparent.

      • newParent: SceneObject

        The new parent to place the objects under.

      • description: string

        The description of the command to show in the command history.

      Returns void

    • Reparents sceneObjects to newParent, handling template-linked objects by prompting the user to duplicate, unlink and move them.

      Parameters

      • undoRedo: UndoRedo

        The undo/redo information structure.

      • sceneObjects: SceneObject[]

        Scene objects to reparent.

      • newParent: SceneObject

        The new parent scene object.

      Returns void

    • Toggles the visibility of a list of scene objects and puts an undo command to revert the operation on the undo stack.

      Parameters

      Returns void