5.0 (#60)
* feat: Add Bioxel asset catalog and layer management functionality - Introduced a new asset catalog definition file for Blender to manage Bioxel assets. - Implemented layer caching and snapshot functionality in `layer.py`, allowing for VDB file generation and low-resolution snapshots. - Created node management functions in `node.py` for handling Bioxel nodes within Blender's Geometry Node Editor. - Added an operator to extract mesh data from selected nodes in `structure.py`. - Developed UI panels in `panels.py` for layer management, including import options and layer library display. * Add unit tests for bioxel module and documentation - Created README.md for test instructions and categories. - Implemented comprehensive unit tests for the Data, Layer, and utility functions in the bioxel module. - Added tests for reading NRRD and DICOM formats, data properties, and edge cases. - Included tests for real data files to ensure functionality with actual datasets. * feat: Update .gitattributes and .gitignore for improved asset management and ignore patterns chore: Add app.json and omoolab.css for Obsidian integration refactor: Clean up AGENTS.md and remove outdated test files * feat: Update .gitignore to include scipy_ndimage directory * feat: Update release workflow and manifest for improved dependency management and layer handling * feat: Update .gitignore and add binary files for scipy_ndimage across multiple platforms * feat: Add OPSX commands for archiving, exploring, and proposing changes * feat: Refactor asset library management and update manifest for improved organization * feat: Downgrade h5py version to 3.14.0 in requirements and manifest * feat: Update Help operator and panel labels to use English terminology * Translate documentation to Chinese, add support format details, and enhance styling with new fonts. Update mkdocs configuration for multilingual support and improve package dependencies. * feat: Remove default version setting from extra configuration in mkdocs.yml * fix: Update documentation links to point to the correct URLs for Chinese and English versions * Add documentation for basic usage, supported formats, and performance tips - Created English and Chinese documentation for basic usage of the add-on, including data download, import, extraction, and rendering steps. - Added support format documentation listing compatible file types for the add-on. - Included links to open databases for volumetric data. - Provided performance improvement tips for voxel reconstruction and rendering, including settings for low-resolution previews and balanced rendering configurations.
This commit is contained in:
92
pack.py
Normal file
92
pack.py
Normal file
@@ -0,0 +1,92 @@
|
||||
"""
|
||||
Create a zip archive of the src/bioxelnodes package with a top-level folder
|
||||
named `bioxelnodes/`. Excludes specified temporary/cache files and folders.
|
||||
Does not modify any files in the project.
|
||||
|
||||
Usage:
|
||||
python build_package.py <platform_name> [output_zip_path]
|
||||
|
||||
Example:
|
||||
python build_package.py windows-x64
|
||||
"""
|
||||
from pathlib import Path
|
||||
import sys
|
||||
import zipfile
|
||||
import fnmatch
|
||||
from datetime import datetime
|
||||
|
||||
platforms = {
|
||||
"windows-x64": "windows-x64",
|
||||
"linux-x64": "linux-x64",
|
||||
"macos-arm64": "macos-arm64",
|
||||
"macos-x64": "macos-x64",
|
||||
}
|
||||
|
||||
# patterns to exclude (filename matching)
|
||||
EXCLUDE_FILENAME_PATTERNS = [
|
||||
"*.blend1",
|
||||
"blendcache_*",
|
||||
"*.cats.txt~",
|
||||
"*.pyc",
|
||||
"*.pyo",
|
||||
"*$py.class",
|
||||
]
|
||||
|
||||
# directory names to exclude entirely
|
||||
EXCLUDE_DIR_NAMES = {
|
||||
"__pycache__",
|
||||
}
|
||||
|
||||
def should_exclude(path: Path) -> bool:
|
||||
name = path.name
|
||||
# exclude directories by name anywhere in the path
|
||||
if any(part in EXCLUDE_DIR_NAMES for part in path.parts):
|
||||
return True
|
||||
# only apply filename patterns to files
|
||||
if path.is_file():
|
||||
for pat in EXCLUDE_FILENAME_PATTERNS:
|
||||
if fnmatch.fnmatch(name, pat):
|
||||
return True
|
||||
return False
|
||||
|
||||
def build_package(platform_name: str, out_zip: Path):
|
||||
src_root = Path("src") / "bioxelnodes"
|
||||
if not src_root.exists():
|
||||
raise SystemExit(f"Source folder not found: {src_root.resolve()}")
|
||||
|
||||
out_zip.parent.mkdir(parents=True, exist_ok=True)
|
||||
total = 0
|
||||
with zipfile.ZipFile(out_zip, "w", compression=zipfile.ZIP_DEFLATED) as zf:
|
||||
for p in src_root.rglob("*"):
|
||||
if p.is_dir():
|
||||
continue
|
||||
if should_exclude(p):
|
||||
continue
|
||||
# arcname should place files under top-level 'bioxelnodes/...'
|
||||
rel = p.relative_to(src_root)
|
||||
arcname = Path("bioxelnodes") / rel
|
||||
zf.write(p, arcname.as_posix())
|
||||
total += 1
|
||||
print(f"Packaged {total} files into {out_zip}")
|
||||
|
||||
def main():
|
||||
if len(sys.argv) < 2:
|
||||
print("Usage: python build_package.py <platform_name> [output_zip_path]")
|
||||
print("Available platforms:", ", ".join(platforms.keys()))
|
||||
sys.exit(1)
|
||||
|
||||
platform_key = sys.argv[1]
|
||||
if platform_key not in platforms:
|
||||
print("Unknown platform:", platform_key)
|
||||
print("Available platforms:", ", ".join(platforms.keys()))
|
||||
sys.exit(1)
|
||||
|
||||
tag = platforms[platform_key]
|
||||
timestamp = datetime.now().strftime("%Y%m%dT%H%M%S")
|
||||
default_name = f"bioxelnodes-{tag}-{timestamp}.zip"
|
||||
out_path = Path(sys.argv[2]) if len(sys.argv) >= 3 else Path(default_name)
|
||||
|
||||
build_package(platform_key, out_path)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user