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

AddNodeCommand

Add a child node to the tree. Undo removes it.

RemoveNodeCommand

Remove a child from the tree. Undo re-adds it at original index.

ReparentCommand

Move a node from one parent to another. Undo restores original parent.

ReorderCommand

Change a child’s index within its parent. Undo restores original index.

RenameCommand

Rename a node. Undo restores the old name.

TransformCommand

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.CallableCommand

Add 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.CallableCommand

Remove 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.CallableCommand

Move 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.CallableCommand

Change 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.CallableCommand

Rename 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.BatchCommand

Batch 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