simvx.core.scene¶
Scene serialization — save/load node trees as JSON or pickle.
Both backends serialize to the same plain-dict intermediate format. Pickle stores the dict (not raw Node objects), avoiding class-path brittleness and GPU state issues.
Public API: save_scene(node, path, format=”json”) load_scene(path, format=None) # auto-detects from extension
Module Contents¶
Classes¶
Reusable scene resource that loads once and can be instanced many times. |
Functions¶
Save a node tree to disk. |
|
Load a node tree from disk. |
Data¶
API¶
- simvx.core.scene.log¶
‘getLogger(…)’
- simvx.core.scene.save_scene(node: simvx.core.engine.Node, path: str | pathlib.Path, format: str = 'json')¶
Save a node tree to disk.
Args: node: Root node to serialize. path: Output file path. format: “json” or “pickle”.
- simvx.core.scene.load_scene(path: str | pathlib.Path, format: str | None = None) simvx.core.engine.Node¶
Load a node tree from disk.
Args: path: Input file path. format: “json”, “pickle”, or None to auto-detect from extension.
Returns: Reconstructed root Node.
- class simvx.core.scene.PackedScene(path: str | pathlib.Path)¶
Reusable scene resource that loads once and can be instanced many times.
The scene file is lazily parsed on the first call to instance(). Subsequent calls deep-copy the cached data to produce independent node trees.
Initialization
- instance() simvx.core.engine.Node¶
Load and return a new node tree from the scene file.
- save(node: simvx.core.engine.Node)¶
Save a node tree to this PackedScene’s path.