Get the entire history of the Undo/Redo stack, containing both commands that can be undone and redone.
Returns the unique identifier for the command on top of the undo stack.
Set the undo stack pointer to a specific index in the history, undoing or redoing commands in between.
Finalizes all current undo operations and generated UndoableCommand entries for active operations
that contain valid changes.
Generates diffs for any objects that were previously recorded using any of the Record* methods. The diff is
generated by comparing the state at the time record... API was called, compared to the current object state.
OptionalselectObjectsOnUndoRedo: booleanDetermines if the objects should be selected upon Undo/redo. For UIElements, this could refocus the element immediately, depending on the undo type. For Scene Objects and Components, this could update the selection in the KeyWindow. Defaults to true.
Records the current state of the object. A diff is automatically generated after the callback has been invoked.
If a change is detected an UndoableCommand will be created.
The object being changed.
The name of the undo command.
The callback that performs the change.
OptionalfieldPath: stringName to the field which should be focused when performing the undo/redo operation.
OptionalisGroupable: booleanDetermines if the command should be grouped with similar commands.
The object may not be a SceneObject. Changes to scene objects must be recorded through
scene object specific APIs such as createUndoForSceneObject.
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.
Scene object.
The name of the undo command.
The callback that performs the change.
OptionalisRecursive: booleanSet to true to include changes to children of the sceneObject
OptionalisGroupable: booleanDetermines if the command should be grouped with similar commands.
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.
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.
The name of the undo command.
The callback that performs the change.
OptionalisGroupable: booleanDetermines if the command should be grouped with similar commands.
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.
Creates a new undo/redo group. All new commands will be registered to this group. You may remove the group and all of its commands by calling popGroup().
For example you might require global editor-wide undo/redo operations, and also more specific ones like input in an input box. When the user is done with the input box you no longer require its undo operations and you may use groups to easily remove them.
Unique name for the group.
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).
Newly created scene object on which to initiate the record operation on.
OptionalisGroupable: booleanDetermines if the command should be grouped with similar commands.
Records the current state of the object, and generates a diff with a call to commitActiveOperations.
If a change is detected an UndoableCommand will be created.
Object to record the state of.
Path to the field which should be focused when performing the undo/redo operation
OptionalisGroupable: booleanOptionaldescription: stringThe object may not be a SceneObject. Changes to scene objects must be recorded through
scene object specific APIs such as recordSceneObject.
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.
Scene object to record.
Determines if the child objects will be recorded as well, otherwise just the provided object.
Optional description specifying the type of changes about to be made.
OptionalisGroupable: booleanDetermines if the command should be grouped with similar commands.
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.
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.
Scene object to record the state of.
Name to the field which should be focused when performing the undo/redo operation.
Optionaldescription: stringDescription of the undo command.
OptionalisGroupable: booleanDetermines if the command should be grouped with similar commands.
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.
Scene objects to record the state of.
Description of the undo command.
OptionalisGroupable: booleanDetermines if the command should be grouped with similar commands.
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.
Registers a new undo command.
StaticmakeA utitlity function to create a context name for an undo operation.
ReadonlyonInvoked when an active undo command was commited to an undo operation.
ReadonlyonEvent triggered when the top of redo or undo stack changed.
ReadonlyonEvent triggered when the undo/redo stack is cleared.
ReadonlyonEvent triggered when a new command is added to the undo stack.
ReadonlyonEvent triggered when the top of the undo stack changed.
ReadonlyonEvent triggered whenever a command is registered.
ReadonlyonEvent triggered whenever a command is undone.
ReadonlyonEvent triggered whenever a command is redone.
The UndoRedo class provides undo and redo operations for changes made on objects.
Objects should be recorded before a change is made. The system will record a snapshot of the operation when the record is created and calculate the difference in a call to commitActiveOperations. If a difference is detected, the system will automatically create and insert a UndoableCommand.
To create an undo for a scene object, use createUndoForSceneObject methods. To create an undo for a regular TypeScript object, use createUndoForObject methods.