simvx.core.script_embed¶
Virtual importlib finder/loader for embedded scripts.
Embedded scripts are source code stored directly in the scene/project file
(on node._script_embedded) rather than as separate .py files. This
module installs a sys.meta_path finder that makes those scripts importable
via standard import machinery, so ScriptManager can load them the same way
as file-backed scripts.
Usage: from simvx.core.script_embed import EmbeddedScriptFinder
EmbeddedScriptFinder.register("_simvx_embed_my_script", source_code)
import _simvx_embed_my_script # works!
EmbeddedScriptFinder.unregister("_simvx_embed_my_script")
Module Contents¶
Classes¶
Finds modules registered as embedded scripts. |