Undo & redo in Construct
How edits, gizmos, and OPAL agent actions interact with the undo stack
Undo & redo in Construct
Every edit you make in Construct — whether you click in the viewport, drag a gizmo, edit a property, run a script, or instruct the OPAL agent — goes through a single undo stack. This page explains what is undoable, how to undo, and what to expect when the agent is doing the editing.
Shortcuts
| Action | Shortcut |
|---|---|
| Undo | Ctrl+Z |
| Redo | Ctrl+Shift+Z |
| Undo (alternate) | (platform default for QUndoStack) |
The undo and redo buttons in the menu show a human-readable description of the next step ("Undo Set Transform", "Redo Add Sphere"). When the stack is empty, the buttons are disabled.
What is undoable
The unified ops layer routes the following through the stack:
- Adding, removing, renaming, duplicating, reparenting items (meshes, SDFs, groups, tet volumes, domains)
- Setting the transform (translate, rotate, scale) of any item
- Setting parameters on SDF primitives and operators
- Changing the SDF definition of an instance
- Adding, removing, updating, duplicating materials in the library
- Editing variable sets (set, remove, rename, reorder, named varsets)
- Scene-level settings (camera, environment, render options)
- Adding, removing, updating user-authored definitions
- Group / ungroup (lands as a single atomic step)
- Mesh / tet imports (push as a single step on completion, no half-imported state)
- OPAL agent actions (see below)
Coalescing: dragging is one step
Dragging a gizmo or scrubbing a slider produces many small parameter updates per second. Construct coalesces those into a single undo step:
- The first drag begins a coalesce window.
- All subsequent updates of the same parameter on the same item merge into the first.
- When you release, the coalesce window closes and a single step is committed to the stack.
The result: one Ctrl+Z reverses an entire drag, not the last microsecond of it.
This includes bounding-volume face drags: resizing a volume writes its size and position atomically per frame and coalesces like any other gizmo drag, so one Ctrl+Z undoes the whole resize — never a half-applied asymmetric one.
Composite edits
Some operations naturally bundle multiple atomic steps into one undoable transaction:
- Group selection — adds a group, reparents N items: one undo step.
- Ungroup — reparents N items, removes the group: one undo step.
- Delete selection — removes N items: one undo step.
- Mesh / tet import — adds the item with all its data: one undo step (pushed when the async import finishes).
In all cases a single Ctrl+Z reverts the whole transaction.
Undo with the OPAL agent
When you ask the OPAL agent to edit the scene, every mutation it performs goes onto the same stack. There are two cases.
Single-task agent edits
A request like "rename the ball to hub" runs one task and pushes one step. Ctrl+Z reverses it just like a manual rename.
Batch agent edits
A request like "make a ring of 8 spheres" or "build me a robot arm" usually invokes construct.scene.build_tree, which creates many instances atomically as a single batch. One Ctrl+Z removes the whole construction. Redo with Ctrl+Shift+Z restores it.
The agent can also undo its own batches by name. If a previous batch went wrong, you can ask:
"List your recent batches, then undo the build_tree one."
This uses the construct.list_batches and construct.undo_batch tasks. It is functionally equivalent to pressing Ctrl+Z the right number of times, but more precise when you've made other edits since.
Mixing agent and manual edits
Agent and manual edits share one stack in chronological order. If you do:
- Manually add a box.
- Ask the agent to "build a ring of spheres" (a batch).
- Manually drag the box.
Then three Ctrl+Z presses reverse step 3, then step 2 (the whole ring), then step 1.
What is not undoable
A small number of actions reset the stack rather than push to it, because there is nothing meaningful to revert to:
- New scene — clears the stack.
- Open scene — clears the stack.
- Save / Save As — does not change the stack, but marks the current position as "clean" (the title-bar dirty dot disappears).
The dirty indicator tracks whether the stack position has moved away from the last saved point. Undoing past the save point or making a new edit re-marks the scene as dirty.
Tips
- If you don't know how a gizmo drag will behave, drag it, then Ctrl+Z. You'll see exactly what it changed by watching the item's row revert.
- After a complex agent prompt, do a single Ctrl+Z to confirm the change was atomic. If it took multiple presses, the agent split the work across several plans — consider asking it to bundle next time.
- Saved files are independent of the undo stack: opening a file gives you a fresh stack, even if you had un-undone edits in another scene.