tracksperanto 1.8.2 → 1.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -1,3 +1,11 @@
1
+ === 1.8.4 / 2010-03-10
2
+
3
+ * Fix PFTrack imports neglecting the feature name if it only contained digits
4
+
5
+ === 1.8.3 / 2010-03-04
6
+
7
+ * Fix faulty remaining trackers report being sent from the pipeline
8
+
1
9
  === 1.8.2 / 2010-03-04
2
10
 
3
11
  * Fix the bug in the Flame exporter that was convincing Flame that there is only one tracker in the setup
data/Manifest.txt CHANGED
@@ -94,6 +94,7 @@ test/import/samples/nuke/one_tracker_with_break_in_grp.nk
94
94
  test/import/samples/nuke/tracker_with_differing_gaps.nk
95
95
  test/import/samples/nuke/tracker_with_repeating_gaps.nk
96
96
  test/import/samples/pftrack4/sourcefile_pftrack.2dt
97
+ test/import/samples/pftrack5/apft.2dt
97
98
  test/import/samples/pftrack5/garage.2dt
98
99
  test/import/samples/shake_script/four_tracks_in_one_matchmove.shk
99
100
  test/import/samples/shake_script/four_tracks_in_one_stabilizer.shk
@@ -7,7 +7,7 @@ class Tracksperanto::Import::PFTrack < Tracksperanto::Import::Base
7
7
  ".2dt"
8
8
  end
9
9
 
