- Complete rewrite with beautiful Rich TUI interface - Interactive and CLI modes for flexibility - Robust error handling with clear, helpful messages - Gap filling with linear interpolation support - Coordinate system transforms (pixels/normalized) - Auto-generated output filenames from input - Configurable resolution and Nuke versions - Batch processing support via CLI - Comprehensive documentation in Scripts/README_CONVERTER.md - Updated main README.md with Scripts section
6.4 KiB
6.4 KiB
3DE to Nuke Track Converter v2.0
A professional, feature-rich tool for converting 3DEqualizer 2D tracks to Nuke Tracker4 nodes with a beautiful terminal interface.
Features
✨ Core Improvements (from v1.0)
- CLI Arguments & Configurable I/O - No more hard-coded filenames
- Robust Error Handling - Clear error messages with line numbers
- Gap Filling & Interpolation - Handle missing frames intelligently
- Coordinate System Support - Pixels or normalized coordinates with transforms
- Track Name Preservation - Custom naming with prefixes
- Nuke Version Compatibility - Configurable version and format settings
- Multiple Output Modes - Interactive TUI, CLI, dry-run, and verbose modes
- Performance Optimized - Progress bars and efficient processing
- Beautiful TUI - Rich terminal interface with tables, panels, and colors
- Comprehensive Validation - Input validation at every step
Installation
# Install dependencies
pip install -r requirements.txt
# Or install Rich directly
pip install rich
Usage
Interactive Mode (Recommended for First-Time Users)
Simply run the script without arguments to enter interactive mode:
python 3de-to-nuke-converter.py
You'll be guided through a beautiful TUI with prompts for:
- Input file path
- Output file path
- Resolution settings
- Coordinate space
- Gap filling options
- Track enable settings
CLI Mode (For Automation & Scripting)
# Basic usage
python 3de-to-nuke-converter.py -i input.txt -o output.nk
# Full example with all options
python 3de-to-nuke-converter.py \
-i tracks.txt \
-o shot_001_tracks.nk \
-w 3840 \
--height 2160 \
--input-space normalized \
--fill-gaps \
--fill-strategy linear \
--flip-y \
--enable-all \
--name-prefix "shot001_" \
--nuke-version "15.2 v3" \
--format "UHD_3840x2160" \
--verbose
Command-Line Options
Required (CLI Mode)
-i, --input- Input 3DE track file path-o, --output- Output Nuke .nk file path
Resolution & Format
-w, --width- Input resolution width (default: 2048)--height- Input resolution height (default: 1556)--format- Nuke format name (default: 2K_Super_35(full-ap))--nuke-version- Nuke version string (default: 15.2 v3)
Coordinate Handling
--input-space {pixels,normalized}- Input coordinate space (default: pixels)--flip-y- Flip Y coordinates (useful for different coordinate origins)
Track Processing
--fill-gaps- Fill missing frames in tracks--fill-strategy {last,linear}- Gap filling method:last- Use last known valuelinear- Linear interpolation between points
--enable-all- Enable all tracks (default: only first track enabled)--name-prefix- Prefix for track names (e.g., "shot001_")
Output Control
-v, --verbose- Show detailed progress and statistics-q, --quiet- Minimal output (errors only)--dry-run- Parse and validate without writing output file
Examples
Example 1: Basic Conversion
python 3de-to-nuke-converter.py -i my_tracks.txt -o my_tracks.nk
Example 2: 4K Resolution with Normalized Coordinates
python 3de-to-nuke-converter.py \
-i tracks_4k.txt \
-o output_4k.nk \
-w 3840 \
--height 2160 \
--input-space normalized
Example 3: Fill Gaps with Linear Interpolation
python 3de-to-nuke-converter.py \
-i sparse_tracks.txt \
-o filled_tracks.nk \
--fill-gaps \
--fill-strategy linear \
--verbose
Example 4: Batch Processing Script
#!/bin/bash
for file in tracks/*.txt; do
output="nuke/$(basename "$file" .txt).nk"
python 3de-to-nuke-converter.py \
-i "$file" \
-o "$output" \
--fill-gaps \
--enable-all \
-q
done
Example 5: Validation Only (Dry Run)
python 3de-to-nuke-converter.py \
-i tracks.txt \
-o /dev/null \
--dry-run \
--verbose
Input File Format
The script expects 3DEqualizer 2D track export format:
<track_count>
<track_number>
<frame_start>
<num_points>
<frame> <x> <y>
<frame> <x> <y>
...
Example:
2
1
1001
3
1001 1024.5 778.2
1002 1025.1 779.0
1003 1026.0 780.5
2
1001
2
1001 512.0 389.0
1002 513.5 390.2
Output
The script generates a Nuke .nk file containing a Tracker4 node with all tracks properly formatted.
Features of Generated Output:
- Proper Nuke version headers
- Configurable format and resolution
- Correct center point calculation
- All track data as animation curves
- Customizable track enable states
- Compatible with Nuke 13.0+
Error Handling
The script provides detailed error messages for common issues:
- File not found - Clear path indication
- Invalid format - Line number and content shown
- Missing data - Specific track and point identified
- Parse errors - Context and suggestions provided
Performance
- Progress bars for long operations
- Efficient parsing with minimal memory overhead
- Streaming output for large track sets
- Optimized for files with 1000+ tracks
Tips & Best Practices
- Use Interactive Mode for one-off conversions
- Use CLI Mode for batch processing and automation
- Enable --verbose when troubleshooting
- Use --dry-run to validate files before conversion
- Fill gaps when tracks have dropped frames
- Use linear interpolation for smoother motion
- Flip Y if coordinate systems don't match
- Name prefix helps organize tracks by shot
Troubleshooting
"File not found" error
- Check the file path is correct
- Use absolute paths if relative paths fail
- Ensure file has .txt extension
"Invalid track count" error
- Verify the first line contains a number
- Check file isn't corrupted
- Ensure proper 3DE export format
Coordinates seem wrong
- Try
--flip-yflag - Check
--input-spacesetting - Verify resolution matches source
Tracks have gaps
- Use
--fill-gapsflag - Choose appropriate
--fill-strategy - Consider if gaps are intentional
Version History
v2.0 (Current)
- Complete rewrite with Rich TUI
- Interactive and CLI modes
- Robust error handling
- Gap filling and interpolation
- Coordinate transformations
- Configurable everything
- Beautiful progress bars and tables
v1.0 (Original)
- Basic conversion functionality
- Hard-coded settings
- Minimal error handling
License
Part of the Biohazard VFX Nuke Template Suite
Support
For issues or questions, contact the VFX pipeline team.