-
Notifications
You must be signed in to change notification settings - Fork 0
/
boom.py
executable file
·226 lines (187 loc) · 7.01 KB
/
boom.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
#!/usr/bin/python
import os
import sys
import math
pbsGen= "./pbsGen.py"
executable = "volumerender.py"
execName = "renderBoom"
pbsName = "boom"
picDir = "/home/zwelch/819/ZWELCH_819/renderer/pics/"
extension = "exr"
def CmdLineFindIndex( tag ):
for i in range(len(sys.argv)):
if sys.argv[i] == tag:
return i
return -1
def CmdLineFind( tag, defaultvalue ):
i = CmdLineFindIndex(tag)
if i > 0:
if i < len(sys.argv)-1:
return sys.argv[i+1]
return defaultvalue
ds = float(CmdLineFind("-ds",.05))
jobLabel = CmdLineFind("-job","boomFlame")
scale = float(CmdLineFind("-scale",1))
#pbsName = "flame"+str(scale)
frame = 111
radius1 = 0
radius2 = 0
radius3 = 0
radius4 = 0
radius5 = 0
roughness = 0
temp1 = 3000
temp2 = 3000
temp3 = 3000
temp4 = 3000
temp5 = 3000
octave1 = 2
octave2 = 2
octave3 = 2
octave4 = 2
octave5 = 2
fjump = 2
angle1 = 0.0
angle2 = 0.0
angle3 = 0.0
angle4 = 0.0
angle5 = 0.0
theta = 360.0/50.0
x1 = 0
y1 = 1
x2 = 0
y2 = 1
x3 = 0
y3 = 1
x4 = 0
y4 = 1
x5 = 0
y5 = 1
while frame < 210:
rad_angle = angle1 * math.pi/180.0
y1 = .5*.3 * math.cos(rad_angle)
x1 = .5*.3 * math.sin(rad_angle)
angle1 += theta
padframe = str(frame)
if frame < 1000:
padframe = "0" + padframe
if frame < 100:
padframe = "0" + padframe
if frame < 10:
padframe = "0" + padframe
command = command = pbsGen + " -script " + executable + " -frame " + str(frame) + " -job " +str(jobLabel) + " -execName "+execName + " -pbsName "+pbsName + " -extras" + " -fname " + picDir + jobLabel +"/"+jobLabel +"."+ str(padframe) + "." + extension + " -ds " + str(ds) +" -radius1 " + str(radius1) + " -roughness1 .75 -trans1 " + str(roughness) + " "+ str(roughness) + " "+ str(roughness) + " -fjump1 " + str(fjump) + " -temp1 " + str(temp1) + " -octaves1 " + str(octave1) + " -pos1 " + str(x1) + " " +str(y1) + " 0 "
if frame > 121:
rad_angle = angle2 * math.pi/180.0
y2 = .5*.3 * math.cos(rad_angle)
x2 = .5*.3 * math.sin(rad_angle)
angle2+=theta
if radius2 < 1.0*.3:
radius2 = radius2 + 1/50.0
if temp2 < 6000:
temp2 = temp2 + 100
octave2 += 1/50.0
command = command + "-radius2 " + str(radius2) + " -roughness2 .75 -trans2 " + str(roughness) + " "+ str(roughness) + " "+ str(roughness) + " -fjump2 " + str(fjump) + " -temp2 " + str(temp2) + " -octaves2 " + str(octave2) + " -pos2 " + str(x2) + " " +str(y2) + " 0 "
if frame > 131:
rad_angle = angle3 * math.pi/180.0
y3 = .5*.3 * math.cos(rad_angle)
x3 = .5*.3 * math.sin(rad_angle)
angle3+=theta
if radius3 < 1.0*.3:
radius3 = radius3 + 1/50.0
if temp3 < 6000:
temp3 = temp3 + 100
octave3 += 1/50.0
command = command + "-radius3 " + str(radius3) + " -roughness3 .75 -trans3 " + str(roughness) + " "+ str(roughness) + " "+ str(roughness) + " -fjump3 " + str(fjump) + " -temp3 " + str(temp3) + " -octaves3 " + str(octave3) + " -pos3 " + str(x3) + " " +str(y3) + " 0 "
if frame > 141:
rad_angle = angle4 * math.pi/180.0
y4 = .5*.3 * math.cos(rad_angle)
x4 = .5*.3 * math.sin(rad_angle)
angle4+=theta
if radius4 < 1.0*.3:
radius4 = radius4 + 1/50.0
if temp4 < 6000:
temp4 = temp4 + 100
octave4 += 1/50.0
command = command + "-radius4 " + str(radius4) + " -roughness4 .75 -trans4 " + str(roughness) + " "+ str(roughness) + " "+ str(roughness) + " -fjump4 " + str(fjump) + " -temp4 " + str(temp4) + " -octaves4 " + str(octave4) + " -pos4 " + str(x4) + " " +str(y4) + " 0 "
if frame > 151:
rad_angle = angle5 * math.pi/180.0
y5 = .5*.3 * math.cos(rad_angle)
x5 = .5*.3 * math.sin(rad_angle)
angle5+=theta
if radius5 < 1.0*.3:
radius5= radius5 + 1/50.0
if temp5 < 6000:
temp5 = temp5 + 100
octave5 += 1/50.0
command = command + "-radius5 " + str(radius5) + " -roughness5 .75 -trans5 " + str(roughness) + " "+ str(roughness) + " "+ str(roughness) + " -fjump5 " + str(fjump) + " -temp5 " + str(temp5) + " -octaves5 " + str(octave5) + " -pos5 " + str(x5) + " " +str(y5) + " 0 -scale " + str(scale)
print command
if radius1 < 1*.3:
radius1 = radius1 + 1/50.0
frame = frame + 1
roughness = roughness + 1/10.0
if frame > 161:
fjump = fjump + 1/50.0
if temp1 < 6000:
temp1 = temp1 + 100
octave1 = octave1 + 1/50.0
# os.system(command)
x = 0
y = 0
z = 0
frame = 316
while frame < 361:
rad_angle = angle1 * math.pi/180.0
y1 = .5 * math.cos(rad_angle)
x1 = .5 * math.sin(rad_angle)
angle1 += theta
x += 3/45.0
y += .75/45.0
z += 1.5/45.0
padframe = str(frame)
if frame < 1000:
padframe = "0" + padframe
if frame < 100:
padframe = "0" + padframe
if frame < 10:
padframe = "0" + padframe
command = pbsGen + " -script " + executable + " -frame " + str(frame) + " -job " +str(jobLabel) + " -execName "+execName + " -pbsName "+pbsName +" -extras" + " -fname " + picDir + jobLabel +"/"+jobLabel+"." + str(padframe) + "." + extension + " -frame "+str(frame) + " -ds " + str(ds) + " -radius1 " + str(radius1) + " -roughness1 .75 -trans1 " + str(roughness) + " "+ str(roughness) + " "+ str(roughness) + " -fjump1 " + str(fjump) + " -temp1 " + str(temp1) + " -octaves1 " + str(octave1) + " -pos1 " + str(x+x1) + " " +str(y + y1) +" "+ str(z)
rad_angle = angle2 * math.pi/180.0
y2 = .5 * .3 * math.cos(rad_angle)
x2 = .5 * .3 * math.sin(rad_angle)
angle2+=theta
if temp2 > 3000:
temp2 = temp2 - 100
octave2 -= 1/50.0
command = command + " -radius2 " + str(radius2) + " -roughness2 .75 -trans2 " + str(roughness) + " "+ str(roughness) + " "+ str(roughness) + " -fjump2 " + str(fjump) + " -temp2 " + str(temp2) + " -octaves2 " + str(octave2) + " -pos2 " + str(x + x2) + " " +str(y + y2) +" "+ str(z)
rad_angle = angle3 * math.pi/180.0
y3 = .5 * .3 * math.cos(rad_angle)
x3 = .5 * .3 * math.sin(rad_angle)
angle3+=theta
if temp3 > 3000:
temp3 = temp3 - 100
octave3 -= 1/50.0
command = command + " -radius3 " + str(radius3) + " -roughness3 .75 -trans3 " + str(roughness) + " "+ str(roughness) + " "+ str(roughness) + " -fjump3 " + str(fjump) + " -temp3 " + str(temp3) + " -octaves3 " + str(octave3) + " -pos3 " + str(x + x3) + " " +str(y + y3) +" "+ str(z)
rad_angle = angle4 * math.pi/180.0
y4 = .5 * .3 * math.cos(rad_angle)
x4 = .5 * .3 * math.sin(rad_angle)
angle4+=theta
if temp4 > 3000:
temp4 = temp4 - 100
octave4 -= 1/50.0
command = command + " -radius4 " + str(radius4) + " -roughness4 .75 -trans4 " + str(roughness) + " "+ str(roughness) + " "+ str(roughness) + " -fjump4 " + str(fjump) + " -temp4 " + str(temp4) + " -octaves4 " + str(octave4) + " -pos4 " + str(x + x4) + " " +str(y + y4) +" "+ str(z)
rad_angle = angle5 * math.pi/180.0
y5 = .5 * .3 * math.cos(rad_angle)
x5 = .5 * .3 * math.sin(rad_angle)
angle5+=theta
if temp5 >3000:
temp5 = temp5 - 100
octave5 -= 1/50.0
command = command + " -radius5 " + str(radius5) + " -roughness5 .75 -trans5 " + str(roughness) + " "+ str(roughness) + " "+ str(roughness) + " -fjump5 " + str(fjump) + " -temp5 " + str(temp5) + " -octaves5 " + str(octave5) + " -pos5 " + str(x + x5) + " " +str( y + y5) +" "+ str(z)
print command
frame = frame + 1
roughness = roughness + 1/10.0
fjump = fjump + 1/50.0
if temp1 > 3000:
temp1 = temp1 - 100
octave1 = octave1 - 1/50.0
# os.system(command)