Spaces:
Running
on
Zero
Running
on
Zero
File size: 866 Bytes
917a889 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
import importlib
__attributes = {
'Mesh': 'mesh',
'Voxel': 'voxel',
'MeshWithVoxel': 'mesh',
'MeshWithPbrMaterial': 'mesh',
}
__submodules = []
__all__ = list(__attributes.keys()) + __submodules
def __getattr__(name):
if name not in globals():
if name in __attributes:
module_name = __attributes[name]
module = importlib.import_module(f".{module_name}", __name__)
globals()[name] = getattr(module, name)
elif name in __submodules:
module = importlib.import_module(f".{name}", __name__)
globals()[name] = module
else:
raise AttributeError(f"module {__name__} has no attribute {name}")
return globals()[name]
# For Pylance
if __name__ == '__main__':
from .mesh import Mesh, MeshWithVoxel, MeshWithPbrMaterial
from .voxel import Voxel
|