simvx.editor.commands¶
Editor undo/redo commands for node tree operations.
Provides self-contained command objects for every undoable editor action.
Each command stores all data needed to execute, undo, and redo without
external state. Use with UndoStack.push() to record operations.
Module Contents¶
Classes¶
Add a child node to the tree. Undo removes it. |
|
Remove a child from the tree. Undo re-adds it at original index. |
|
Move a node from one parent to another. Undo restores original parent. |
|
Change a child’s index within its parent. Undo restores original index. |
|
Rename a node. Undo restores the old name. |
|
Batch property changes from a gizmo operation. Undo restores old transform. |
API¶
- class simvx.editor.commands.AddNodeCommand(parent: simvx.core.Node, child: simvx.core.Node, index: int = -1)[source]¶
Bases:
simvx.core.CallableCommandAdd a child node to the tree. Undo removes it.
Initialization
- property description: str¶
- execute() None¶
- undo() None¶
- class simvx.editor.commands.RemoveNodeCommand(parent: simvx.core.Node, child: simvx.core.Node)[source]¶
Bases:
simvx.core.CallableCommandRemove a child from the tree. Undo re-adds it at original index.
Initialization
- property description: str¶
- execute() None¶
- undo() None¶
- class simvx.editor.commands.ReparentCommand(node: simvx.core.Node, new_parent: simvx.core.Node, old_parent: simvx.core.Node, old_index: int)[source]¶
Bases:
simvx.core.CallableCommandMove a node from one parent to another. Undo restores original parent.
Initialization
- property description: str¶
- execute() None¶
- undo() None¶
- class simvx.editor.commands.ReorderCommand(parent: simvx.core.Node, child: simvx.core.Node, new_index: int, old_index: int)[source]¶
Bases:
simvx.core.CallableCommandChange a child’s index within its parent. Undo restores original index.
Initialization
- property description: str¶
- execute() None¶
- undo() None¶
- class simvx.editor.commands.RenameCommand(node: simvx.core.Node, new_name: str, old_name: str)[source]¶
Bases:
simvx.core.CallableCommandRename a node. Undo restores the old name.
Initialization
- property description: str¶
- execute() None¶
- undo() None¶
- class simvx.editor.commands.TransformCommand(node: simvx.core.Node, old_values: dict[str, Any], new_values: dict[str, Any])[source]¶
Bases:
simvx.core.BatchCommandBatch property changes from a gizmo operation. Undo restores old transform.
Parameters
node: The node whose transform properties changed. old_values: Mapping of property name to value before the change. new_values: Mapping of property name to value after the change.
Initialization
- property description: str¶
- execute() None¶
- undo() None¶