simvx.core.scene_io.loader¶
Runtime loading: import a scene .py file or folder and instantiate its primary Node.
load_scene is the canonical way to take a path on disk and return a live
- class:
~simvx.core.Nodetree. For editing the source, use- class:
SceneFile/ :class:SceneModule; this module is the runtime side.
Module Contents¶
Functions¶
Load a scene from a |
Data¶
API¶
- simvx.core.scene_io.loader.__all__¶
[‘load_scene’]
- simvx.core.scene_io.loader.load_scene(path: str | pathlib.Path) simvx.core.node.Node[source]¶
Load a scene from a
.pyfile or scene-module folder.File path → imports the module (under a unique synthetic name) and instantiates the primary :class:
Nodesubclass. Folder path → imports the package via :func:importlib.import_module(after pinningpath.parentonto :data:sys.path) and instantiates the primary class declared in__init__.pyor, as a fallback,<folder>/<folder>.py.In both cases :meth:
ScriptManager.load_treeis run on the result so nodes carryingscriptreferences resolve relative to the project layout (project/scenes/foo.py→project/is the script root).