How arunvfx/ulaavi works
Project Type and Purpose
• Type: A Python‑based desktop plugin/tool that integrates with The Foundry’s Nuke compositing application.
• Purpose: Provide an intuitive UI within Nuke to browse, preview, and import high‑quality stock footage (.mov) using FFmpeg and OpenCV.
Main Architectural Components
a. Host Environment & Entry Points
– Nuke Application & Plugin Loader (external)
– main.py, menu.py (register tool in Nuke’s menu, set up plugin paths)
b. UI Layer (ui/ package)
– Widget modules (mainUI.py, _categoriesTree.py, _preview_proxy.py, etc.)
– Action handlers (_actionsUI.py)
– Preferences & settings UI (_preferences_grp.py, _settingsUI.py)
c. Data Layer (data/ package)
– Configuration (config.py)
– Data models and metadata handling (tool_data.py, _handler.py)
d. Conversion Layer (conversion/ package)
– Command definitions (_commands.py)
– .mov conversion logic (convert_mov.py) — wraps FFmpeg
e. Utilities (top‑level _operations.py, _utilities.py)
– Common functions (file I/O, subprocess management, logging)
f. External Dependencies
– FFmpeg (process invoked by conversion modules)
– OpenCV, NumPy, Clique (media handling)
– PySide2/PySide6 (UI framework)
– Nuke Python API (host integration)
Relationships & Data Flow
• User clicks “Load Stock Footage” in Nuke → menu.py invokes main.py → UI layer spawns the main panel.
• UI events (e.g., selecting a category) call ui/_actionsUI.py → queries data/_handler.py for file lists/metadata.
• When the preview is requested, the UI calls conversion/convert_mov.py, which uses FFmpeg (via subprocess in _utilities.py) to generate or fetch a .mov preview.
• Conversion results (file paths) feed back into the UI preview widget (_preview_proxy.py → _thumbnailUI.py).
• Upon “Import” action, UI issues commands to Nuke’s Python API to create Read nodes pointing to the selected footage.
Architectural Patterns & Principles
– MVC‑style separation:
· Model = data/ packages
· View = ui/*UI.py modules
· Controller = ui/_actionsUI.py, plus command modules in conversion/
– Single Responsibility: Each package handles one concern (UI, data, conversion, utilities).
– External Integration Layer: Encapsulate FFmpeg calls and Nuke API interactions.