- Added properties for Omoo DA3 settings in properties.py, including input path, video frames, model selection, and export format. - Created runtime management in runtime.py, handling model downloads, job paths, and command execution for reconstruction. - Developed status bar functionality in status_bar.py to display job progress and status. - Implemented worker.py for image and video processing, including frame extraction and model inference. - Added comprehensive unit tests covering addon registration, model handling, export processes, and UI interactions. - Included a lock file for dependency management with uv.
33 lines
1006 B
Python
33 lines
1006 B
Python
import tomllib
|
|
from pathlib import Path
|
|
from zipfile import ZIP_DEFLATED, ZipFile
|
|
|
|
|
|
PROJECT_ROOT = Path(__file__).resolve().parent
|
|
SOURCE_DIR = PROJECT_ROOT / "src" / "omoo_da3"
|
|
DIST_DIR = PROJECT_ROOT / "dist"
|
|
|
|
|
|
def build_extension():
|
|
manifest = tomllib.loads(
|
|
(SOURCE_DIR / "blender_manifest.toml").read_text(encoding="utf-8")
|
|
)
|
|
output_path = DIST_DIR / f"{manifest['id']}-{manifest['version']}.zip"
|
|
DIST_DIR.mkdir(exist_ok=True)
|
|
|
|
with ZipFile(output_path, "w", ZIP_DEFLATED) as archive:
|
|
for source_path in sorted(SOURCE_DIR.rglob("*")):
|
|
if not source_path.is_file():
|
|
continue
|
|
if "__pycache__" in source_path.parts:
|
|
continue
|
|
archive.write(source_path, source_path.relative_to(SOURCE_DIR))
|
|
|
|
return output_path
|
|
|
|
|
|
if __name__ == "__main__":
|
|
extension_path = build_extension()
|
|
size_mib = extension_path.stat().st_size / (1024 * 1024)
|
|
print(f"Built {extension_path} ({size_mib:.2f} MiB)")
|