-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgeneratelod.py
32 lines (26 loc) · 878 Bytes
/
generatelod.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
"""
Generates a 50% lod for the selected model
@argument name="Lod Percentage", type="string", default="50.0f"
"""
import lodtools
import sys
import time
percentage = float(sys.argv[1])
selectedcgf = lodtools.getselected()
selectedmaterial = lodtools.getselectedmaterial()
loadedmodel = lodtools.loadcgf(selectedcgf)
loadedmaterial = lodtools.loadmaterial(selectedmaterial)
if loadedmodel == True and loadedmaterial == True:
lodtools.generatelodchain()
finished = 0.0
while finished >= 0.0:
finished = lodtools.generatetick()
print("Lod Chain Generation progress: " + str(finished))
time.sleep(1)
if finished == 1.0:
break
lodtools.createlod(1, percentage)
lodtools.generatematerials(1, 512, 512)
lodtools.savetextures(1)
lodtools.savesettings()
lodtools.reload()