tracksperanto 2.8.6 → 2.9.0
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/DEVELOPER_DOCS.rdoc +17 -5
- data/History.txt +8 -0
- data/README.rdoc +2 -0
- data/lib/export/base.rb +1 -0
- data/lib/export/boujou.rb +2 -1
- data/lib/export/equalizer3.rb +1 -0
- data/lib/export/equalizer4.rb +1 -0
- data/lib/export/flame_stabilizer.rb +1 -0
- data/lib/export/flame_stabilizer_cornerpin.rb +1 -0
- data/lib/export/match_mover.rb +2 -1
- data/lib/export/maya_live.rb +2 -1
- data/lib/export/mux.rb +1 -0
- data/lib/export/nuke_script.rb +2 -1
- data/lib/export/pfmatchit.rb +2 -1
- data/lib/export/pftrack.rb +2 -1
- data/lib/export/pftrack_5.rb +2 -1
- data/lib/export/ruby.rb +38 -0
- data/lib/export/shake_text.rb +2 -1
- data/lib/export/syntheyes.rb +1 -0
- data/lib/import/base.rb +2 -1
- data/lib/import/boujou.rb +2 -1
- data/lib/import/equalizer3.rb +2 -1
- data/lib/import/equalizer4.rb +2 -1
- data/lib/import/flame_stabilizer.rb +2 -1
- data/lib/import/match_mover.rb +3 -2
- data/lib/import/maya_live.rb +2 -1
- data/lib/import/nuke_grammar/utils.rb +2 -1
- data/lib/import/nuke_script.rb +2 -1
- data/lib/import/pftrack.rb +2 -1
- data/lib/import/shake_grammar/catcher.rb +2 -1
- data/lib/import/shake_grammar/lexer.rb +2 -1
- data/lib/import/shake_script.rb +2 -1
- data/lib/import/shake_text.rb +1 -0
- data/lib/import/syntheyes.rb +2 -1
- data/lib/middleware/base.rb +1 -0
- data/lib/middleware/crop.rb +2 -1
- data/lib/middleware/flip.rb +2 -1
- data/lib/middleware/flop.rb +2 -1
- data/lib/middleware/golden.rb +2 -1
- data/lib/middleware/length_cutoff.rb +2 -1
- data/lib/middleware/lerp.rb +2 -1
- data/lib/middleware/lint.rb +2 -1
- data/lib/middleware/pad.rb +2 -1
- data/lib/middleware/prefix.rb +2 -1
- data/lib/middleware/reformat.rb +2 -1
- data/lib/middleware/scaler.rb +2 -1
- data/lib/middleware/shift.rb +2 -1
- data/lib/middleware/slipper.rb +2 -1
- data/lib/middleware/start_trim.rb +2 -1
- data/lib/pipeline/base.rb +2 -1
- data/lib/tracksperanto/block_init.rb +1 -0
- data/lib/tracksperanto/buffer_io.rb +2 -1
- data/lib/tracksperanto/buffering_reader.rb +2 -1
- data/lib/tracksperanto/casts.rb +2 -1
- data/lib/tracksperanto/const_name.rb +2 -1
- data/lib/tracksperanto/ext_io.rb +2 -1
- data/lib/tracksperanto/format_detector.rb +2 -1
- data/lib/tracksperanto/keyframe.rb +4 -4
- data/lib/tracksperanto/returning.rb +2 -1
- data/lib/tracksperanto/safety.rb +2 -1
- data/lib/tracksperanto/simple_export.rb +1 -0
- data/lib/tracksperanto/tracker.rb +99 -15
- data/lib/tracksperanto/uv_coordinates.rb +2 -1
- data/lib/tracksperanto/zip_tuples.rb +2 -1
- data/lib/tracksperanto.rb +2 -1
- data/test/export/samples/ref_Mayalive.txt +36 -36
- data/test/export/samples/ref_Mayalive_CustomAspect.txt +36 -36
- data/test/export/samples/ref_Ruby.rb +54 -0
- data/test/export/samples/ref_boujou.txt +1 -0
- data/test/export/samples/ref_equalizer.txt +20 -20
- data/test/export/samples/ref_matchmover.rz2 +36 -36
- data/test/export/test_boujou_export.rb +2 -1
- data/test/export/test_equalizer3_export.rb +2 -1
- data/test/export/test_equalizer_export.rb +2 -3
- data/test/export/test_flame_stabilizer_cornerpin_export.rb +2 -1
- data/test/export/test_flame_stabilizer_export.rb +2 -1
- data/test/export/test_match_mover_export.rb +2 -1
- data/test/export/test_maya_live_export.rb +2 -1
- data/test/export/test_mux.rb +1 -0
- data/test/export/test_nuke_export.rb +2 -1
- data/test/export/test_pfmatchit_export.rb +2 -1
- data/test/export/test_pftrack5_export.rb +2 -1
- data/test/export/test_pftrack_export.rb +2 -1
- data/test/export/test_ruby_export.rb +17 -0
- data/test/export/test_shake_export.rb +2 -1
- data/test/export/test_syntheyes_export.rb +1 -0
- data/test/helper.rb +48 -54
- data/test/import/test_3de_import.rb +2 -1
- data/test/import/test_3de_import3.rb +2 -1
- data/test/import/test_boujou_import.rb +2 -1
- data/test/import/test_flame_import.rb +2 -1
- data/test/import/test_match_mover_import.rb +3 -1
- data/test/import/test_maya_live_import.rb +2 -1
- data/test/import/test_nuke_import.rb +2 -1
- data/test/import/test_pftrack_import.rb +2 -1
- data/test/import/test_shake_catcher.rb +2 -1
- data/test/import/test_shake_lexer.rb +2 -1
- data/test/import/test_shake_script_import.rb +2 -1
- data/test/import/test_shake_text_import.rb +2 -1
- data/test/import/test_syntheyes_import.rb +2 -1
- data/test/middleware/test_crop_middleware.rb +2 -1
- data/test/middleware/test_flip_middleware.rb +2 -1
- data/test/middleware/test_flop_middleware.rb +1 -0
- data/test/middleware/test_golden_middleware.rb +2 -1
- data/test/middleware/test_length_cutoff_middleware.rb +2 -1
- data/test/middleware/test_lerp_middleware.rb +2 -1
- data/test/middleware/test_lint_middleware.rb +2 -1
- data/test/middleware/test_pad_middleware.rb +2 -1
- data/test/middleware/test_prefix.rb +2 -1
- data/test/middleware/test_reformat_middleware.rb +2 -1
- data/test/middleware/test_scaler_middleware.rb +2 -1
- data/test/middleware/test_shift_middleware.rb +2 -1
- data/test/middleware/test_slip_middleware.rb +2 -1
- data/test/middleware/test_start_trim_middleware.rb +2 -1
- data/test/test_buffer_io.rb +2 -1
- data/test/test_bufferingreader.rb +2 -1
- data/test/test_cli.rb +4 -2
- data/test/test_const_name.rb +2 -1
- data/test/test_extio.rb +2 -1
- data/test/test_format_detector.rb +2 -1
- data/test/test_keyframe.rb +15 -1
- data/test/test_pipeline.rb +2 -1
- data/test/test_simple_export.rb +2 -1
- data/test/test_tracker.rb +86 -12
- data/test/test_tracksperanto.rb +2 -1
- data/tracksperanto.gemspec +5 -2
- metadata +23 -20
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class Equalizer3ExportTestTest < Test::Unit::TestCase
|
|
@@ -21,4 +22,4 @@ class Equalizer3ExportTestTest < Test::Unit::TestCase
|
|
|
21
22
|
assert_equal "// 3DE Multiple Tracking Curves Export 2048 x 275 * 0 frames\n\n", out.string,
|
|
22
23
|
"Frame count should not bleed into width"
|
|
23
24
|
end
|
|
24
|
-
end
|
|
25
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class Equalizer4ExportTest < Test::Unit::TestCase
|
|
@@ -5,8 +6,6 @@ class Equalizer4ExportTest < Test::Unit::TestCase
|
|
|
5
6
|
P = File.dirname(__FILE__) + "/samples/ref_equalizer.txt"
|
|
6
7
|
|
|
7
8
|
def test_export_output_written
|
|
8
|
-
# This test might be failing due to different float rounding between platforms
|
|
9
|
-
# (currently fails on win ruby and jruby)
|
|
10
9
|
ensure_same_output Tracksperanto::Export::Equalizer4, P, "Please note this test might fail due to differences in float rounding between platforms"
|
|
11
10
|
end
|
|
12
11
|
|
|
@@ -14,4 +13,4 @@ class Equalizer4ExportTest < Test::Unit::TestCase
|
|
|
14
13
|
assert_equal "3de_v4.txt", Tracksperanto::Export::Equalizer4.desc_and_extension
|
|
15
14
|
assert_equal "3DE v4 point export .txt file", Tracksperanto::Export::Equalizer4.human_name
|
|
16
15
|
end
|
|
17
|
-
end
|
|
16
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class FlameStabilizerCornerpinExportTest < Test::Unit::TestCase
|
|
@@ -64,4 +65,4 @@ class FlameStabilizerCornerpinExportTest < Test::Unit::TestCase
|
|
|
64
65
|
|
|
65
66
|
assert_same_buffer(File.open(P3), s)
|
|
66
67
|
end
|
|
67
|
-
end
|
|
68
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class FlameStabilizerExportTestTest < Test::Unit::TestCase
|
|
@@ -14,4 +15,4 @@ class FlameStabilizerExportTestTest < Test::Unit::TestCase
|
|
|
14
15
|
assert_equal "flame.stabilizer", Tracksperanto::Export::FlameStabilizer.desc_and_extension
|
|
15
16
|
assert_equal "Flame/Smoke 2D Stabilizer setup", Tracksperanto::Export::FlameStabilizer.human_name
|
|
16
17
|
end
|
|
17
|
-
end
|
|
18
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class MatchmoverExportTest < Test::Unit::TestCase
|
|
@@ -22,4 +23,4 @@ class MatchmoverExportTest < Test::Unit::TestCase
|
|
|
22
23
|
o.string,
|
|
23
24
|
"The output width and height should be properly substituted"
|
|
24
25
|
end
|
|
25
|
-
end
|
|
26
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class MayaLiveExportTest < Test::Unit::TestCase
|
|
@@ -14,4 +15,4 @@ class MayaLiveExportTest < Test::Unit::TestCase
|
|
|
14
15
|
exporter.aspect = 1.78
|
|
15
16
|
end
|
|
16
17
|
end
|
|
17
|
-
end
|
|
18
|
+
end
|
data/test/export/test_mux.rb
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class PFMatchitExportTest < Test::Unit::TestCase
|
|
@@ -13,4 +14,4 @@ class PFMatchitExportTest < Test::Unit::TestCase
|
|
|
13
14
|
def test_export_output_written
|
|
14
15
|
ensure_same_output Tracksperanto::Export::PFMatchit, P
|
|
15
16
|
end
|
|
16
|
-
end
|
|
17
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class PFTrack5ExportTest < Test::Unit::TestCase
|
|
@@ -16,4 +17,4 @@ class PFTrack5ExportTest < Test::Unit::TestCase
|
|
|
16
17
|
def test_export_output_written
|
|
17
18
|
ensure_same_output Tracksperanto::Export::PFTrack5, P
|
|
18
19
|
end
|
|
19
|
-
end
|
|
20
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class PFTrackExportTest < Test::Unit::TestCase
|
|
@@ -16,4 +17,4 @@ class PFTrackExportTest < Test::Unit::TestCase
|
|
|
16
17
|
def test_export_output_written
|
|
17
18
|
ensure_same_output Tracksperanto::Export::PFTrack4, P
|
|
18
19
|
end
|
|
19
|
-
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
3
|
+
|
|
4
|
+
class RubyExportTest < Test::Unit::TestCase
|
|
5
|
+
include ParabolicTracks
|
|
6
|
+
P = File.dirname(__FILE__) + "/samples/ref_Ruby.rb"
|
|
7
|
+
|
|
8
|
+
def test_export_output_written
|
|
9
|
+
create_reference_output Tracksperanto::Export::Ruby, P
|
|
10
|
+
ensure_same_output Tracksperanto::Export::Ruby, P
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def test_exporter_meta
|
|
14
|
+
assert_equal "tracksperanto_ruby.rb", Tracksperanto::Export::Ruby.desc_and_extension
|
|
15
|
+
assert_equal "Bare Ruby code", Tracksperanto::Export::Ruby.human_name
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class ShakeTextExportTest < Test::Unit::TestCase
|
|
@@ -12,4 +13,4 @@ class ShakeTextExportTest < Test::Unit::TestCase
|
|
|
12
13
|
assert_equal "shake_trackers.txt", Tracksperanto::Export::ShakeText.desc_and_extension
|
|
13
14
|
assert_equal "Shake trackers in a .txt file (also usable with Nuke's CameraTracker)", Tracksperanto::Export::ShakeText.human_name
|
|
14
15
|
end
|
|
15
|
-
end
|
|
16
|
+
end
|
data/test/helper.rb
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require "rubygems"
|
|
2
3
|
require File.dirname(__FILE__) + '/../lib/tracksperanto' unless defined?(Tracksperanto)
|
|
3
4
|
require 'test/unit'
|
|
@@ -30,58 +31,53 @@ end
|
|
|
30
31
|
# The tracker residual will degrade linarly and wll be "good" at the first image, "medium" at the extreme
|
|
31
32
|
# and "bad" at end
|
|
32
33
|
module ParabolicTracks
|
|
33
|
-
x_uv_chain = [
|
|
34
|
-
-1.0, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0,
|
|
35
|
-
0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0
|
|
36
|
-
]
|
|
37
34
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
FIRST_TRACK = Tracksperanto::Tracker.new(:name => "Parabolic_1_from_top_left") do |t|
|
|
36
|
+
t.keyframe!(:frame => 0, :abs_x => 0.00000, :abs_y => 1080.00000, :residual => 0.00000)
|
|
37
|
+
t.keyframe!(:frame => 1, :abs_x => 96.00000, :abs_y => 874.80000, :residual => 0.04762)
|
|
38
|
+
t.keyframe!(:frame => 2, :abs_x => 192.00000, :abs_y => 691.20000, :residual => 0.09524)
|
|
39
|
+
t.keyframe!(:frame => 3, :abs_x => 288.00000, :abs_y => 529.20000, :residual => 0.14286)
|
|
40
|
+
t.keyframe!(:frame => 4, :abs_x => 384.00000, :abs_y => 388.80000, :residual => 0.19048)
|
|
41
|
+
t.keyframe!(:frame => 5, :abs_x => 480.00000, :abs_y => 270.00000, :residual => 0.23810)
|
|
42
|
+
t.keyframe!(:frame => 6, :abs_x => 576.00000, :abs_y => 172.80000, :residual => 0.28571)
|
|
43
|
+
t.keyframe!(:frame => 7, :abs_x => 672.00000, :abs_y => 97.20000, :residual => 0.33333)
|
|
44
|
+
t.keyframe!(:frame => 8, :abs_x => 768.00000, :abs_y => 43.20000, :residual => 0.38095)
|
|
45
|
+
t.keyframe!(:frame => 9, :abs_x => 864.00000, :abs_y => 10.80000, :residual => 0.42857)
|
|
46
|
+
t.keyframe!(:frame => 12, :abs_x => 1152.00000, :abs_y => 43.20000, :residual => 0.57143)
|
|
47
|
+
t.keyframe!(:frame => 13, :abs_x => 1248.00000, :abs_y => 97.20000, :residual => 0.61905)
|
|
48
|
+
t.keyframe!(:frame => 14, :abs_x => 1344.00000, :abs_y => 172.80000, :residual => 0.66667)
|
|
49
|
+
t.keyframe!(:frame => 15, :abs_x => 1440.00000, :abs_y => 270.00000, :residual => 0.71429)
|
|
50
|
+
t.keyframe!(:frame => 16, :abs_x => 1536.00000, :abs_y => 388.80000, :residual => 0.76190)
|
|
51
|
+
t.keyframe!(:frame => 17, :abs_x => 1632.00000, :abs_y => 529.20000, :residual => 0.80952)
|
|
52
|
+
t.keyframe!(:frame => 18, :abs_x => 1728.00000, :abs_y => 691.20000, :residual => 0.85714)
|
|
53
|
+
t.keyframe!(:frame => 19, :abs_x => 1824.00000, :abs_y => 874.80000, :residual => 0.90476)
|
|
54
|
+
t.keyframe!(:frame => 20, :abs_x => 1920.00000, :abs_y => 1080.00000, :residual => 0.95238)
|
|
42
55
|
end
|
|
43
56
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
(
|
|
57
|
+
SECOND_TRACK = Tracksperanto::Tracker.new(:name => "Parabolic_2_from_bottom_right") do |t|
|
|
58
|
+
t.keyframe!(:frame => 0, :abs_x => 1920.00000, :abs_y => 0.00000, :residual => 0.00000)
|
|
59
|
+
t.keyframe!(:frame => 1, :abs_x => 1824.00000, :abs_y => 205.20000, :residual => 0.04762)
|
|
60
|
+
t.keyframe!(:frame => 2, :abs_x => 1728.00000, :abs_y => 388.80000, :residual => 0.09524)
|
|
61
|
+
t.keyframe!(:frame => 3, :abs_x => 1632.00000, :abs_y => 550.80000, :residual => 0.14286)
|
|
62
|
+
t.keyframe!(:frame => 4, :abs_x => 1536.00000, :abs_y => 691.20000, :residual => 0.19048)
|
|
63
|
+
t.keyframe!(:frame => 5, :abs_x => 1440.00000, :abs_y => 810.00000, :residual => 0.23810)
|
|
64
|
+
t.keyframe!(:frame => 6, :abs_x => 1344.00000, :abs_y => 907.20000, :residual => 0.28571)
|
|
65
|
+
t.keyframe!(:frame => 7, :abs_x => 1248.00000, :abs_y => 982.80000, :residual => 0.33333)
|
|
66
|
+
t.keyframe!(:frame => 8, :abs_x => 1152.00000, :abs_y => 1036.80000, :residual => 0.38095)
|
|
67
|
+
t.keyframe!(:frame => 9, :abs_x => 1056.00000, :abs_y => 1069.20000, :residual => 0.42857)
|
|
68
|
+
t.keyframe!(:frame => 12, :abs_x => 768.00000, :abs_y => 1036.80000, :residual => 0.57143)
|
|
69
|
+
t.keyframe!(:frame => 13, :abs_x => 672.00000, :abs_y => 982.80000, :residual => 0.61905)
|
|
70
|
+
t.keyframe!(:frame => 14, :abs_x => 576.00000, :abs_y => 907.20000, :residual => 0.66667)
|
|
71
|
+
t.keyframe!(:frame => 15, :abs_x => 480.00000, :abs_y => 810.00000, :residual => 0.71429)
|
|
72
|
+
t.keyframe!(:frame => 16, :abs_x => 384.00000, :abs_y => 691.20000, :residual => 0.76190)
|
|
73
|
+
t.keyframe!(:frame => 17, :abs_x => 288.00000, :abs_y => 550.80000, :residual => 0.80952)
|
|
74
|
+
t.keyframe!(:frame => 18, :abs_x => 192.00000, :abs_y => 388.80000, :residual => 0.85714)
|
|
75
|
+
t.keyframe!(:frame => 19, :abs_x => 96.00000, :abs_y => 205.20000, :residual => 0.90476)
|
|
76
|
+
t.keyframe!(:frame => 20, :abs_x => 0.00000, :abs_y => 0.00000, :residual => 0.95238)
|
|
47
77
|
end
|
|
48
78
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
tuples_for_tracker_2 = tuples_for_tracker_1.map do | tuple |
|
|
54
|
-
[tuple[0], tuple[1], (tuple[2] * -1) + 1]
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
tuples_for_tracker_2.reverse!
|
|
58
|
-
tuples_for_tracker_2.each_with_index do | t, i |
|
|
59
|
-
t[0] = i
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
residual_unit = 1.0 / x_uv_chain.length
|
|
63
|
-
|
|
64
|
-
SKIPS = [10,11]
|
|
65
|
-
FIRST_TRACK = Tracksperanto::Tracker.new(:name => "Parabolic_1_from_top_left") do | t |
|
|
66
|
-
tuples_for_tracker_1.each do | (f, x, y )|
|
|
67
|
-
ax, ay = uv_to_abs(x, y, 1920, 1080)
|
|
68
|
-
unless SKIPS.include?(f)
|
|
69
|
-
t.keyframe!(:frame => f, :abs_x => ax, :abs_y => ay, :residual => (f * residual_unit))
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
SECOND_TRACK = Tracksperanto::Tracker.new(:name => "Parabolic_2_from_bottom_right") do | t |
|
|
75
|
-
tuples_for_tracker_2.each do | (f, x, y )|
|
|
76
|
-
ax, ay = uv_to_abs(x, y, 1920, 1080)
|
|
77
|
-
unless SKIPS.include?(f)
|
|
78
|
-
t.keyframe!(:frame => f, :abs_x => ax, :abs_y => ay, :residual => (f * residual_unit))
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
SINGLE_FRAME_TRACK = Tracksperanto::Tracker.new(:name => "SingleFrame") do | t |
|
|
84
|
-
t.keyframe! :frame => 0, :abs_x => (1920/2) + 10, :abs_y => (1080/2)+10, :residual => 0
|
|
79
|
+
SINGLE_FRAME_TRACK = Tracksperanto::Tracker.new(:name => "SingleFrame") do |t|
|
|
80
|
+
t.keyframe!(:frame => 0, :abs_x => 970.00000, :abs_y => 550.00000, :residual => 0.00000)
|
|
85
81
|
end
|
|
86
82
|
|
|
87
83
|
def create_reference_output(exporter_klass, ref_path)
|
|
@@ -94,12 +90,10 @@ module ParabolicTracks
|
|
|
94
90
|
|
|
95
91
|
def assert_same_buffer(ref_buffer, actual_buffer, message = "The line should be identical")
|
|
96
92
|
[ref_buffer, actual_buffer].each{|io| io.rewind }
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
assert_equal reference_line, output_line, "Line #{at_line} - #{message}"
|
|
102
|
-
end
|
|
93
|
+
|
|
94
|
+
# There are subtle differences in how IO is handled on dfferent platforms (Darwin)
|
|
95
|
+
ref_buffer, actual_buffer = ref_buffer.read, actual_buffer.read
|
|
96
|
+
assert_equal ref_buffer, actual_buffer
|
|
103
97
|
end
|
|
104
98
|
|
|
105
99
|
def ensure_same_output(exporter_klass, reference_path, message = "The line should be identical")
|
|
@@ -122,4 +116,4 @@ module ParabolicTracks
|
|
|
122
116
|
end
|
|
123
117
|
exporter.end_export
|
|
124
118
|
end
|
|
125
|
-
end unless defined?(ParabolicTracks)
|
|
119
|
+
end unless defined?(ParabolicTracks)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class EqualizerImportTest < Test::Unit::TestCase
|
|
@@ -25,4 +26,4 @@ class EqualizerImportTest < Test::Unit::TestCase
|
|
|
25
26
|
assert_in_delta 232.449011732690479, first_kf.abs_y, DELTA
|
|
26
27
|
assert_equal 39, first_kf.frame
|
|
27
28
|
end
|
|
28
|
-
end
|
|
29
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class Equalizer3ImportTest < Test::Unit::TestCase
|
|
@@ -29,4 +30,4 @@ class Equalizer3ImportTest < Test::Unit::TestCase
|
|
|
29
30
|
assert_in_delta 71.7889, first_kf.abs_x, DELTA
|
|
30
31
|
assert_in_delta 481.708, first_kf.abs_y, DELTA
|
|
31
32
|
end
|
|
32
|
-
end
|
|
33
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class BoujouImportTest < Test::Unit::TestCase
|
|
@@ -26,4 +27,4 @@ class BoujouImportTest < Test::Unit::TestCase
|
|
|
26
27
|
assert_in_delta 306.906, kf.abs_x, DELTA
|
|
27
28
|
assert_in_delta 40.79, kf.abs_y, DELTA
|
|
28
29
|
end
|
|
29
|
-
end
|
|
30
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class FlameImportTest < Test::Unit::TestCase
|
|
@@ -108,4 +109,4 @@ class FlameImportTest < Test::Unit::TestCase
|
|
|
108
109
|
assert_equal "bottom_right", trackers[-1].name
|
|
109
110
|
end
|
|
110
111
|
|
|
111
|
-
end
|
|
112
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class MatchMoverImportTest < Test::Unit::TestCase
|
|
@@ -17,6 +18,7 @@ class MatchMoverImportTest < Test::Unit::TestCase
|
|
|
17
18
|
|
|
18
19
|
parser = Tracksperanto::Import::MatchMover.new(:io => fixture)
|
|
19
20
|
trackers = parser.to_a
|
|
21
|
+
assert_not_equal 0, trackers[0].length
|
|
20
22
|
assert_equal 0, trackers[0][0].frame, "Should have offset the first frame to 0"
|
|
21
23
|
end
|
|
22
24
|
|
|
@@ -48,4 +50,4 @@ class MatchMoverImportTest < Test::Unit::TestCase
|
|
|
48
50
|
assert_in_delta 0.027457, last_kf.residual, DELTA
|
|
49
51
|
end
|
|
50
52
|
|
|
51
|
-
end
|
|
53
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class MayaLiveImportTest < Test::Unit::TestCase
|
|
@@ -54,4 +55,4 @@ class MayaLiveImportTest < Test::Unit::TestCase
|
|
|
54
55
|
assert_in_delta 305.141, first_kf.abs_x, DELTA
|
|
55
56
|
assert_in_delta 513.346, first_kf.abs_y, DELTA
|
|
56
57
|
end
|
|
57
|
-
end
|
|
58
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class NukeImportTest < Test::Unit::TestCase
|
|
@@ -111,4 +112,4 @@ x754 912.0731812 x755 913.7190552 916.0959473 918.1025391 920.0751953 922.189880
|
|
|
111
112
|
result = Tracksperanto::Import::NukeScript.new(:io => StringIO.new).send(:zip_curve_tuples, tuples_x, tuples_y)
|
|
112
113
|
assert_equal [[3, 234, 123], [9, 876, 430]], result
|
|
113
114
|
end
|
|
114
|
-
end
|
|
115
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class PFTrackImportTest < Test::Unit::TestCase
|
|
@@ -91,4 +92,4 @@ class PFTrackImportTest < Test::Unit::TestCase
|
|
|
91
92
|
assert_equal "Auto_00021_Primary", acc[20].name
|
|
92
93
|
assert_equal 0, acc[20].length
|
|
93
94
|
end
|
|
94
|
-
end
|
|
95
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class ShakeCatcherTest < Test::Unit::TestCase
|
|
@@ -82,4 +83,4 @@ class ShakeCatcherTest < Test::Unit::TestCase
|
|
|
82
83
|
s = StringIO.new(s) unless s.respond_to?(:read)
|
|
83
84
|
klass.new(s).stack
|
|
84
85
|
end
|
|
85
|
-
end
|
|
86
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class ShakeLexerTest < Test::Unit::TestCase
|
|
@@ -201,4 +202,4 @@ class ShakeLexerTest < Test::Unit::TestCase
|
|
|
201
202
|
s = StringIO.new(s) unless s.respond_to?(:read)
|
|
202
203
|
klass.new(s).stack
|
|
203
204
|
end
|
|
204
|
-
end
|
|
205
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class ShakeScriptImportTest < Test::Unit::TestCase
|
|
@@ -146,4 +147,4 @@ class ShakeScriptImportTest < Test::Unit::TestCase
|
|
|
146
147
|
assert_equal "Camera01Trackers_Tracker8", trackers[0].name
|
|
147
148
|
|
|
148
149
|
end
|
|
149
|
-
end
|
|
150
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class ShakeTextImportTest < Test::Unit::TestCase
|
|
@@ -68,4 +69,4 @@ class ShakeTextImportTest < Test::Unit::TestCase
|
|
|
68
69
|
t2 = trackers[-1]
|
|
69
70
|
assert_equal "autotrack260", t2.name
|
|
70
71
|
end
|
|
71
|
-
end
|
|
72
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class SyntheyesImportTest < Test::Unit::TestCase
|
|
@@ -46,4 +47,4 @@ class SyntheyesImportTest < Test::Unit::TestCase
|
|
|
46
47
|
|
|
47
48
|
assert_equal 26, trackers.length
|
|
48
49
|
end
|
|
49
|
-
end
|
|
50
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class FlipMiddlewareTest < Test::Unit::TestCase
|
|
@@ -30,4 +31,4 @@ class FlipMiddlewareTest < Test::Unit::TestCase
|
|
|
30
31
|
m.start_export(110, 120)
|
|
31
32
|
m.export_point(1, 10, 95, 0)
|
|
32
33
|
end
|
|
33
|
-
end
|
|
34
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class GoldenMiddlewareTest < Test::Unit::TestCase
|
|
@@ -29,4 +30,4 @@ class GoldenMiddlewareTest < Test::Unit::TestCase
|
|
|
29
30
|
m.end_tracker_segment
|
|
30
31
|
m.end_export
|
|
31
32
|
end
|
|
32
|
-
end
|
|
33
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class LengthCutoffMiddlewareTest < Test::Unit::TestCase
|
|
@@ -35,4 +36,4 @@ class LengthCutoffMiddlewareTest < Test::Unit::TestCase
|
|
|
35
36
|
m.end_export
|
|
36
37
|
|
|
37
38
|
end
|
|
38
|
-
end
|
|
39
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class PrefixMiddlewareTest < Test::Unit::TestCase
|
|
@@ -24,4 +25,4 @@ class PrefixMiddlewareTest < Test::Unit::TestCase
|
|
|
24
25
|
m.start_tracker_segment("Tracker")
|
|
25
26
|
end
|
|
26
27
|
|
|
27
|
-
end
|
|
28
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class ReformatMiddlewareTest < Test::Unit::TestCase
|
|
@@ -32,4 +33,4 @@ class ReformatMiddlewareTest < Test::Unit::TestCase
|
|
|
32
33
|
m.start_export(720, 576)
|
|
33
34
|
m.end_export
|
|
34
35
|
end
|
|
35
|
-
end
|
|
36
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class ScalerMiddlewareTest < Test::Unit::TestCase
|
|
@@ -58,4 +59,4 @@ class ScalerMiddlewareTest < Test::Unit::TestCase
|
|
|
58
59
|
m.end_tracker_segment
|
|
59
60
|
m.end_export
|
|
60
61
|
end
|
|
61
|
-
end
|
|
62
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
2
3
|
|
|
3
4
|
class SlipMiddlewareTest < Test::Unit::TestCase
|
|
@@ -28,4 +29,4 @@ class SlipMiddlewareTest < Test::Unit::TestCase
|
|
|
28
29
|
m.end_tracker_segment
|
|
29
30
|
m.end_export
|
|
30
31
|
end
|
|
31
|
-
end
|
|
32
|
+
end
|
data/test/test_buffer_io.rb
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
|
2
3
|
|
|
3
4
|
class TestBufferIO < Test::Unit::TestCase
|
|
@@ -30,4 +31,4 @@ class TestBufferIO < Test::Unit::TestCase
|
|
|
30
31
|
assert_equal 3000, f.pos
|
|
31
32
|
assert f.file_backed?
|
|
32
33
|
end
|
|
33
|
-
end
|
|
34
|
+
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
1
2
|
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
|
2
3
|
|
|
3
4
|
class TestBufferingReader < Test::Unit::TestCase
|
|
@@ -44,4 +45,4 @@ class TestBufferingReader < Test::Unit::TestCase
|
|
|
44
45
|
s.length.times { reader.read_one_byte }
|
|
45
46
|
assert reader.data_exhausted?
|
|
46
47
|
end
|
|
47
|
-
end
|
|
48
|
+
end
|