-
Notifications
You must be signed in to change notification settings - Fork 0
/
start_render_mesh.sh
54 lines (44 loc) · 1.47 KB
/
start_render_mesh.sh
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
echo "Enter list of uv-textures (Default, Person_0,...) (separated by spaces) or leave empty for random uv-textures:"
read -r uv_material
echo "Enter the camera views (Front or Side) (separated by spaces):"
read -r camera
echo "Enter .blend filename version:"
read -r blend_file
echo "Enter amount of nodes:"
read -r number
echo "Enter a job dependency (if any) or leave blank:"
read -r dependency
IFS=' ' read -r -a uv_material_list <<< "$uv_material"
IFS=' ' read -r -a camera_list <<< "$camera"
echo "Processing uv-textures: ${uv_material_list[*]}"
echo "Processing camera views: ${camera_list[*]}"
echo "Processing amount of nodes: $number"
if [[ -n "$dependency" ]]; then
echo "Processing dependency: $dependency"
else
echo "No dependency entered"
fi
echo ""
for ((i = 1; i <= number; i++)); do
sbatch_command="sbatch --time 1-1 --cpus-per-task=64"
if [[ -n "$dependency" ]]; then
sbatch_command+=" --dependency afterok:$dependency"
fi
sbatch_command+=" --wrap=\"python generating_threading.py \
--blend_file $blend_file \
--thread_num 16 \
--batch_size $number \
--current_batch $((i-1))"
if [[ -n "${uv_material_list[*]}" ]]; then
sbatch_command+=" --uv_material ${uv_material_list[*]}"
fi
if [[ -n "${camera_list[*]}" ]]; then
sbatch_command+=" --camera ${camera_list[*]}"
fi
sbatch_command+="\""
eval "$sbatch_command"
done
echo ""
sleep 1
squeue -u $(whoami)