Navigation
API > API/Plugins > API/Plugins/ToolsetRegistry > API/Plugins/ToolsetRegistry/UToolsetLibrary
Description
Undo the most recent transaction on the global undo stack.
Companion to UKismetSystemLibrary's BeginTransaction / EndTransaction / CancelTransaction, which cover starting and finalizing transactions but stop short of actually reverting them: CancelTransaction only discards the undo-stack entry without applying the inverse, so any modifications a partial transaction made to UObjects survive. Used by programmatic.execute_tool_script to roll back scripts that error out partway through.
| Name | UndoTransaction |
| Type | function |
| Header File | /Engine/Plugins/Experimental/ToolsetRegistry/Source/ToolsetRegistry/Public/ToolsetRegistry/ToolsetLibrary.h |
| Include Path | #include "ToolsetRegistry/ToolsetLibrary.h" |
| Source | /Engine/Plugins/Experimental/ToolsetRegistry/Source/ToolsetRegistry/Private/ToolsetRegistry/ToolsetLibrary.cpp |
UFUNCTION (BlueprintCallable, Category="Toolset Library")
static bool UndoTransaction
(
bool bCanRedo
)
True if a transaction was undone; false if there was nothing to undo or the editor is in a state that prevents undo (e.g. saving a package, GC running, or no GEditor).
Parameters
| Name | Remarks |
|---|---|
| bCanRedo | If true, the undone transaction stays on the redo stack. If false (default), it is removed entirely so a rolled-back script leaves no trace on the undo history. |