Skip to main content

build_doc

Function build_doc 

Source
pub fn build_doc(
    tree: &NodeTree,
    source: Option<&SceneDoc>,
    refs: Option<InstanceRefs<'_>>,
) -> Result<SceneDoc>
Expand description

Build a saveable SceneDoc from the live tree, in tree order.

source is the scene file as it exists on disk and stays authoritative: its [[instance]] entries are re-attached instead of being flattened into plain nodes (a live tree cannot tell instantiated nodes from authored ones). Prop edits inside an instantiated subtree are written back as overrides, so a save round-trips exactly; edits the format cannot express (renaming, retyping, reparenting or deleting inside a subtree, removing an inherited prop) fail loudly instead of being dropped.