Scene graph tree added

This commit is contained in:
2023-02-18 11:11:37 +01:00
parent a1cf6a7e05
commit e56e2afb92
10 changed files with 80 additions and 8 deletions

View File

@ -1,5 +1,6 @@
import os, json
import posixpath
from .package import Package
from .errors import *
@ -38,4 +39,15 @@ class PackageManager:
self.vfs.mount(filepath, vfs_path, 0)
new_package = Package(type('', (object,), meta), vfs_path, self.vfs)
self.package_map[meta['name']] = new_package
self.package_list.insert(0, new_package)
self.package_list.insert(0, new_package)
def get_model_path(self, name):
for imported_package in reversed(self.package_list):
target_path = posixpath.join(imported_package.mount_dir, 'models', name)
print(target_path)
if self.vfs.exists(target_path):
return target_path
main_path = posixpath.join(self.main_package.mount_dir, 'models', name)
if (self.vfs.exists(main_path)):
return main_path
return None