pack-sequence #1

Merged
joseph.henry merged 2 commits from pack-sequence into main 2026-03-24 17:04:57 +01:00
Owner
Title: Add multi-blend-file sequence packing (CLI + Blender operator)

Body:

Summary

- Add support for packing multiple blend files into a single ZIP/directory with shared dependency deduplication
- New Blender operator BAT - Pack Sequence: scan a sequence folder for latest published blend files, review with checkboxes, pack to ZIP
- New CLI subcommand bat pack-sequence -t output.zip file1.blend file2.blend ...
- Studio template system for different folder conventions (Autour de Minuit, La Cabane Productions)

What's new

Blender addon

- BAT_OT_sequence_pack operator: opens a file browser, user navigates to a sequence folder, clicks "Scan Current Folder", reviews the discovered files with enable/disable checkboxes, then packs to ZIP
- Studio templates dropdown: configurable folder conventions per studio. ADM template scans // with a task selector (lighting3d, anim3d, etc.), La Cabane template scans /03_ANIMATION/Publish/
- Version detection: parses _vNNN.blend filenames, picks the highest version per shot, ignores files with extra suffixes
- Progress indicator: wm.progress cursor feedback during tracing and file transfer (logarithmic scale so it never saturates)
- Output filename auto-inferred from scanned folder name

CLI

- New bat pack-sequence subcommand with unambiguous arg parsing (-t TARGET FILE...)
- Old bat pack --sequence kept with deprecation warning
- derive_common_project() helper with cross-drive safety

Core packing

- Packer accepts a list of blend files, traces deps for each, deduplicates via shared _actions dict
- pack-info.txt lists all packed blend files when packing multiple
- ZIP write start/finish logging
- S3 and Shaman packers reject multi-file with clear error messages

Audit fixes (Mario + Codex/Opus cross-validation)

14 findings fixed (1 critical, 5 high, 4 medium, 2 low, 1 info):
- Critical: _find_subdir_ci() used prefix match — Publish_old could win over Publish
- High: Windows UNC/drive path normalization, ZIP error handling + progress bar cleanup, commonpath crash on cross-drive paths
- Medium: per-shot error isolation in scan, memory warning for large sequences, type consistency for single-file operators

Test plan

- 28 new tests in tests/test_sequence_pack.py (all passing)
- 0 regressions on existing test suite (161 passed, 5 pre-existing failures from missing zstandard)
- Manual testing: packed oh_la_la lighting3d sequence (4 shots) from Blender operator, verified ZIP contents include all dependencies
- Test on Windows with UNC paths
- Test with La Cabane Productions folder structure on their workstations
--- Title: Add multi-blend-file sequence packing (CLI + Blender operator) Body: Summary - Add support for packing multiple blend files into a single ZIP/directory with shared dependency deduplication - New Blender operator BAT - Pack Sequence: scan a sequence folder for latest published blend files, review with checkboxes, pack to ZIP - New CLI subcommand bat pack-sequence -t output.zip file1.blend file2.blend ... - Studio template system for different folder conventions (Autour de Minuit, La Cabane Productions) What's new Blender addon - BAT_OT_sequence_pack operator: opens a file browser, user navigates to a sequence folder, clicks "Scan Current Folder", reviews the discovered files with enable/disable checkboxes, then packs to ZIP - Studio templates dropdown: configurable folder conventions per studio. ADM template scans <shot>/<task>/ with a task selector (lighting3d, anim3d, etc.), La Cabane template scans <shot>/03_ANIMATION/Publish/ - Version detection: parses _vNNN.blend filenames, picks the highest version per shot, ignores files with extra suffixes - Progress indicator: wm.progress cursor feedback during tracing and file transfer (logarithmic scale so it never saturates) - Output filename auto-inferred from scanned folder name CLI - New bat pack-sequence subcommand with unambiguous arg parsing (-t TARGET FILE...) - Old bat pack --sequence kept with deprecation warning - derive_common_project() helper with cross-drive safety Core packing - Packer accepts a list of blend files, traces deps for each, deduplicates via shared _actions dict - pack-info.txt lists all packed blend files when packing multiple - ZIP write start/finish logging - S3 and Shaman packers reject multi-file with clear error messages Audit fixes (Mario + Codex/Opus cross-validation) 14 findings fixed (1 critical, 5 high, 4 medium, 2 low, 1 info): - Critical: _find_subdir_ci() used prefix match — Publish_old could win over Publish - High: Windows UNC/drive path normalization, ZIP error handling + progress bar cleanup, commonpath crash on cross-drive paths - Medium: per-shot error isolation in scan, memory warning for large sequences, type consistency for single-file operators Test plan - 28 new tests in tests/test_sequence_pack.py (all passing) - 0 regressions on existing test suite (161 passed, 5 pre-existing failures from missing zstandard) - Manual testing: packed oh_la_la lighting3d sequence (4 shots) from Blender operator, verified ZIP contents include all dependencies - Test on Windows with UNC paths - Test with La Cabane Productions folder structure on their workstations
joseph.henry added 2 commits 2026-03-24 16:59:35 +01:00
- Add --sequence CLI flag to pack multiple blend files together with
  shared dependency deduplication
- Add BAT_OT_sequence_pack Blender operator: scan a sequence folder for
  latest published blend files, review with checkboxes, pack to ZIP
- Add studio template system (Autour de Minuit, La Cabane Productions)
  with configurable folder conventions and task type selection
- Add BlenderProgressCallback for cursor progress indicator during pack
- Add ZIP write start/finish logging
- Deduplicate blend file paths in CLI when positional and --sequence overlap

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cross-validation audit by Codex + Opus identified 14 issues:

CRITICAL:
- Fix _find_subdir_ci() prefix match accepting wrong folders (e.g.
  Publish_old). Now uses exact case-insensitive match.

HIGH:
- Add pack-sequence CLI subcommand with unambiguous arg parsing.
  Deprecate --sequence on pack (nargs='+' consumed the target).
- Fix Windows UNC/drive path normalization in bpathlib.make_absolute()
- Fix ZIP failure losing traceback + progress bar stuck on error
- Fix os.path.commonpath crash on cross-drive paths (new
  derive_common_project helper)
- Fix progress bar saturating at 40% during trace (log scale)

MEDIUM:
- Add per-shot error isolation in sequence scan (collect all errors)
- Add memory warning for >50 files in sequence pack
- Improve pack-info.txt with dedup stats
- Wrap single Path in list for old operators (type consistency)

LOW/INFO:
- Document VERSION_RE pattern
- Add TASK_CHOICE_ITEMS empty guard

28 new tests in tests/test_sequence_pack.py, 0 regressions.

Co-Authored-By: Mario Hawat <mario@autourdeminuit.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
joseph.henry merged commit 1689e0cf96 into main 2026-03-24 17:04:57 +01:00
joseph.henry deleted branch pack-sequence 2026-03-24 17:04:57 +01:00
Sign in to join this conversation.
No description provided.