direct.showbase.VFSImporter
from direct.showbase.VFSImporter import VFSCompiledLoader, VFSExtensionLoader, VFSFinder, VFSLoader, VFSNamespaceLoader, VFSSourceLoader, register
The VFS importer allows importing Python modules from Panda3D’s virtual file system, through Python’s standard import mechanism.
Calling the register()
function to register the import hooks should be
sufficient to enable this functionality.
Inheritance diagram
- class VFSCompiledLoader(fullname: str, vfile: VirtualFile)[source]
Bases:
VFSLoader
- class VFSExtensionLoader(fullname: str, vfile: VirtualFile)[source]
Bases:
VFSLoader
- class VFSFinder(path: str)[source]
Bases:
object
This class serves as a Python importer to support loading Python .py and .pyc/.pyo files from Panda’s Virtual File System, which allows loading Python source files from mounted .mf files (among other places).
- class VFSLoader(fullname: str, vfile: VirtualFile)[source]
Bases:
Loader
- __init__(self, fullname: str, vfile: VirtualFile) None [source]
- class VFSNamespaceLoader[source]
Bases:
Loader
- class VFSSourceLoader(fullname: str, vfile: VirtualFile)[source]
Bases:
VFSLoader
,SourceLoader