10
- CHARACTERS = /[AZaz]/
10
+ CHARACTERS_OR_QUOTES = /[AZaz"]/
11
11
 
12
12
  def parse(io)
13
13
  trackers = []
@@ -15,7 +15,7 @@ class Tracksperanto::Import::PFTrack < Tracksperanto::Import::Base
15
15
  line = io.gets
16
16
  next if (!line || line =~ /^#/)
17
17
 
18
- if line =~ CHARACTERS # Tracker with a name
18
+ if line =~ CHARACTERS_OR_QUOTES # Tracker with a name
19
19
  t = Tracksperanto::Tracker.new{|t| t.name = line.strip.gsub(/"/, '') }
20
20
  report_progress("Reading tracker #{t.name}")
21
21
  parse_tracker(t, io)
@@ -30,16 +30,15 @@ class Tracksperanto::Import::PFTrack < Tracksperanto::Import::Base
30
30
  def parse_tracker(t, io)
31
31
  first_tracker_line = io.gets.chomp
32
32
 
33
- if first_tracker_line =~ CHARACTERS # PFTrack version 5 format
33
+ if first_tracker_line =~ CHARACTERS_OR_QUOTES # PFTrack version 5 format
34
34
  first_tracker_line = io.gets.chomp
35
35
  end
36
36
 
37
37
  num_of_keyframes = first_tracker_line.to_i
38
38
  t.keyframes = (1..num_of_keyframes).map do | keyframe_idx |
39
39
  report_progress("Reading keyframe #{keyframe_idx} of #{num_of_keyframes} in #{t.name}")
40
- Tracksperanto::Keyframe.new do |k|
41
- k.frame, k.abs_x, k.abs_y, k.residual = io.gets.chomp.split
42
- end
40
+ f, x, y, residual = io.gets.chomp.split
41
+ Tracksperanto::Keyframe.new(:frame => f, :abs_x => x, :abs_y => y, :residual => residual.to_f * 8)
43
42
  end
44
43
  end
45
44
  end
data/lib/pipeline/base.rb CHANGED
@@ -114,14 +114,14 @@ class Tracksperanto::Pipeline::Base
114
114
 
115
115
  # Use the width and height provided by the parser itself
116
116
  processor.start_export(parser.width, parser.height)
117
- trackers.each do | t |
117
+ trackers.each_with_index do | t, tracker_idx |
118
118
  kf_weight = percent_per_tracker / t.keyframes.length
119
119
  points += 1
120
120
  processor.start_tracker_segment(t.name)
121
121
  t.each_with_index do | kf, idx |
122
122
  keyframes += 1
123
123
  processor.export_point(kf.frame, kf.abs_x, kf.abs_y, kf.residual)
124
- report_progress(percent_complete += kf_weight, "Writing keyframe #{idx+1} of #{t.name.inspect}, #{trackers.length - idx + 1} trackers to go")
124
+ report_progress(percent_complete += kf_weight, "Writing keyframe #{idx+1} of #{t.name.inspect}, #{trackers.length - tracker_idx} trackers to go")
125
125
  end
126
126
  processor.end_tracker_segment
127
127
  end
data/lib/tracksperanto.rb CHANGED
@@ -4,7 +4,7 @@ require 'tempfile'
4
4
 
5
5
  module Tracksperanto
6
6
  PATH = File.expand_path(File.dirname(__FILE__))
7
- VERSION = '1.8.2'
7
+ VERSION = '1.8.4'
8
8
 
9
9
  module Import; end
10
10
  module Export; end
@@ -25,6 +25,6 @@ class Tracksperanto::Keyframe
25
25
  cast_to_int :frame
26
26
 
27
27
  def inspect
28
- [frame, abs_x, abs_y].inspect
28
+ '#< %.1fx%.1f @%d ~%.2f) >' % [abs_x, abs_y, frame, residual]
29
29
  end
30
30
  end
@@ -12,4 +12,6 @@ that the export works
12
12
  The current test set consists of the two parabolic curves that cross. The second
13
13
  parabolic curve goes left, the first one - right, and they start at opposite
14
14
  corners of the reference 1920x1080 export. At the first point the track has the residual of 0,
15
- at the end of the curve - the biggest residual (PFTrack marks it red exactly at the last keyframe)
15
+ at the end of the curve - the biggest residual (PFTrack marks it red exactly at the last keyframe).
16
+
17
+ In the middle of the curves a couple of keyframes is skipped to verify that proper gaps are written into the export.
@@ -0,0 +1,164 @@
1
+
2
+
3
+ "Tracker642"
4
+ "Primary"
5
+ 1
6
+ 0 960.000 540.000 0.000
7
+
8
+
9
+ "1015"
10
+ "Primary"
11
+ 47
12
+ 627 634787.520 540.000 0.000
13
+ 598 404869.440 540.000 0.000
14
+ 1790 695366.400 540.000 0.000
15
+ 1222 345650.880 540.000 0.000
16
+ 1722 666293.760 540.000 0.000
17
+ 1737 458792.640 540.000 0.000
18
+ 1692 549895.680 540.000 0.000
19
+ 746 309381.120 540.000 0.000
20
+ 1600 462813.120 540.000 0.000
21
+ 1479 587490.240 540.000 0.000
22
+ 1579 569565.120 540.000 0.000
23
+ 975 542779.200 540.000 0.000
24
+ 1574 361905.600 540.000 0.000
25
+ 974 425121.600 540.000 0.000
26
+ 890 493438.080 540.000 0.000
27
+ 1385 566458.560 540.000 0.000
28
+ 1177 457404.480 540.000 0.000
29
+ 1237 537648.960 540.000 0.000
30
+ 1158 553352.640 540.000 0.000
31
+ 798 616415.040 540.000 0.000
32
+ 1090 401705.280 540.000 0.000
33
+ 1419 456401.280 540.000 0.000
34
+ 1767 359904.960 540.000 0.000
35
+ 512 518300.160 540.000 0.000
36
+ 226 269332.800 540.000 0.000
37
+ 1181 422601.600 540.000 0.000
38
+ 634 615336.960 540.000 0.000
39
+ 550 381297.600 540.000 0.000
40
+ 679 420613.440 540.000 0.000
41
+ 1866 411394.560 540.000 0.000
42
+ 331 393144.000 540.000 0.000
43
+ 296 318039.360 540.000 0.000
44
+ 1111 692649.600 540.000 0.000
45
+ 465 807576.960 540.000 0.000
46
+ 700 542585.280 540.000 0.000
47
+ 450 308083.200 540.000 0.000
48
+ 1539 695838.720 540.000 0.000
49
+ 1031 311478.720 540.000 0.000
50
+ 111 335403.840 540.000 0.000
51
+ 1838 379365.120 540.000 0.000
52
+ 114 422162.880 540.000 0.000
53
+ 1337 418574.400 540.000 0.000
54
+ 798 679393.920 540.000 0.000
55
+ 1385 446021.760 540.000 0.000
56
+ 1477 417858.240 540.000 0.000
57
+ 1319 369624.960 540.000 0.000
58
+ 526 230364.480 540.000 0.000
59
+
60
+
61
+ "1016"
62
+ "Primary"
63
+ 47
64
+ 627 633088.320 540.000 0.000
65
+ 599 403931.520 540.000 0.000
66
+ 1790 694467.840 540.000 0.000
67
+ 1219 344287.680 540.000 0.000
68
+ 1723 665443.200 540.000 0.000
69
+ 1738 457272.000 540.000 0.000
70
+ 1693 548859.840 540.000 0.000
71
+ 741 308281.920 540.000 0.000
72
+ 1602 461737.920 540.000 0.000
73
+ 1481 587155.200 540.000 0.000
74
+ 1584 568606.080 540.000 0.000
75
+ 979 541856.640 540.000 0.000
76
+ 1572 360683.520 540.000 0.000
77
+ 974 423989.760 540.000 0.000
78
+ 893 492331.200 540.000 0.000
79
+ 1389 565269.120 540.000 0.000
80
+ 1179 456397.440 540.000 0.000
81
+ 1240 536472.960 540.000 0.000
82
+ 1162 552674.880 540.000 0.000
83
+ 800 615031.680 540.000 0.000
84
+ 1089 400654.080 540.000 0.000
85
+ 1421 454997.760 540.000 0.000
86
+ 1765 358397.760 540.000 0.000
87
+ 516 516946.560 540.000 0.000
88
+ 221 268580.160 540.000 0.000
89
+ 1182 421466.880 540.000 0.000
90
+ 634 613612.800 540.000 0.000
91
+ 549 380370.240 540.000 0.000
92
+ 680 419506.560 540.000 0.000
93
+ 1867 410216.640 540.000 0.000
94
+ 332 392214.720 540.000 0.000
95
+ 294 317141.760 540.000 0.000
96
+ 1111 691561.920 540.000 0.000
97
+ 458 805003.200 540.000 0.000
98
+ 704 541032.000 540.000 0.000
99
+ 446 307290.240 540.000 0.000
100
+ 1539 694626.240 540.000 0.000
101
+ 1026 310107.840 540.000 0.000
102
+ 111 334769.280 540.000 0.000
103
+ 1836 378210.240 540.000 0.000
104
+ 118 421490.880 540.000 0.000
105
+ 1338 417417.600 540.000 0.000
106
+ 798 677185.920 540.000 0.000
107
+ 1386 444137.280 540.000 0.000
108
+ 1477 416895.360 540.000 0.000
109
+ 1316 368661.120 540.000 0.000
110
+ 518 229589.760 540.000 0.000
111
+
112
+
113
+ "1017"
114
+ "Primary"
115
+ 47
116
+ 628 632196.480 540.000 0.000
117
+ 599 403390.080 540.000 0.000
118
+ 1791 693854.400 540.000 0.000
119
+ 1215 343394.880 540.000 0.000
120
+ 1724 665085.120 540.000 0.000
121
+ 1739 456325.440 540.000 0.000
122
+ 1695 547992.000 540.000 0.000
123
+ 736 307735.680 540.000 0.000
124
+ 1604 460881.600 540.000 0.000
125
+ 1485 585576.960 540.000 0.000
126
+ 1588 567917.760 540.000 0.000
127
+ 982 541071.360 540.000 0.000
128
+ 1569 359643.840 540.000 0.000
129
+ 975 423533.760 540.000 0.000
130
+ 897 491707.200 540.000 0.000
131
+ 1393 564915.840 540.000 0.000
132
+ 1181 455552.640 540.000 0.000
133
+ 1244 536135.040 540.000 0.000
134
+ 1166 551876.160 540.000 0.000
135
+ 803 614599.680 540.000 0.000
136
+ 1088 399793.920 540.000 0.000
137
+ 1423 454463.040 540.000 0.000
138
+ 1762 357255.360 540.000 0.000
139
+ 520 516820.800 540.000 0.000
140
+ 217 268415.040 540.000 0.000
141
+ 1182 420693.120 540.000 0.000
142
+ 634 612735.360 540.000 0.000
143
+ 549 379905.600 540.000 0.000
144
+ 682 418885.440 540.000 0.000
145
+ 1867 409008.960 540.000 0.000
146
+ 334 391773.120 540.000 0.000
147
+ 291 316947.840 540.000 0.000
148
+ 1112 690716.160 540.000 0.000
149
+ 451 803757.120 540.000 0.000
150
+ 708 540460.800 540.000 0.000
151
+ 443 306330.240 540.000 0.000
152
+ 1540 695179.200 540.000 0.000
153
+ 1021 309685.440 540.000 0.000
154
+ 111 334526.400 540.000 0.000
155
+ 1835 377040.960 540.000 0.000
156
+ 123 421139.520 540.000 0.000
157
+ 1338 416226.240 540.000 0.000
158
+ 799 676389.120 540.000 0.000
159
+ 1388 444029.760 540.000 0.000
160
+ 1477 416146.560 540.000 0.000
161
+ 1314 367810.560 540.000 0.000
162
+ 510 229207.680 540.000 0.000
163
+
164
+
@@ -9,6 +9,16 @@ class PFTrackImportTest < Test::Unit::TestCase
9
9
  assert !i.autodetects_size?
10
10
  end
11
11
 
12
+ def test_parsing_from_pftrack5_second_file
13
+ fixture = File.open(File.dirname(__FILE__) + '/samples/pftrack5/apft.2dt')
14
+ parser = Tracksperanto::Import::PFTrack.new(:width => 1920, :height => 1080)
15
+
16
+ trackers = parser.parse(fixture)
17
+ assert_equal 4, trackers.length
18
+ second_tracker = trackers[1]
19
+ assert_equal "1015", second_tracker.name
20
+ end
21
+
12
22
  def test_parsing_from_importable_pftrack_4
13
23
 
14
24
  fixture = File.open(File.dirname(__FILE__) + '/samples/pftrack4/sourcefile_pftrack.2dt')
@@ -15,7 +15,7 @@ class KeyframeTest < Test::Unit::TestCase
15
15
 
16
16
  def test_inspect
17
17
  kf = Tracksperanto::Keyframe.new(:frame => 0, :abs_x => 10, :abs_y => 12.0)
18
- assert_equal "[0, 10.0, 12.0]", kf.inspect
18
+ assert_equal "#< 10.0x12.0 @0 ~0.00) >", kf.inspect
19
19
  end
20
20
 
21
21
  def test_frame_translated_to_int
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tracksperanto
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.2
4
+ version: 1.8.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julik Tarkhanov
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-03-04 00:00:00 +01:00
12
+ date: 2010-03-10 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -141,6 +141,7 @@ files:
141
141
  - test/import/samples/nuke/tracker_with_differing_gaps.nk
142
142
  - test/import/samples/nuke/tracker_with_repeating_gaps.nk
143
143
  - test/import/samples/pftrack4/sourcefile_pftrack.2dt
144
+ - test/import/samples/pftrack5/apft.2dt
144
145
  - test/import/samples/pftrack5/garage.2dt
145
146
  - test/import/samples/shake_script/four_tracks_in_one_matchmove.shk
146
147
  - test/import/samples/shake_script/four_tracks_in_one_stabilizer.shk