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.

Structural add / remove / reparent leaves live in simvx.core.undo so non-editor tools (IDE plugins, asset importers, scripted demos) can record undoable scene-tree mutations without re-implementing them. The AddNodeCommand / RemoveNodeCommand aliases below keep the editor naming convention.

Module Contents

Classes

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.

Data

API

simvx.editor.commands.__all__

[‘AddNodeCommand’, ‘RemoveNodeCommand’, ‘ReparentCommand’, ‘ReorderCommand’, ‘RenameCommand’, ‘Trans…

simvx.editor.commands.AddNodeCommand

None

simvx.editor.commands.RemoveNodeCommand

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