tracksperanto 2.6.3 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +9 -0
- data/Manifest.txt +3 -5
- data/Rakefile +2 -0
- data/lib/export/shake_text.rb +1 -1
- data/lib/import/shake_grammar/lexer.rb +7 -2
- data/lib/import/shake_text.rb +1 -1
- data/lib/pipeline/base.rb +7 -7
- data/lib/tracksperanto/buffering_reader.rb +40 -0
- data/lib/tracksperanto.rb +13 -3
- data/test/export/test_shake_export.rb +1 -1
- data/test/import/samples/shake_text/nuke_camtracker.txt +11240 -0
- data/test/import/test_pftrack_import.rb +1 -1
- data/test/import/test_shake_text_import.rb +21 -1
- data/test/test_bufferingreader.rb +47 -0
- data/test/test_pipeline.rb +2 -2
- metadata +40 -21
- data/lib/tracksperanto/accumulator.rb +0 -103
- data/lib/tracksperanto/progressive_io.rb +0 -78
- data/test/fixtures/processing_log.txt +0 -50
- data/test/test_accumulator.rb +0 -74
- data/test/test_progressive_io.rb +0 -128
@@ -73,7 +73,7 @@ class PFTrackImportTest < Test::Unit::TestCase
|
|
73
73
|
def test_stereoscopy
|
74
74
|
fixture = File.open(File.dirname(__FILE__) + '/samples/pftrack5/stereo.2dt')
|
75
75
|
parser = Tracksperanto::Import::PFTrack.new(:io => fixture, :width => 1920, :height => 1080)
|
76
|
-
acc =
|
76
|
+
acc = Obuf.new
|
77
77
|
parser.each{|t| acc << t }
|
78
78
|
|
79
79
|
assert_equal 1690, acc.size, "Should have recovered 1690 trackers"
|
@@ -5,7 +5,7 @@ class ShakeTextImportTest < Test::Unit::TestCase
|
|
5
5
|
|
6
6
|
def test_introspects_properly
|
7
7
|
i = Tracksperanto::Import::ShakeText
|
8
|
-
assert_equal "Shake .txt tracker file", i.human_name
|
8
|
+
assert_equal "Shake .txt tracker file and Nuke CameraTracker auto tracks export", i.human_name
|
9
9
|
assert !i.autodetects_size?
|
10
10
|
end
|
11
11
|
|
@@ -48,4 +48,24 @@ class ShakeTextImportTest < Test::Unit::TestCase
|
|
48
48
|
t2 = trackers[-1]
|
49
49
|
assert_equal "track2", t2.name
|
50
50
|
end
|
51
|
+
|
52
|
+
def test_parsing_from_nuke_camera_tracker
|
53
|
+
fixture = File.open(File.dirname(__FILE__) + '/samples/shake_text/nuke_camtracker.txt')
|
54
|
+
trackers = Tracksperanto::Import::ShakeText.new(:io => fixture).to_a
|
55
|
+
|
56
|
+
assert_kind_of Enumerable, trackers
|
57
|
+
assert_equal 261, trackers.length
|
58
|
+
|
59
|
+
t = trackers[0]
|
60
|
+
|
61
|
+
assert_equal "autotrack0", t.name
|
62
|
+
assert_kind_of Tracksperanto::Tracker, t
|
63
|
+
assert_equal 11, t.keyframes.length
|
64
|
+
|
65
|
+
second_kf = t.keyframes[1]
|
66
|
+
assert_in_delta 1, second_kf.frame, DELTA
|
67
|
+
|
68
|
+
t2 = trackers[-1]
|
69
|
+
assert_equal "autotrack260", t2.name
|
70
|
+
end
|
51
71
|
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
2
|
+
|
3
|
+
class TestBufferingReader < Test::Unit::TestCase
|
4
|
+
def test_reads_once
|
5
|
+
s = StringIO.new("This is a string")
|
6
|
+
|
7
|
+
reader = Tracksperanto::BufferingReader.new(s)
|
8
|
+
assert_equal "T", reader.read_one_byte
|
9
|
+
assert_equal "h", reader.read_one_byte
|
10
|
+
assert !reader.data_exhausted?
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_reads_set_buffer_size
|
14
|
+
s = StringIO.new("abcd")
|
15
|
+
flexmock(s).should_receive(:read).with(4).once.and_return("abcd")
|
16
|
+
reader = Tracksperanto::BufferingReader.new(s, 4)
|
17
|
+
reader.read_one_byte
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_reads_in_10kb_chunks_by_default
|
21
|
+
s = StringIO.new("abcd")
|
22
|
+
flexmock(s).should_receive(:read).with(10240).once.and_return("abcd")
|
23
|
+
reader = Tracksperanto::BufferingReader.new(s)
|
24
|
+
reader.read_one_byte
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_eof_with_empty
|
28
|
+
s = StringIO.new
|
29
|
+
reader = Tracksperanto::BufferingReader.new(s)
|
30
|
+
assert s.eof?
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_eof_with_io_at_eof
|
34
|
+
s = StringIO.new("foo")
|
35
|
+
s.read(3)
|
36
|
+
reader = Tracksperanto::BufferingReader.new(s)
|
37
|
+
assert reader.data_exhausted?
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_eof_with_string_to_size
|
41
|
+
s = "Foobarboo another"
|
42
|
+
s = StringIO.new(s)
|
43
|
+
reader = Tracksperanto::BufferingReader.new(s, 1)
|
44
|
+
s.length.times { reader.read_one_byte }
|
45
|
+
assert reader.data_exhausted?
|
46
|
+
end
|
47
|
+
end
|
data/test/test_pipeline.rb
CHANGED
@@ -52,8 +52,8 @@ class PipelineTest < Test::Unit::TestCase
|
|
52
52
|
|
53
53
|
pipeline = Tracksperanto::Pipeline::Base.new(:progress_block => accum)
|
54
54
|
assert_nothing_raised { pipeline.run(@stabilizer) }
|
55
|
-
|
56
|
-
|
55
|
+
assert processing_log.include?("Parsing the file")
|
56
|
+
assert processing_log.include?("Parsing channel \"tracker1/ref/y\"")
|
57
57
|
end
|
58
58
|
|
59
59
|
def test_run_crashes_with_empty_file
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: tracksperanto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 2.
|
5
|
+
version: 2.7.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Julik Tarkhanov
|
@@ -10,74 +10,96 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-10-12 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
16
|
+
name: obuf
|
17
17
|
prerelease: false
|
18
18
|
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
21
|
+
- - ~>
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "1.0"
|
24
|
+
type: :runtime
|
25
|
+
version_requirements: *id001
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: progressive_io
|
28
|
+
prerelease: false
|
29
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
|
+
none: false
|
31
|
+
requirements:
|
32
|
+
- - ~>
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: "1.0"
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id002
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: flame_channel_parser
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
19
41
|
none: false
|
20
42
|
requirements:
|
21
43
|
- - "="
|
22
44
|
- !ruby/object:Gem::Version
|
23
45
|
version: 2.2.1
|
24
46
|
type: :runtime
|
25
|
-
version_requirements: *
|
47
|
+
version_requirements: *id003
|
26
48
|
- !ruby/object:Gem::Dependency
|
27
49
|
name: progressbar
|
28
50
|
prerelease: false
|
29
|
-
requirement: &
|
51
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
30
52
|
none: false
|
31
53
|
requirements:
|
32
54
|
- - ~>
|
33
55
|
- !ruby/object:Gem::Version
|
34
56
|
version: "0.9"
|
35
57
|
type: :runtime
|
36
|
-
version_requirements: *
|
58
|
+
version_requirements: *id004
|
37
59
|
- !ruby/object:Gem::Dependency
|
38
60
|
name: update_hints
|
39
61
|
prerelease: false
|
40
|
-
requirement: &
|
62
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
41
63
|
none: false
|
42
64
|
requirements:
|
43
65
|
- - ~>
|
44
66
|
- !ruby/object:Gem::Version
|
45
67
|
version: "1.0"
|
46
68
|
type: :runtime
|
47
|
-
version_requirements: *
|
69
|
+
version_requirements: *id005
|
48
70
|
- !ruby/object:Gem::Dependency
|
49
71
|
name: flexmock
|
50
72
|
prerelease: false
|
51
|
-
requirement: &
|
73
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
52
74
|
none: false
|
53
75
|
requirements:
|
54
76
|
- - ~>
|
55
77
|
- !ruby/object:Gem::Version
|
56
78
|
version: "0.8"
|
57
79
|
type: :development
|
58
|
-
version_requirements: *
|
80
|
+
version_requirements: *id006
|
59
81
|
- !ruby/object:Gem::Dependency
|
60
82
|
name: cli_test
|
61
83
|
prerelease: false
|
62
|
-
requirement: &
|
84
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
63
85
|
none: false
|
64
86
|
requirements:
|
65
87
|
- - ~>
|
66
88
|
- !ruby/object:Gem::Version
|
67
89
|
version: "1.0"
|
68
90
|
type: :development
|
69
|
-
version_requirements: *
|
91
|
+
version_requirements: *id007
|
70
92
|
- !ruby/object:Gem::Dependency
|
71
93
|
name: hoe
|
72
94
|
prerelease: false
|
73
|
-
requirement: &
|
95
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
74
96
|
none: false
|
75
97
|
requirements:
|
76
98
|
- - ~>
|
77
99
|
- !ruby/object:Gem::Version
|
78
100
|
version: "2.10"
|
79
101
|
type: :development
|
80
|
-
version_requirements: *
|
102
|
+
version_requirements: *id008
|
81
103
|
description: Tracksperanto is a universal 2D-track translator between many apps.
|
82
104
|
email:
|
83
105
|
- me@julik.nl
|
@@ -145,16 +167,15 @@ files:
|
|
145
167
|
- lib/middleware/start_trim.rb
|
146
168
|
- lib/pipeline/base.rb
|
147
169
|
- lib/tracksperanto.rb
|
148
|
-
- lib/tracksperanto/accumulator.rb
|
149
170
|
- lib/tracksperanto/block_init.rb
|
150
171
|
- lib/tracksperanto/buffer_io.rb
|
172
|
+
- lib/tracksperanto/buffering_reader.rb
|
151
173
|
- lib/tracksperanto/casts.rb
|
152
174
|
- lib/tracksperanto/const_name.rb
|
153
175
|
- lib/tracksperanto/ext_io.rb
|
154
176
|
- lib/tracksperanto/flame_builder.rb
|
155
177
|
- lib/tracksperanto/format_detector.rb
|
156
178
|
- lib/tracksperanto/keyframe.rb
|
157
|
-
- lib/tracksperanto/progressive_io.rb
|
158
179
|
- lib/tracksperanto/returning.rb
|
159
180
|
- lib/tracksperanto/safety.rb
|
160
181
|
- lib/tracksperanto/simple_export.rb
|
@@ -188,7 +209,6 @@ files:
|
|
188
209
|
- test/export/test_pftrack_export.rb
|
189
210
|
- test/export/test_shake_export.rb
|
190
211
|
- test/export/test_syntheyes_export.rb
|
191
|
-
- test/fixtures/processing_log.txt
|
192
212
|
- test/helper.rb
|
193
213
|
- test/import/samples/3de_v3/3de_export_v3.txt
|
194
214
|
- test/import/samples/3de_v4/3de_export_cube.txt
|
@@ -229,6 +249,7 @@ files:
|
|
229
249
|
- test/import/samples/shake_script/three_tracks_in_one_stabilizer.shk
|
230
250
|
- test/import/samples/shake_script/track.shk
|
231
251
|
- test/import/samples/shake_script/two_tracks_in_one_tracker.shk
|
252
|
+
- test/import/samples/shake_text/nuke_camtracker.txt
|
232
253
|
- test/import/samples/shake_text/one_shake_tracker.txt
|
233
254
|
- test/import/samples/shake_text/one_shake_tracker_from_first.txt
|
234
255
|
- test/import/samples/shake_text/two_shake_trackers.txt
|
@@ -262,8 +283,8 @@ files:
|
|
262
283
|
- test/middleware/test_shift_middleware.rb
|
263
284
|
- test/middleware/test_slip_middleware.rb
|
264
285
|
- test/middleware/test_start_trim_middleware.rb
|
265
|
-
- test/test_accumulator.rb
|
266
286
|
- test/test_buffer_io.rb
|
287
|
+
- test/test_bufferingreader.rb
|
267
288
|
- test/test_cli.rb
|
268
289
|
- test/test_const_name.rb
|
269
290
|
- test/test_extio.rb
|
@@ -271,7 +292,6 @@ files:
|
|
271
292
|
- test/test_format_detector.rb
|
272
293
|
- test/test_keyframe.rb
|
273
294
|
- test/test_pipeline.rb
|
274
|
-
- test/test_progressive_io.rb
|
275
295
|
- test/test_simple_export.rb
|
276
296
|
- test/test_tracker.rb
|
277
297
|
- test/test_tracksperanto.rb
|
@@ -343,8 +363,8 @@ test_files:
|
|
343
363
|
- test/middleware/test_shift_middleware.rb
|
344
364
|
- test/middleware/test_slip_middleware.rb
|
345
365
|
- test/middleware/test_start_trim_middleware.rb
|
346
|
-
- test/test_accumulator.rb
|
347
366
|
- test/test_buffer_io.rb
|
367
|
+
- test/test_bufferingreader.rb
|
348
368
|
- test/test_cli.rb
|
349
369
|
- test/test_const_name.rb
|
350
370
|
- test/test_extio.rb
|
@@ -352,7 +372,6 @@ test_files:
|
|
352
372
|
- test/test_format_detector.rb
|
353
373
|
- test/test_keyframe.rb
|
354
374
|
- test/test_pipeline.rb
|
355
|
-
- test/test_progressive_io.rb
|
356
375
|
- test/test_simple_export.rb
|
357
376
|
- test/test_tracker.rb
|
358
377
|
- test/test_tracksperanto.rb
|
@@ -1,103 +0,0 @@
|
|
1
|
-
# An accumulator buffer for Ruby objects. Use it to sequentially store a shitload
|
2
|
-
# of objects on disk and then retreive them one by one. Make sure to call clear when done
|
3
|
-
# with it to discard the stored blob. It can be used like a disk-based object buffer.
|
4
|
-
# (Tracksperanto stores parsed trackers into it)
|
5
|
-
#
|
6
|
-
# a = Tracksperanto::Accumulator.new
|
7
|
-
# parse_big_file do | one_node |
|
8
|
-
# a.push(one_node)
|
9
|
-
# end
|
10
|
-
#
|
11
|
-
# a.size #=> 30932 # We've stored 30 thousand objects on disk without breaking a sweat
|
12
|
-
# a.each do | node_read_from_disk |
|
13
|
-
# # do something with node that has been recovered from disk
|
14
|
-
# end
|
15
|
-
#
|
16
|
-
# a.clear # ensure that the file is deleted
|
17
|
-
class Tracksperanto::Accumulator
|
18
|
-
include Enumerable
|
19
|
-
|
20
|
-
DELIM = "\n"
|
21
|
-
|
22
|
-
# Returns the number of objects stored so far
|
23
|
-
attr_reader :size
|
24
|
-
|
25
|
-
def initialize
|
26
|
-
@store = Tracksperanto::BufferIO.new
|
27
|
-
@size = 0
|
28
|
-
|
29
|
-
super
|
30
|
-
end
|
31
|
-
|
32
|
-
def empty?
|
33
|
-
@size.zero?
|
34
|
-
end
|
35
|
-
|
36
|
-
# Store an object
|
37
|
-
def push(object_to_store)
|
38
|
-
blob = marshal_object(object_to_store)
|
39
|
-
@store.write(blob)
|
40
|
-
@size += 1
|
41
|
-
|
42
|
-
object_to_store
|
43
|
-
end
|
44
|
-
|
45
|
-
alias_method :<<, :push
|
46
|
-
|
47
|
-
# Retreive each stored object in succession. All other Enumerable
|
48
|
-
# methods are also available (but be careful with Enumerable#map and to_a)
|
49
|
-
def each
|
50
|
-
with_separate_read_io do | iterable |
|
51
|
-
@size.times { yield(recover_object_from(iterable)) }
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
# Calls close! on the datastore and deletes the objects in it
|
56
|
-
def clear
|
57
|
-
@store.close!
|
58
|
-
@size = 0
|
59
|
-
end
|
60
|
-
|
61
|
-
# Retreive a concrete object at index
|
62
|
-
def [](idx)
|
63
|
-
idx.respond_to?(:each) ? idx.map{|i| recover_at(i) } : recover_at(idx)
|
64
|
-
end
|
65
|
-
|
66
|
-
private
|
67
|
-
|
68
|
-
def recover_at(idx)
|
69
|
-
with_separate_read_io do | iterable |
|
70
|
-
iterable.seek(0)
|
71
|
-
|
72
|
-
# Do not unmarshal anything but wind the IO in fixed offsets
|
73
|
-
idx.times do
|
74
|
-
skip_bytes = iterable.gets("\t").to_i
|
75
|
-
iterable.seek(iterable.pos + skip_bytes)
|
76
|
-
end
|
77
|
-
|
78
|
-
recover_object_from(iterable)
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
# We first ensure that we have a disk-backed file, then reopen it as read-only
|
83
|
-
# and iterate through that (we will have one IO handle per loop nest)
|
84
|
-
def with_separate_read_io
|
85
|
-
iterable = File.open(@store.to_file.path, "r")
|
86
|
-
yield(iterable)
|
87
|
-
ensure
|
88
|
-
iterable.close
|
89
|
-
end
|
90
|
-
|
91
|
-
def marshal_object(object_to_store)
|
92
|
-
d = Marshal.dump(object_to_store)
|
93
|
-
blob = [d.size, "\t", d, DELIM].join
|
94
|
-
end
|
95
|
-
|
96
|
-
def recover_object_from(io)
|
97
|
-
# Up to the tab is the amount of bytes to read
|
98
|
-
demarshal_bytes = io.gets("\t").to_i
|
99
|
-
blob = io.read(demarshal_bytes)
|
100
|
-
|
101
|
-
Marshal.load(blob)
|
102
|
-
end
|
103
|
-
end
|
@@ -1,78 +0,0 @@
|
|
1
|
-
# Used for IO objects that need to report the current offset at each operation that changes the said offset
|
2
|
-
# (useful for building progress bars that report on a file read operation). Pass the actual IO and a block to
|
3
|
-
# report progress to the constructor.
|
4
|
-
class Tracksperanto::ProgressiveIO < DelegateClass(IO)
|
5
|
-
include Tracksperanto::Returning
|
6
|
-
|
7
|
-
# Get or set the total size of the contained IO. If the passed IO is a File object
|
8
|
-
# the size will be preset automatically
|
9
|
-
attr_accessor :total_size
|
10
|
-
attr_accessor :progress_block
|
11
|
-
|
12
|
-
def initialize(with_file, &blk)
|
13
|
-
__setobj__(with_file)
|
14
|
-
@total_size = with_file.stat.size if with_file.respond_to?(:stat)
|
15
|
-
@progress_block = blk.to_proc if blk
|
16
|
-
end
|
17
|
-
|
18
|
-
# Report offset at each line
|
19
|
-
def each(sep_string = $/, &blk)
|
20
|
-
# Report offset at each call of the iterator
|
21
|
-
result = super(sep_string) do | line |
|
22
|
-
yield(line)
|
23
|
-
notify_read
|
24
|
-
end
|
25
|
-
end
|
26
|
-
alias_method :each_line, :each
|
27
|
-
|
28
|
-
def each_byte(&blk)
|
29
|
-
# Report offset at each call of the iterator
|
30
|
-
super { |b| yield(b); notify_read }
|
31
|
-
end
|
32
|
-
|
33
|
-
def getc
|
34
|
-
returning(super) { notify_read }
|
35
|
-
end
|
36
|
-
|
37
|
-
def gets
|
38
|
-
returning(super) { notify_read }
|
39
|
-
end
|
40
|
-
|
41
|
-
def read(*a)
|
42
|
-
returning(super) { notify_read }
|
43
|
-
end
|
44
|
-
|
45
|
-
def readbytes(*a)
|
46
|
-
returning(super) { notify_read }
|
47
|
-
end
|
48
|
-
|
49
|
-
def readchar
|
50
|
-
returning(super) { notify_read }
|
51
|
-
end
|
52
|
-
|
53
|
-
def readline(*a)
|
54
|
-
returning(super) { notify_read }
|
55
|
-
end
|
56
|
-
|
57
|
-
def readlines(*a)
|
58
|
-
returning(super) { notify_read }
|
59
|
-
end
|
60
|
-
|
61
|
-
def seek(*a)
|
62
|
-
returning(super) { notify_read }
|
63
|
-
end
|
64
|
-
|
65
|
-
def ungetc(*a)
|
66
|
-
returning(super) { notify_read }
|
67
|
-
end
|
68
|
-
|
69
|
-
def pos=(p)
|
70
|
-
returning(super) { notify_read }
|
71
|
-
end
|
72
|
-
|
73
|
-
private
|
74
|
-
|
75
|
-
def notify_read
|
76
|
-
@progress_block.call(pos, @total_size) if @progress_block
|
77
|
-
end
|
78
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
0 -> Starting the parser
|
2
|
-
0 -> Extracting setup size
|
3
|
-
0 -> Extracting all animation channels
|
4
|
-
3 -> Parsing the file
|
5
|
-
6 -> Parsing the file
|
6
|
-
9 -> Parsing the file
|
7
|
-
13 -> Parsing the file
|
8
|
-
16 -> Parsing the file
|
9
|
-
19 -> Parsing the file
|
10
|
-
22 -> Parsing the file
|
11
|
-
25 -> Parsing the file
|
12
|
-
28 -> Parsing the file
|
13
|
-
31 -> Parsing the file
|
14
|
-
34 -> Parsing the file
|
15
|
-
37 -> Parsing the file
|
16
|
-
40 -> Parsing the file
|
17
|
-
43 -> Parsing the file
|
18
|
-
46 -> Parsing the file
|
19
|
-
49 -> Parsing the file
|
20
|
-
50 -> Assembling tracker curves from channels
|
21
|
-
50 -> Detected reference channel tracker1/ref/x
|
22
|
-
50 -> Extracting tracker tracker1
|
23
|
-
50 -> Detecting base value
|
24
|
-
50 -> Extracting keyframe 2 of tracker1
|
25
|
-
50 -> Extracting keyframe 3 of tracker1
|
26
|
-
50 -> Extracting keyframe 4 of tracker1
|
27
|
-
50 -> Detected reference channel tracker2/ref/x
|
28
|
-
50 -> Extracting tracker tracker2
|
29
|
-
50 -> Detecting base value
|
30
|
-
50 -> Extracting keyframe 2 of tracker2
|
31
|
-
50 -> Extracting keyframe 3 of tracker2
|
32
|
-
50 -> Extracting keyframe 4 of tracker2
|
33
|
-
50 -> Detected reference channel tracker3/ref/x
|
34
|
-
50 -> Extracting tracker tracker3
|
35
|
-
50 -> Detecting base value
|
36
|
-
50 -> Extracting keyframe 2 of tracker3
|
37
|
-
50 -> Extracting keyframe 3 of tracker3
|
38
|
-
50 -> Extracting keyframe 4 of tracker3
|
39
|
-
50 -> Validating 3 imported trackers
|
40
|
-
50 -> Starting export
|
41
|
-
55 -> Writing keyframe 1 of "tracker1", 3 trackers to go
|
42
|
-
61 -> Writing keyframe 2 of "tracker1", 3 trackers to go
|
43
|
-
66 -> Writing keyframe 3 of "tracker1", 3 trackers to go
|
44
|
-
72 -> Writing keyframe 1 of "tracker2", 2 trackers to go
|
45
|
-
77 -> Writing keyframe 2 of "tracker2", 2 trackers to go
|
46
|
-
83 -> Writing keyframe 3 of "tracker2", 2 trackers to go
|
47
|
-
88 -> Writing keyframe 1 of "tracker3", 1 trackers to go
|
48
|
-
94 -> Writing keyframe 2 of "tracker3", 1 trackers to go
|
49
|
-
100 -> Writing keyframe 3 of "tracker3", 1 trackers to go
|
50
|
-
100 -> Wrote 3 points and 9 keyframes
|
data/test/test_accumulator.rb
DELETED
@@ -1,74 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
2
|
-
|
3
|
-
class TestAccumulator < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def test_accumulator_saves_objs
|
6
|
-
a = Tracksperanto::Accumulator.new
|
7
|
-
values = [3, {:foo => "bar"}, "foo"]
|
8
|
-
values.map(&a.method(:push))
|
9
|
-
|
10
|
-
assert_equal 3, a.size
|
11
|
-
assert_equal values, a.map{|e| e }, "Should return the same elements from the storage"
|
12
|
-
end
|
13
|
-
|
14
|
-
def test_accumulator_saves_shitload_of_objs
|
15
|
-
a = Tracksperanto::Accumulator.new
|
16
|
-
50_000.times { a.push("A string" => rand) }
|
17
|
-
assert_equal 50_000, a.size
|
18
|
-
end
|
19
|
-
|
20
|
-
def test_accumulator_saves_shitload_of_objs
|
21
|
-
a = Tracksperanto::Accumulator.new
|
22
|
-
4.times { a.push("A \tstring") }
|
23
|
-
a.each {|e| assert_equal "A \tstring", e }
|
24
|
-
end
|
25
|
-
|
26
|
-
def test_accumulator_empty
|
27
|
-
a = Tracksperanto::Accumulator.new
|
28
|
-
assert a.empty?
|
29
|
-
a.push(1)
|
30
|
-
assert !a.empty?
|
31
|
-
end
|
32
|
-
|
33
|
-
def test_accumulator_supports_nested_iteration
|
34
|
-
a = Tracksperanto::Accumulator.new
|
35
|
-
("A".."Z").each{|e| a << e}
|
36
|
-
|
37
|
-
accumulated = []
|
38
|
-
seen_g = false
|
39
|
-
a.each do | first_level |
|
40
|
-
if first_level == "G"
|
41
|
-
seen_g = true
|
42
|
-
# Force a nested iteration and break it midway
|
43
|
-
a.each do | second_level |
|
44
|
-
accumulated.push(second_level)
|
45
|
-
break if second_level == "E"
|
46
|
-
end
|
47
|
-
elsif seen_g
|
48
|
-
assert_equal "H", first_level
|
49
|
-
return
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
def test_random_access
|
55
|
-
a = Tracksperanto::Accumulator.new
|
56
|
-
letters = ("A".."Z").map{|e| "#{e}\r\nWow!"}.to_a
|
57
|
-
letters.map(&a.method(:push))
|
58
|
-
|
59
|
-
assert_equal "B\r\nWow!", a[1]
|
60
|
-
assert_equal "E\r\nWow!", a[4]
|
61
|
-
end
|
62
|
-
|
63
|
-
def test_clear_calls_close_on_buffer
|
64
|
-
io = Tracksperanto::BufferIO.new
|
65
|
-
flexmock(io).should_receive(:close!)
|
66
|
-
flexmock(Tracksperanto::BufferIO).should_receive(:new).once.and_return(io)
|
67
|
-
|
68
|
-
a = Tracksperanto::Accumulator.new
|
69
|
-
40.times { a.push("A string" => rand) }
|
70
|
-
assert_equal 40, a.size
|
71
|
-
a.clear
|
72
|
-
assert_equal 0, a.size
|
73
|
-
end
|
74
|
-
end
|