-
Notifications
You must be signed in to change notification settings - Fork 1
/
2_slices_to_vox.py
34 lines (30 loc) · 1004 Bytes
/
2_slices_to_vox.py
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
import os
import glob
from subprocess import Popen
##################
POOL_SIZE = 2
N_REALMS = 5
IN_FOLDER = "output"
OUT_FOLDER = "voxmaps"
##################
if os.name == 'nt':
FTV_EXEC = "FileToVox\\FileToVox.exe"
else:
FTV_EXEC = "FileToVox-v1.13-win/FileToVox.exe"
paths = glob.glob(f"{IN_FOLDER}/height_*.png")
idxs = [path.replace(f"{IN_FOLDER}/height_", "").replace(".png", "") for path in paths]
done_folders = glob.glob(f"{OUT_FOLDER}/wmap_*.vox")
done_idxs = [path.replace(f"{OUT_FOLDER}/wmap_", "").replace(".vox", "") for path in paths]
candidates = [path for path in paths if path not in done_idxs]
candidates = candidates[:N_REALMS]
if __name__ == '__main__':
commands = []
for realm_number in candidates:
commands.append(
f"{FTV_EXEC} " +
f"--i {IN_FOLDER}/hslices_{realm_number}" +
f"--o {OUT_FOLDER}/wmap_{realm_number}"
)
procs = [Popen(i, shell=True) for i in commands]
for p in procs:
p.wait()