Expand description
Headless editor operations: pure tree/scene/error logic with no egui.
app.rs calls these from UI callbacks and routes every Err to the
console; nothing here touches the UI, so it is all unit-testable.
Structs§
- Instance
Refs - Paths needed to resolve
[[instance]]scene references while saving.
Functions§
- add_
node - Insert a node of
type_nameunderparent(defaults to the tree root). The id is derived fromnameplus a counter until unique. Unknown types and missing parents are errors. - build_
doc - Build a saveable
SceneDocfrom the live tree, in tree order. - gutter_
marks - Parse Python-traceback
line N(File "...", line N) marks: one 1-based line (last match wins) plus the error’s last non-empty line (the exception line, not theTracebackheader). Entries without a line number (clean strings) are ignored. - move_
node - Reparent
idundernew_parent. Cycle and root errors surface as-is. - move_
sibling - Shift
idbydeltaslots among its siblings (negative moves up). Out-of-range shifts clamp to the first/last slot; parentless nodes and the root are errors. - place_
node - Place
idundernew_parentat childindex(clamped to the end). Unlikemove_nodethis controls sibling order: index 0 makes it first. Refuses unknown nodes, root moves, and cycles (under itself or a descendant); the node keeps its subtree. - registered_
types - Closed node-type set. Mirrors
NodeTypeRegistry::new; kept here because the registry exposes no listing API and the editor must not touch core. - remove_
node - Remove
idand its subtree. Refusing the root is a console-grade error. - save_
text - Thin file write used by scene and script saves.
- set_
prop - Set one prop on
id. Unknown nodes are errors.