flame_timewarp_extractor 2.1.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Manifest.txt +2 -0
- data/README.rdoc +1 -1
- data/Rakefile +1 -1
- data/bin/flametwextract +17 -6
- data/lib/flame_timewarp_extractor.rb +12 -25
- data/test/samples/TW_16_010_v01.output.txt +428 -0
- data/test/test_cli.rb +46 -0
- data/test/test_twextract.rb +10 -22
- metadata +9 -29
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
@@ -8,5 +8,7 @@ lib/flame_timewarp_extractor.rb
|
|
8
8
|
test/samples/TW_015_010_v01_Baked.timewarp
|
9
9
|
test/samples/TW_016_010_v01.timewarp
|
10
10
|
test/samples/TW_016_010_v01_Baked.timewarp
|
11
|
+
test/samples/TW_16_010_v01.output.txt
|
11
12
|
test/samples/output.txt
|
13
|
+
test/test_cli.rb
|
12
14
|
test/test_twextract.rb
|
data/README.rdoc
CHANGED
data/Rakefile
CHANGED
@@ -6,7 +6,7 @@ require 'hoe'
|
|
6
6
|
Hoe.spec 'flame_timewarp_extractor' do | s |
|
7
7
|
s.readme_file = 'README.rdoc'
|
8
8
|
s.developer('Julik', 'me@julik.nl')
|
9
|
-
s.extra_deps = {"flame_channel_parser" => "
|
9
|
+
s.extra_deps = {"flame_channel_parser" => "~> 2.1.0"}
|
10
10
|
s.clean_globs = %w( **/.DS_Store coverage.info **/*.rbc .idea .yardoc)
|
11
11
|
end
|
12
12
|
|
data/bin/flametwextract
CHANGED
@@ -2,18 +2,29 @@
|
|
2
2
|
require File.dirname(__FILE__) + '/../lib/flame_timewarp_extractor'
|
3
3
|
require 'optparse'
|
4
4
|
|
5
|
-
options =
|
5
|
+
options = {:destination => $stdout }
|
6
6
|
op = OptionParser.new
|
7
7
|
|
8
8
|
op.banner = "Usage: flametwextract -e 123 /usr/discreet/projects/ExpensiveDildo/timewarp/shot2_tw.timewarp > /mnt/3d/curves/shot2_tw.framecurve.txt"
|
9
|
-
op.on(" -e", "--endframe FRAME",
|
10
|
-
Integer, "Bake the time curve upto this specific frame (defaults to
|
9
|
+
op.on(" -e", "--endframe FRAME",
|
10
|
+
Integer, "Bake the time curve upto this specific frame (defaults to frame 1)"
|
11
11
|
) {|upto| options[:end_frame] = upto }
|
12
12
|
op.on(" -s", "--startframe FRAME",
|
13
|
-
Integer, "Bake the time curve from this specific frame (defaults to the
|
13
|
+
Integer, "Bake the time curve from this specific frame (defaults to the end of the setup"
|
14
14
|
) {|from| options[:start_frame] = from }
|
15
15
|
|
16
16
|
op.parse!
|
17
17
|
|
18
|
-
|
19
|
-
|
18
|
+
setup_path = ARGV.shift
|
19
|
+
|
20
|
+
unless setup_path
|
21
|
+
$stderr.puts "No input file path provided. Please see flametwextract --help for usage information."
|
22
|
+
exit -1
|
23
|
+
end
|
24
|
+
|
25
|
+
unless File.exist?(setup_path)
|
26
|
+
$stderr.puts "File does not exist."
|
27
|
+
exit -1
|
28
|
+
end
|
29
|
+
|
30
|
+
FlameTimewarpExtractor.new.extract(setup_path, options)
|
@@ -3,37 +3,24 @@ require "flame_channel_parser"
|
|
3
3
|
|
4
4
|
class FlameTimewarpExtractor
|
5
5
|
|
6
|
-
VERSION = "
|
6
|
+
VERSION = "4.0.0"
|
7
7
|
|
8
8
|
# Channels that can be the timewarp
|
9
9
|
CHANNELS = %( Timing/Timing Frame )
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
# Pass the path to the Kronos or Timewarp setup here and you will get the timewarp curve on STDOUT
|
14
|
-
def extract(path, options = {})
|
15
|
-
options = DEFAULTS.merge(options)
|
16
|
-
File.open(path) do | f |
|
17
|
-
channels = FlameChannelParser.parse(f)
|
18
|
-
|
19
|
-
timing_channel = channels.find{|c| CHANNELS.include?(c.name) }
|
20
|
-
raise "No timing channel found in this setup" unless timing_channel
|
21
|
-
|
22
|
-
write_channel(timing_channel, options[:destination], options[:start_frame], options[:end_frame])
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
private
|
27
|
-
|
28
|
-
def write_channel(channel, to_io, start_frame, end_frame)
|
29
|
-
interpolator = FlameChannelParser::Interpolator.new(channel)
|
30
|
-
|
31
|
-
from_frame = start_frame || interpolator.first_defined_frame
|
32
|
-
to_frame = end_frame || interpolator.first_defined_frame
|
11
|
+
class X < FlameChannelParser::Extractor
|
33
12
|
|
34
|
-
|
35
|
-
|
13
|
+
# This one is overridden here since instead of looking for a particular channel we are looking
|
14
|
+
# for matches from a list
|
15
|
+
def find_channel_in(channels, channel_path)
|
16
|
+
# Ignore the passed channels, just override
|
17
|
+
detected_channel = channels.find{|c| CHANNELS.include?(c.path) }
|
18
|
+
return detected_channel if detected_channel
|
19
|
+
raise ChannelNotFoundError, compose_channel_not_found_message(CHANNELS.join(' or '), channels)
|
36
20
|
end
|
37
21
|
end
|
38
22
|
|
23
|
+
def extract(file_path, options)
|
24
|
+
return X.extract(file_path, options)
|
25
|
+
end
|
39
26
|
end
|
@@ -0,0 +1,428 @@
|
|
1
|
+
1 1.00000
|
2
|
+
2 2.00000
|
3
|
+
3 3.00000
|
4
|
+
4 4.00000
|
5
|
+
5 5.00000
|
6
|
+
6 6.00000
|
7
|
+
7 7.00000
|
8
|
+
8 8.00000
|
9
|
+
9 9.00000
|
10
|
+
10 10.00000
|
11
|
+
11 11.00000
|
12
|
+
12 12.00000
|
13
|
+
13 13.00000
|
14
|
+
14 14.00000
|
15
|
+
15 15.00000
|
16
|
+
16 16.00000
|
17
|
+
17 17.00000
|
18
|
+
18 18.00000
|
19
|
+
19 19.00000
|
20
|
+
20 20.00000
|
21
|
+
21 21.00000
|
22
|
+
22 22.00000
|
23
|
+
23 23.00000
|
24
|
+
24 24.00000
|
25
|
+
25 25.00000
|
26
|
+
26 26.00000
|
27
|
+
27 27.00000
|
28
|
+
28 28.00000
|
29
|
+
29 29.00000
|
30
|
+
30 30.00000
|
31
|
+
31 31.00000
|
32
|
+
32 32.00000
|
33
|
+
33 33.00000
|
34
|
+
34 34.00000
|
35
|
+
35 35.00000
|
36
|
+
36 36.00000
|
37
|
+
37 37.00000
|
38
|
+
38 38.00000
|
39
|
+
39 39.00000
|
40
|
+
40 40.00000
|
41
|
+
41 41.00000
|
42
|
+
42 42.00000
|
43
|
+
43 43.00000
|
44
|
+
44 44.00000
|
45
|
+
45 45.00000
|
46
|
+
46 46.00000
|
47
|
+
47 47.00000
|
48
|
+
48 48.00000
|
49
|
+
49 49.00000
|
50
|
+
50 50.00000
|
51
|
+
51 51.00000
|
52
|
+
52 52.00000
|
53
|
+
53 53.00000
|
54
|
+
54 54.00000
|
55
|
+
55 55.00000
|
56
|
+
56 56.00000
|
57
|
+
57 57.00000
|
58
|
+
58 58.00000
|
59
|
+
59 59.00000
|
60
|
+
60 60.00000
|
61
|
+
61 61.00000
|
62
|
+
62 62.00000
|
63
|
+
63 63.00000
|
64
|
+
64 64.00000
|
65
|
+
65 65.00000
|
66
|
+
66 66.00000
|
67
|
+
67 67.00000
|
68
|
+
68 68.00000
|
69
|
+
69 69.00000
|
70
|
+
70 70.00000
|
71
|
+
71 71.00000
|
72
|
+
72 72.00000
|
73
|
+
73 73.00000
|
74
|
+
74 74.00000
|
75
|
+
75 75.00000
|
76
|
+
76 76.00000
|
77
|
+
77 77.00000
|
78
|
+
78 78.00000
|
79
|
+
79 79.00000
|
80
|
+
80 80.00000
|
81
|
+
81 81.00000
|
82
|
+
82 82.00000
|
83
|
+
83 83.00000
|
84
|
+
84 84.00000
|
85
|
+
85 85.00000
|
86
|
+
86 86.00000
|
87
|
+
87 87.00000
|
88
|
+
88 88.00000
|
89
|
+
89 89.00000
|
90
|
+
90 90.00000
|
91
|
+
91 91.00000
|
92
|
+
92 92.00000
|
93
|
+
93 93.00000
|
94
|
+
94 94.00000
|
95
|
+
95 95.00000
|
96
|
+
96 96.00000
|
97
|
+
97 97.00000
|
98
|
+
98 98.00000
|
99
|
+
99 99.00000
|
100
|
+
100 100.00000
|
101
|
+
101 101.00000
|
102
|
+
102 102.00000
|
103
|
+
103 103.00000
|
104
|
+
104 104.00000
|
105
|
+
105 105.00000
|
106
|
+
106 106.00000
|
107
|
+
107 107.00000
|
108
|
+
108 108.00000
|
109
|
+
109 109.00000
|
110
|
+
110 110.00000
|
111
|
+
111 111.00000
|
112
|
+
112 112.00000
|
113
|
+
113 113.00000
|
114
|
+
114 114.00000
|
115
|
+
115 115.00000
|
116
|
+
116 116.00000
|
117
|
+
117 117.00000
|
118
|
+
118 118.00000
|
119
|
+
119 119.00000
|
120
|
+
120 120.00000
|
121
|
+
121 121.00000
|
122
|
+
122 122.00000
|
123
|
+
123 123.00000
|
124
|
+
124 124.00000
|
125
|
+
125 125.00000
|
126
|
+
126 126.00000
|
127
|
+
127 127.00000
|
128
|
+
128 128.00000
|
129
|
+
129 129.00000
|
130
|
+
130 130.00000
|
131
|
+
131 131.00000
|
132
|
+
132 132.00000
|
133
|
+
133 133.00000
|
134
|
+
134 134.00000
|
135
|
+
135 135.00000
|
136
|
+
136 136.00000
|
137
|
+
137 137.00000
|
138
|
+
138 138.00000
|
139
|
+
139 139.00000
|
140
|
+
140 140.00000
|
141
|
+
141 141.00000
|
142
|
+
142 142.00000
|
143
|
+
143 143.00000
|
144
|
+
144 144.00000
|
145
|
+
145 145.00000
|
146
|
+
146 146.00000
|
147
|
+
147 147.00000
|
148
|
+
148 148.00000
|
149
|
+
149 149.00000
|
150
|
+
150 150.00000
|
151
|
+
151 151.00000
|
152
|
+
152 152.00000
|
153
|
+
153 153.00000
|
154
|
+
154 154.00000
|
155
|
+
155 155.00000
|
156
|
+
156 156.00000
|
157
|
+
157 157.00000
|
158
|
+
158 158.00000
|
159
|
+
159 159.00000
|
160
|
+
160 160.00000
|
161
|
+
161 161.02799
|
162
|
+
162 162.11214
|
163
|
+
163 163.25276
|
164
|
+
164 164.45013
|
165
|
+
165 165.70456
|
166
|
+
166 167.01633
|
167
|
+
167 168.38575
|
168
|
+
168 169.81310
|
169
|
+
169 171.29868
|
170
|
+
170 172.84278
|
171
|
+
171 174.44571
|
172
|
+
172 176.10775
|
173
|
+
173 177.82920
|
174
|
+
174 179.61036
|
175
|
+
175 181.45151
|
176
|
+
176 183.35296
|
177
|
+
177 185.31499
|
178
|
+
178 187.33791
|
179
|
+
179 189.42200
|
180
|
+
180 191.52283
|
181
|
+
181 193.59401
|
182
|
+
182 195.63295
|
183
|
+
183 197.63706
|
184
|
+
184 199.60372
|
185
|
+
185 201.53033
|
186
|
+
186 203.41431
|
187
|
+
187 205.25304
|
188
|
+
188 207.04393
|
189
|
+
189 208.78438
|
190
|
+
190 210.47179
|
191
|
+
191 212.10355
|
192
|
+
192 213.67706
|
193
|
+
193 215.18974
|
194
|
+
194 216.63897
|
195
|
+
195 218.02216
|
196
|
+
196 219.33670
|
197
|
+
197 220.58000
|
198
|
+
198 221.77282
|
199
|
+
199 222.93894
|
200
|
+
200 224.08026
|
201
|
+
201 225.19868
|
202
|
+
202 226.29610
|
203
|
+
203 227.37442
|
204
|
+
204 228.43555
|
205
|
+
205 229.48138
|
206
|
+
206 230.51382
|
207
|
+
207 231.53478
|
208
|
+
208 232.54614
|
209
|
+
209 233.54982
|
210
|
+
210 234.54772
|
211
|
+
211 235.54173
|
212
|
+
212 236.53376
|
213
|
+
213 237.52572
|
214
|
+
214 238.51950
|
215
|
+
215 239.51700
|
216
|
+
216 240.51700
|
217
|
+
217 241.51700
|
218
|
+
218 242.51700
|
219
|
+
219 243.51700
|
220
|
+
220 244.51700
|
221
|
+
221 245.51700
|
222
|
+
222 246.51700
|
223
|
+
223 247.51700
|
224
|
+
224 248.51700
|
225
|
+
225 249.51700
|
226
|
+
226 250.51700
|
227
|
+
227 251.51700
|
228
|
+
228 252.51700
|
229
|
+
229 253.51700
|
230
|
+
230 254.51700
|
231
|
+
231 255.51700
|
232
|
+
232 256.51700
|
233
|
+
233 257.51700
|
234
|
+
234 258.51700
|
235
|
+
235 259.51700
|
236
|
+
236 260.51700
|
237
|
+
237 261.51700
|
238
|
+
238 262.51700
|
239
|
+
239 263.51700
|
240
|
+
240 264.51700
|
241
|
+
241 265.51700
|
242
|
+
242 266.51700
|
243
|
+
243 267.51700
|
244
|
+
244 268.51700
|
245
|
+
245 269.51700
|
246
|
+
246 270.51700
|
247
|
+
247 271.51700
|
248
|
+
248 272.51700
|
249
|
+
249 273.51700
|
250
|
+
250 274.51700
|
251
|
+
251 275.51700
|
252
|
+
252 276.51700
|
253
|
+
253 277.51700
|
254
|
+
254 278.51700
|
255
|
+
255 279.51700
|
256
|
+
256 280.51700
|
257
|
+
257 281.51700
|
258
|
+
258 282.51700
|
259
|
+
259 283.51700
|
260
|
+
260 284.51700
|
261
|
+
261 285.51700
|
262
|
+
262 286.51700
|
263
|
+
263 287.51700
|
264
|
+
264 288.51700
|
265
|
+
265 289.51700
|
266
|
+
266 290.51700
|
267
|
+
267 291.51700
|
268
|
+
268 292.51700
|
269
|
+
269 293.51700
|
270
|
+
270 294.51700
|
271
|
+
271 295.51700
|
272
|
+
272 296.51700
|
273
|
+
273 297.51700
|
274
|
+
274 298.51700
|
275
|
+
275 299.51700
|
276
|
+
276 300.51700
|
277
|
+
277 301.51700
|
278
|
+
278 302.51700
|
279
|
+
279 303.51700
|
280
|
+
280 304.51700
|
281
|
+
281 305.51700
|
282
|
+
282 306.51700
|
283
|
+
283 307.51700
|
284
|
+
284 308.51700
|
285
|
+
285 309.51700
|
286
|
+
286 310.51700
|
287
|
+
287 311.51700
|
288
|
+
288 312.51700
|
289
|
+
289 313.51700
|
290
|
+
290 314.51700
|
291
|
+
291 315.51700
|
292
|
+
292 316.51700
|
293
|
+
293 317.51700
|
294
|
+
294 318.51700
|
295
|
+
295 319.51700
|
296
|
+
296 320.51700
|
297
|
+
297 321.51700
|
298
|
+
298 322.51700
|
299
|
+
299 323.51700
|
300
|
+
300 324.51700
|
301
|
+
301 325.51700
|
302
|
+
302 326.51700
|
303
|
+
303 327.51700
|
304
|
+
304 328.51700
|
305
|
+
305 329.51700
|
306
|
+
306 330.51700
|
307
|
+
307 331.51700
|
308
|
+
308 332.51700
|
309
|
+
309 333.51700
|
310
|
+
310 334.51700
|
311
|
+
311 335.51700
|
312
|
+
312 336.51700
|
313
|
+
313 337.51700
|
314
|
+
314 338.51700
|
315
|
+
315 339.51700
|
316
|
+
316 340.51700
|
317
|
+
317 341.51700
|
318
|
+
318 342.51700
|
319
|
+
319 343.51700
|
320
|
+
320 344.51700
|
321
|
+
321 345.51700
|
322
|
+
322 346.51700
|
323
|
+
323 347.51700
|
324
|
+
324 348.51700
|
325
|
+
325 349.51700
|
326
|
+
326 350.51700
|
327
|
+
327 351.51700
|
328
|
+
328 352.51700
|
329
|
+
329 353.51700
|
330
|
+
330 354.51700
|
331
|
+
331 355.51700
|
332
|
+
332 356.51700
|
333
|
+
333 357.51700
|
334
|
+
334 358.51700
|
335
|
+
335 359.51700
|
336
|
+
336 360.51700
|
337
|
+
337 361.51700
|
338
|
+
338 362.51700
|
339
|
+
339 363.51700
|
340
|
+
340 364.51700
|
341
|
+
341 365.51700
|
342
|
+
342 366.51700
|
343
|
+
343 367.51700
|
344
|
+
344 368.51700
|
345
|
+
345 369.51700
|
346
|
+
346 370.51700
|
347
|
+
347 371.51700
|
348
|
+
348 372.51700
|
349
|
+
349 373.51700
|
350
|
+
350 374.51700
|
351
|
+
351 375.51700
|
352
|
+
352 376.51700
|
353
|
+
353 377.51700
|
354
|
+
354 378.51700
|
355
|
+
355 379.51700
|
356
|
+
356 380.51700
|
357
|
+
357 381.51700
|
358
|
+
358 382.51700
|
359
|
+
359 383.51700
|
360
|
+
360 384.51700
|
361
|
+
361 385.51700
|
362
|
+
362 386.51700
|
363
|
+
363 387.51700
|
364
|
+
364 388.51700
|
365
|
+
365 389.51700
|
366
|
+
366 390.51700
|
367
|
+
367 391.51700
|
368
|
+
368 392.51700
|
369
|
+
369 393.51700
|
370
|
+
370 394.51700
|
371
|
+
371 395.51700
|
372
|
+
372 396.51700
|
373
|
+
373 397.51700
|
374
|
+
374 398.51700
|
375
|
+
375 399.51700
|
376
|
+
376 400.51700
|
377
|
+
377 401.51700
|
378
|
+
378 402.51700
|
379
|
+
379 403.51700
|
380
|
+
380 404.51700
|
381
|
+
381 405.51700
|
382
|
+
382 406.51700
|
383
|
+
383 407.51700
|
384
|
+
384 408.51700
|
385
|
+
385 409.51700
|
386
|
+
386 410.51700
|
387
|
+
387 411.51700
|
388
|
+
388 412.51700
|
389
|
+
389 413.51700
|
390
|
+
390 414.51700
|
391
|
+
391 415.51700
|
392
|
+
392 416.51700
|
393
|
+
393 417.51700
|
394
|
+
394 418.51700
|
395
|
+
395 419.51700
|
396
|
+
396 420.51700
|
397
|
+
397 421.51700
|
398
|
+
398 422.51700
|
399
|
+
399 423.51700
|
400
|
+
400 424.51700
|
401
|
+
401 425.51700
|
402
|
+
402 426.51700
|
403
|
+
403 427.51700
|
404
|
+
404 428.51700
|
405
|
+
405 429.51700
|
406
|
+
406 430.51700
|
407
|
+
407 431.51700
|
408
|
+
408 432.51700
|
409
|
+
409 433.51700
|
410
|
+
410 434.51700
|
411
|
+
411 435.51700
|
412
|
+
412 436.51700
|
413
|
+
413 437.51700
|
414
|
+
414 438.51700
|
415
|
+
415 439.51700
|
416
|
+
416 440.51700
|
417
|
+
417 441.51700
|
418
|
+
418 442.51700
|
419
|
+
419 443.51700
|
420
|
+
420 444.51700
|
421
|
+
421 445.51700
|
422
|
+
422 446.51700
|
423
|
+
423 447.51700
|
424
|
+
424 448.51700
|
425
|
+
425 449.51700
|
426
|
+
426 450.51700
|
427
|
+
427 451.51700
|
428
|
+
428 452.51700
|
data/test/test_cli.rb
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
require "test/unit"
|
2
|
+
require "stringio"
|
3
|
+
require "tempfile"
|
4
|
+
|
5
|
+
class TestCli < Test::Unit::TestCase
|
6
|
+
BIN_P = File.expand_path(File.dirname(__FILE__) + "/../bin/flametwextract")
|
7
|
+
|
8
|
+
# Run the binary under test with passed options, and return [exit_code, stdout_content, stderr_content]
|
9
|
+
def cli(commandline_arguments)
|
10
|
+
old_stdout, old_stderr, old_argv = $stdout, $stderr, ARGV.dup
|
11
|
+
os, es = StringIO.new, StringIO.new
|
12
|
+
begin
|
13
|
+
$stdout, $stderr, verbosity = os, es, $VERBOSE
|
14
|
+
ARGV.replace(commandline_arguments.split)
|
15
|
+
$VERBOSE = false
|
16
|
+
load(BIN_P)
|
17
|
+
return [0, os.string, es.string]
|
18
|
+
rescue SystemExit => boom # The binary uses exit(), we use that to preserve the output code
|
19
|
+
return [boom.status, os.string, es.string]
|
20
|
+
ensure
|
21
|
+
$VERBOSE = verbosity
|
22
|
+
ARGV.replace(old_argv)
|
23
|
+
$stdout, $stderr = old_stdout, old_stderr
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_cli_with_no_args_produces_usage
|
28
|
+
status, o, e = cli('')
|
29
|
+
assert_equal -1, status
|
30
|
+
assert_match /No input file path provided/, e
|
31
|
+
assert_match /--help for usage information/, e
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_cli_with_nonexisting_file
|
35
|
+
status, o, e = cli(" amazing.action")
|
36
|
+
assert_equal -1, status
|
37
|
+
assert_match /does not exist/, e
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_cli_with_proper_output
|
41
|
+
full_path = File.expand_path(File.dirname(__FILE__)) + "/samples/TW_016_010_v01.timewarp"
|
42
|
+
status, output, e = cli(" " + full_path)
|
43
|
+
assert_equal 0, status
|
44
|
+
assert_equal 428, output.split("\n").length, "Should have output 428 frames"
|
45
|
+
end
|
46
|
+
end
|
data/test/test_twextract.rb
CHANGED
@@ -3,40 +3,28 @@ require "flame_timewarp_extractor"
|
|
3
3
|
require "stringio"
|
4
4
|
|
5
5
|
class TestTwextract < Test::Unit::TestCase
|
6
|
-
def test_parse_with_basic_baked_setup
|
7
|
-
io = StringIO.new
|
8
|
-
FlameTimewarpExtractor.new.extract(File.dirname(__FILE__) + "/samples/TW_015_010_v01_Baked.timewarp", :destination => io)
|
9
|
-
|
10
|
-
compare_outputs(File.read(File.dirname(__FILE__) + "/samples/output.txt"), io.string)
|
11
|
-
end
|
12
6
|
|
13
7
|
def test_parse_with_interpolated_setup
|
14
8
|
interpolated_io = StringIO.new
|
15
|
-
baked_io =
|
9
|
+
baked_io = File.open(File.dirname(__FILE__) + "/samples/TW_16_010_v01.output.txt")
|
16
10
|
|
17
11
|
FlameTimewarpExtractor.new.extract(File.dirname(__FILE__) + "/samples/TW_016_010_v01.timewarp", :destination => interpolated_io)
|
18
|
-
FlameTimewarpExtractor.new.extract(File.dirname(__FILE__) + "/samples/TW_016_010_v01_Baked.timewarp", :destination => baked_io)
|
19
12
|
|
20
|
-
|
13
|
+
assert_same_output(baked_io, interpolated_io)
|
21
14
|
end
|
22
15
|
|
23
16
|
private
|
17
|
+
|
24
18
|
D = 0.1
|
25
19
|
|
26
20
|
# TODO: this one is not working properly
|
27
|
-
def
|
28
|
-
ref
|
29
|
-
|
30
|
-
ref.
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
from_f, from_d = reference_line.strip.split
|
35
|
-
to_f, to_d = output_line.strip.split
|
36
|
-
|
37
|
-
assert_equal from_f, to_f, "at #{lineno} the line should have the same frame"
|
38
|
-
|
39
|
-
assert_in_delta from_d.to_f, to_d.to_f, D, "At frame #{to_f}"
|
21
|
+
def assert_same_output(ref, out)
|
22
|
+
ref.rewind; out.rewind
|
23
|
+
lineno = 1
|
24
|
+
until (ref.eof? && out.eof?)
|
25
|
+
ref_line, out_line = ref.gets, out.gets
|
26
|
+
assert_equal ref_line, out_line, "Line #{lineno} should be the same"
|
27
|
+
lineno += 1
|
40
28
|
end
|
41
29
|
end
|
42
30
|
|
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flame_timewarp_extractor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 11
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 2
|
8
|
-
- 1
|
9
|
-
- 0
|
10
|
-
version: 2.1.0
|
5
|
+
version: 4.0.0
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- Julik
|
@@ -15,8 +10,7 @@ autorequire:
|
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
12
|
|
18
|
-
date: 2011-
|
19
|
-
default_executable:
|
13
|
+
date: 2011-06-24 00:00:00 Z
|
20
14
|
dependencies:
|
21
15
|
- !ruby/object:Gem::Dependency
|
22
16
|
name: flame_channel_parser
|
@@ -24,14 +18,9 @@ dependencies:
|
|
24
18
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
19
|
none: false
|
26
20
|
requirements:
|
27
|
-
- -
|
21
|
+
- - ~>
|
28
22
|
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
segments:
|
31
|
-
- 1
|
32
|
-
- 2
|
33
|
-
- 0
|
34
|
-
version: 1.2.0
|
23
|
+
version: 2.1.0
|
35
24
|
type: :runtime
|
36
25
|
version_requirements: *id001
|
37
26
|
- !ruby/object:Gem::Dependency
|
@@ -42,12 +31,7 @@ dependencies:
|
|
42
31
|
requirements:
|
43
32
|
- - ">="
|
44
33
|
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
segments:
|
47
|
-
- 2
|
48
|
-
- 9
|
49
|
-
- 1
|
50
|
-
version: 2.9.1
|
34
|
+
version: 2.9.4
|
51
35
|
type: :development
|
52
36
|
version_requirements: *id002
|
53
37
|
description: Extract timewarp channels from Flame setup files into a simple list of "to-frame" to "from-frame" mappings.
|
@@ -71,10 +55,11 @@ files:
|
|
71
55
|
- test/samples/TW_015_010_v01_Baked.timewarp
|
72
56
|
- test/samples/TW_016_010_v01.timewarp
|
73
57
|
- test/samples/TW_016_010_v01_Baked.timewarp
|
58
|
+
- test/samples/TW_16_010_v01.output.txt
|
74
59
|
- test/samples/output.txt
|
60
|
+
- test/test_cli.rb
|
75
61
|
- test/test_twextract.rb
|
76
62
|
- .gemtest
|
77
|
-
has_rdoc: true
|
78
63
|
homepage: http://github.com/guerilla-di/twextract
|
79
64
|
licenses: []
|
80
65
|
|
@@ -89,25 +74,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
89
74
|
requirements:
|
90
75
|
- - ">="
|
91
76
|
- !ruby/object:Gem::Version
|
92
|
-
hash: 3
|
93
|
-
segments:
|
94
|
-
- 0
|
95
77
|
version: "0"
|
96
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
79
|
none: false
|
98
80
|
requirements:
|
99
81
|
- - ">="
|
100
82
|
- !ruby/object:Gem::Version
|
101
|
-
hash: 3
|
102
|
-
segments:
|
103
|
-
- 0
|
104
83
|
version: "0"
|
105
84
|
requirements: []
|
106
85
|
|
107
86
|
rubyforge_project: flame_timewarp_extractor
|
108
|
-
rubygems_version: 1.
|
87
|
+
rubygems_version: 1.8.5
|
109
88
|
signing_key:
|
110
89
|
specification_version: 3
|
111
90
|
summary: Extract timewarp channels from Flame setup files into a simple list of "to-frame" to "from-frame" mappings.
|
112
91
|
test_files:
|
92
|
+
- test/test_cli.rb
|
113
93
|
- test/test_twextract.rb
|