-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgather_LODs.py
27 lines (22 loc) · 921 Bytes
/
gather_LODs.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
'''
Gather the Level of Detail (LOD) models from Blender, which is saved in [Rock Number]/models folder.
'''
import os
import shutil
root_path = 'H:\RockScan'
rock_category = 'RR4'
start_folder_ID = 1
end_folder_ID = 36
dest_folder = 'H:\RockScan\LODs'
mesh_path = os.path.join(dest_folder, 'Mesh')
texture_path = os.path.join(dest_folder, 'Texture')
if not os.path.exists(mesh_path):
os.makedirs(mesh_path)
if not os.path.exists(texture_path):
os.makedirs(texture_path)
for folderID in range(start_folder_ID, end_folder_ID + 1): # folder name '1', '2', ... '40'
model_path = os.path.join(root_path, rock_category, str(folderID), 'models')
model_name = os.path.join(model_path, rock_category+'_'+str(folderID)+'_'+'LODs'+'.fbx')
texture_name = os.path.join(model_path, rock_category+'_'+str(folderID)+'.jpg')
shutil.copy(model_name, mesh_path)
shutil.copy(texture_name, texture_path)