-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsetrainvalues.py
69 lines (63 loc) · 2.21 KB
/
setrainvalues.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
"""
Spits out your rain Values for you
this will take the currently select rain item and generate the rain values for you.
horrible code but it does the job
"""
import general
if __name__ == "__main__":
# spits out the code for the rain values for faster tweaking
properties = [
"amount",
"DiffuseDarkening",
"FakeReflectionsAmount",
"PuddlesAmount",
"puddlesMaskAmount",
"puddlesRippleAmount",
"RainDropsAmount",
"RainDropsLighting",
"RainDropsSpeed",
"SplashesAmount",
]
# holding pattern for loop
retVal = "self:SetRainValues("
for x in properties:
selObj = general.get_names_of_selected_objects()
temp = general.get_entity_property(selObj[0], x)
retVal = retVal + str(temp) + ","
# print out the holding pattern
print("holding pattern")
print(retVal + ");")
# ramp u pattern for loop
print("ramp up pattern")
retVal = "self:SetRainValues("
counter = 0
for x in properties:
counter = counter + 1
selObj = general.get_names_of_selected_objects()
temp = general.get_entity_property(selObj[0], x)
# 0.5*rp, 0.0*rp, 0.11*rp, 1.0, 0.7, 1.0, 0.1*rp, 2.0, 1.0, 1.0*rp
if (
(counter == 1)
or (counter == 2)
or (counter == 3)
or (counter == 7)
or (counter == 10)
):
retVal = retVal + str(temp) + "*rp,"
else:
retVal = retVal + str(temp) + ","
print(retVal + ");")
# ramp down pattern for loop
print("ramp down pattern")
retVal = "self:SetRainValues("
counter = 0
for x in properties:
counter = counter + 1
selObj = general.get_names_of_selected_objects()
temp = general.get_entity_property(selObj[0], x)
# 0.5 - 0.5*rp, 0.0, 0.11 - 0.11*rp, 1.0, 0.7, 1.0, 0.1 - 0.1*rp, 2.0, 1.0, 1.0 - 1.0*rp
if (counter == 1) or (counter == 3) or (counter == 7) or (counter == 10):
retVal = retVal + str(temp) + " - " + str(temp) + "*rp,"
else:
retVal = retVal + str(temp) + ","
print(retVal + ");")