File size: 661 Bytes
b6e5497
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# Render all BVH files to MP4, running N jobs in parallel
cd "$(dirname "$0")"

JOBS=4
count=0
total=$(find . -name "*.bvh" -type f | wc -l)
current=0

for bvh in $(find . -name "*.bvh" -type f | sort); do
    mp4="${bvh%.bvh}.mp4"
    current=$((current + 1))

    # Skip if already rendered
    if [ -f "$mp4" ]; then
        echo "[$current/$total] SKIP $bvh (already exists)"
        continue
    fi

    echo "[$current/$total] Rendering $bvh..."
    python3 render_bvh.py "$bvh" "$mp4" &

    count=$((count + 1))
    if [ $count -ge $JOBS ]; then
        wait
        count=0
    fi
done

wait
echo "All done!"