tracksperanto 4.1.2 → 4.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/tracksperanto/version.rb +1 -1
- data/test/HELP_WHY_TESTS_ARE_EMPTY.md +8 -0
- data/tracksperanto.gemspec +2 -4
- metadata +4 -179
- data/test/export/README_EXPORT_TESTS.txt +0 -24
- data/test/export/samples/ref_AfterEffects.jsx +0 -70
- data/test/export/samples/ref_FlameProperlyReorderedCornerpin.stabilizer +0 -1946
- data/test/export/samples/ref_FlameSimpleReorderedCornerpin.stabilizer +0 -1946
- data/test/export/samples/ref_Maxscript.ms +0 -93
- data/test/export/samples/ref_MayaLocators.ma +0 -90
- data/test/export/samples/ref_Mayalive.txt +0 -43
- data/test/export/samples/ref_Mayalive_CustomAspect.txt +0 -43
- data/test/export/samples/ref_NukeCameraTrackerUsertracks.txt +0 -48
- data/test/export/samples/ref_NukeScript.nk +0 -37
- data/test/export/samples/ref_PFMatchit.2dt +0 -54
- data/test/export/samples/ref_PFTrack.2dt +0 -51
- data/test/export/samples/ref_PFTrack5.2dt +0 -54
- data/test/export/samples/ref_Ruby.rb +0 -54
- data/test/export/samples/ref_ShakeText.txt +0 -48
- data/test/export/samples/ref_Syntheyes.txt +0 -39
- data/test/export/samples/ref_XSI.py +0 -102
- data/test/export/samples/ref_boujou.txt +0 -44
- data/test/export/samples/ref_equalizer.txt +0 -49
- data/test/export/samples/ref_equalizer3.txt +0 -44
- data/test/export/samples/ref_flame.stabilizer +0 -962
- data/test/export/samples/ref_flameCornerpin.stabilizer +0 -962
- data/test/export/samples/ref_flame_2014.stabilizer +0 -893
- data/test/export/samples/ref_flame_2014_cornerpin.stabilizer +0 -1422
- data/test/export/samples/ref_matchmover.rz2 +0 -52
- data/test/export/test_ae_export.rb +0 -16
- data/test/export/test_boujou_export.rb +0 -17
- data/test/export/test_equalizer3_export.rb +0 -24
- data/test/export/test_equalizer_export.rb +0 -15
- data/test/export/test_flame_stabilizer_2014_cornerpin_export.rb +0 -33
- data/test/export/test_flame_stabilizer_2014_export.rb +0 -17
- data/test/export/test_flame_stabilizer_cornerpin_export.rb +0 -71
- data/test/export/test_flame_stabilizer_export.rb +0 -17
- data/test/export/test_match_mover_export.rb +0 -25
- data/test/export/test_maxscript.rb +0 -16
- data/test/export/test_maya_live_export.rb +0 -17
- data/test/export/test_maya_locators_export.rb +0 -16
- data/test/export/test_mux.rb +0 -23
- data/test/export/test_nuke_camtracker_export.rb +0 -15
- data/test/export/test_nuke_export.rb +0 -45
- data/test/export/test_pfmatchit_export.rb +0 -16
- data/test/export/test_pftrack5_export.rb +0 -19
- data/test/export/test_pftrack_export.rb +0 -19
- data/test/export/test_ruby_export.rb +0 -15
- data/test/export/test_shake_export.rb +0 -15
- data/test/export/test_syntheyes_export.rb +0 -15
- data/test/export/test_xsi_python_export.rb +0 -16
- data/test/helper.rb +0 -153
- data/test/import/README.rdoc +0 -10
- data/test/import/samples/3de_v3/3de_export_v3.txt +0 -2203
- data/test/import/samples/3de_v4/3de_export_cube.txt +0 -726
- data/test/import/samples/3de_v4/FB1880_man_v05.txt +0 -2402
- data/test/import/samples/boujou_features_text/boujou_txt_export.txt +0 -2885
- data/test/import/samples/flame_stabilizer/FlameStab_Cornerpin_CorrectOrder.stabilizer +0 -2758
- data/test/import/samples/flame_stabilizer/FlameStab_Cornerpin_IncorrectOrder.stabilizer +0 -2758
- data/test/import/samples/flame_stabilizer/Flame_Stabilizer_2012.stabilizer +0 -6954
- data/test/import/samples/flame_stabilizer/cornerpin_2012.stabilizer +0 -20958
- data/test/import/samples/flame_stabilizer/flame2010_cornerpin.stabilizer +0 -10792
- data/test/import/samples/flame_stabilizer/flame_2012_another.stabilizer +0 -2290
- data/test/import/samples/flame_stabilizer/fromCombustion_fromMidClip_wSnap.stabilizer +0 -2028
- data/test/import/samples/flame_stabilizer/fromTracksperanto.stabilizer +0 -541
- data/test/import/samples/flame_stabilizer/hugeFlameSetup.stabilizer +0 -263460
- data/test/import/samples/flame_stabilizer/megaTrack.action.3dtrack.stabilizer +0 -29793
- data/test/import/samples/flame_stabilizer/stabilizer_2014_ref_for_reexport.stabilizer +0 -2776
- data/test/import/samples/flame_stabilizer/stabilizer_2014_stp.stabilizer +0 -2536
- data/test/import/samples/match_mover/2dtracks.rz2 +0 -2076
- data/test/import/samples/match_mover/EP_1000_head_trackers_v002.rz2 +0 -935
- data/test/import/samples/match_mover/NonSequentialMatchmoverPoints.rz2 +0 -93306
- data/test/import/samples/match_mover/cha_171_1020_atb_v001.rz2 +0 -238
- data/test/import/samples/match_mover/kipPointsMatchmover.rz2 +0 -523
- data/test/import/samples/match_mover_rzml/md_145_1070_right_t1.rzml +0 -601
- data/test/import/samples/mayalive/mayalive_kipShot.txt +0 -1504
- data/test/import/samples/nuke/018.nk +0 -300
- data/test/import/samples/nuke/45trackers.nk +0 -331
- data/test/import/samples/nuke/A099_L008_0207TW_001_head_R.nk +0 -135
- data/test/import/samples/nuke/cornerpin.nk +0 -11
- data/test/import/samples/nuke/curve-start-with-curve-command.nk +0 -174
- data/test/import/samples/nuke/failing_nuke7_trackers_job_1872.nk +0 -112
- data/test/import/samples/nuke/nuke708_tracker.nk +0 -52
- data/test/import/samples/nuke/nuke7_planar.nk +0 -3143
- data/test/import/samples/nuke/nuke7_tracker_2tracks.nk +0 -116
- data/test/import/samples/nuke/nuke7_transform2d.nk +0 -69
- data/test/import/samples/nuke/nuke8_tracker4_copypastes.nk +0 -53
- data/test/import/samples/nuke/one_tracker_with_break.nk +0 -71
- data/test/import/samples/nuke/one_tracker_with_break_in_grp.nk +0 -91
- data/test/import/samples/nuke/planar.nk +0 -37692
- data/test/import/samples/nuke/reconciles.nk +0 -210
- data/test/import/samples/nuke/sh110_trackers_004_ipad1.nk +0 -56
- data/test/import/samples/nuke/skip_invalid_curve_expressions.nk +0 -62
- data/test/import/samples/nuke/track_nuke8.nk +0 -54
- data/test/import/samples/nuke/tracker4_with_empty_tracks_knob.nk +0 -13005
- data/test/import/samples/nuke/tracker_with_differing_gaps.nk +0 -82
- data/test/import/samples/nuke/tracker_with_repeating_gaps.nk +0 -79
- data/test/import/samples/pfmatchit/pfmatchit_example.2dt +0 -90
- data/test/import/samples/pftrack4/sourcefile_pftrack.2dt +0 -28972
- data/test/import/samples/pftrack5/apft.2dt +0 -164
- data/test/import/samples/pftrack5/empty_trackers.2dt +0 -30
- data/test/import/samples/pftrack5/garage.2dt +0 -79259
- data/test/import/samples/pftrack5/stereo.2dt +0 -21073
- data/test/import/samples/shake_script/205_030_shaketrack_v01_pd.shk +0 -379
- data/test/import/samples/shake_script/REDACTED_shake_file.shk +0 -317
- data/test/import/samples/shake_script/cliff_many_stabilize.shk +0 -675
- data/test/import/samples/shake_script/comments_inline_with_args.shk +0 -50
- data/test/import/samples/shake_script/designated_global_range_starting_at_negative_frame.shk +0 -496
- data/test/import/samples/shake_script/four_tracks_in_one_matchmove.shk +0 -323
- data/test/import/samples/shake_script/four_tracks_in_one_stabilizer.shk +0 -321
- data/test/import/samples/shake_script/from_matchmover.shk +0 -140
- data/test/import/samples/shake_script/ofx_vardefs.shk +0 -6
- data/test/import/samples/shake_script/oldTrackerNode.shk +0 -5
- data/test/import/samples/shake_script/shake_script_from_boujou.shk +0 -15
- data/test/import/samples/shake_script/shake_tracker_nodes.shk +0 -633
- data/test/import/samples/shake_script/shake_tracker_with_no_anim.shk +0 -6
- data/test/import/samples/shake_script/shake_trackers_with_Nspline.shk +0 -328
- data/test/import/samples/shake_script/stabilize_nodes_with_hermite.shk +0 -330
- data/test/import/samples/shake_script/three_tracks_in_one_stabilizer.shk +0 -320
- data/test/import/samples/shake_script/track.shk +0 -349
- data/test/import/samples/shake_script/two_tracks_in_one_tracker.shk +0 -319
- data/test/import/samples/shake_text/nuke_camtracker.txt +0 -11240
- data/test/import/samples/shake_text/one_shake_tracker.txt +0 -49
- data/test/import/samples/shake_text/one_shake_tracker_from_first.txt +0 -188
- data/test/import/samples/shake_text/two_shake_trackers.txt +0 -78
- data/test/import/samples/syntheyes_2d_paths/cola_plate.txt +0 -507
- data/test/import/samples/syntheyes_2d_paths/flyover2DP_syntheyes.txt +0 -12687
- data/test/import/samples/syntheyes_2d_paths/morePoints_sy2010.txt +0 -752
- data/test/import/samples/syntheyes_2d_paths/one_tracker.txt +0 -49
- data/test/import/samples/syntheyes_2d_paths/shake_tracker_nodes_to_syntheyes.txt +0 -4091
- data/test/import/samples/syntheyes_all_tracker_paths/shot06_2dTracks.txt +0 -6255
- data/test/import/test_3de_import.rb +0 -41
- data/test/import/test_3de_import3.rb +0 -33
- data/test/import/test_boujou_import.rb +0 -29
- data/test/import/test_flame_import.rb +0 -120
- data/test/import/test_match_mover_import.rb +0 -100
- data/test/import/test_match_mover_rzml_import.rb +0 -33
- data/test/import/test_maya_live_import.rb +0 -57
- data/test/import/test_nuke_import.rb +0 -298
- data/test/import/test_pftrack_import.rb +0 -94
- data/test/import/test_shake_catcher.rb +0 -85
- data/test/import/test_shake_lexer.rb +0 -204
- data/test/import/test_shake_script_import.rb +0 -164
- data/test/import/test_shake_text_import.rb +0 -71
- data/test/import/test_syntheyes_all_tracker_paths_import.rb +0 -26
- data/test/import/test_syntheyes_import.rb +0 -51
- data/test/test_blacklist.rb +0 -50
- data/test/test_block_init.rb +0 -48
- data/test/test_buffer_io.rb +0 -33
- data/test/test_casts.rb +0 -76
- data/test/test_cli.rb +0 -108
- data/test/test_const_name.rb +0 -12
- data/test/test_extio.rb +0 -28
- data/test/test_format_detector.rb +0 -39
- data/test/test_keyframe.rb +0 -56
- data/test/test_parameters.rb +0 -37
- data/test/test_pipeline.rb +0 -192
- data/test/test_safety.rb +0 -20
- data/test/test_simple_export.rb +0 -22
- data/test/test_tracker.rb +0 -149
- data/test/test_tracksperanto.rb +0 -88
- data/test/test_uv_coords.rb +0 -28
- data/test/test_yield_non_empty.rb +0 -10
- data/test/test_zip_tuples.rb +0 -31
- data/test/tools/test_crop_middleware.rb +0 -32
- data/test/tools/test_flip_middleware.rb +0 -18
- data/test/tools/test_flop_middleware.rb +0 -18
- data/test/tools/test_golden_middleware.rb +0 -25
- data/test/tools/test_length_cutoff_middleware.rb +0 -43
- data/test/tools/test_lens_middleware.rb +0 -77
- data/test/tools/test_lerp_middleware.rb +0 -28
- data/test/tools/test_lint_middleware.rb +0 -79
- data/test/tools/test_move_to_first_frame_middleware.rb +0 -37
- data/test/tools/test_pad_middleware.rb +0 -35
- data/test/tools/test_prefix.rb +0 -31
- data/test/tools/test_reformat_middleware.rb +0 -36
- data/test/tools/test_scaler_middleware.rb +0 -66
- data/test/tools/test_shift_middleware.rb +0 -31
- data/test/tools/test_slip_middleware.rb +0 -36
- data/test/tools/test_start_trim_middleware.rb +0 -36
data/test/test_const_name.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
2
|
-
|
3
|
-
class TestConstName < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def test_const_name
|
6
|
-
assert_equal "Scaler", Tracksperanto::Tool::Scaler.const_name
|
7
|
-
assert_equal "Scaler", Tracksperanto::Tool::Scaler.new(nil).const_name
|
8
|
-
assert_equal "ShakeScript", Tracksperanto::Import::ShakeScript.const_name
|
9
|
-
assert_equal "ShakeText", Tracksperanto::Export::ShakeText.const_name
|
10
|
-
end
|
11
|
-
|
12
|
-
end
|
data/test/test_extio.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
2
|
-
|
3
|
-
class TestExtio < Test::Unit::TestCase
|
4
|
-
def e(st)
|
5
|
-
Tracksperanto::ExtIO.new(StringIO.new(st))
|
6
|
-
end
|
7
|
-
|
8
|
-
def test_gets
|
9
|
-
assert_equal "Mary had\n", e("Mary had\n").gets
|
10
|
-
end
|
11
|
-
|
12
|
-
def test_gets_and_strip
|
13
|
-
assert_equal "Mary had", e("Mary had\na little lamb\n").gets_and_strip
|
14
|
-
end
|
15
|
-
|
16
|
-
def test_gets_and_strip_at_end
|
17
|
-
s = e("Mary had\na little lamb\n")
|
18
|
-
s.gets_and_strip
|
19
|
-
s.gets_and_strip
|
20
|
-
|
21
|
-
assert_nil s.gets_and_strip
|
22
|
-
end
|
23
|
-
|
24
|
-
def test_gets_non_empty
|
25
|
-
s = e("\n\n\n\nfoo")
|
26
|
-
assert_equal "foo", s.gets_non_empty
|
27
|
-
end
|
28
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
2
|
-
|
3
|
-
class TestFormatDetector < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def test_match_unknown
|
6
|
-
file = "/tmp/unknown.someext"
|
7
|
-
d = Tracksperanto::FormatDetector.new(file)
|
8
|
-
|
9
|
-
assert d.frozen?
|
10
|
-
assert !d.match?
|
11
|
-
assert !d.auto_size?
|
12
|
-
assert_nil d.importer_klass
|
13
|
-
assert_equal "Unknown format", d.human_importer_name
|
14
|
-
end
|
15
|
-
|
16
|
-
|
17
|
-
def test_match_nuke
|
18
|
-
file = "C:\\WINDOZE_SHIT\\SUPERDUPER.NK"
|
19
|
-
d = Tracksperanto::FormatDetector.new(file)
|
20
|
-
assert d.frozen?
|
21
|
-
|
22
|
-
assert d.match?
|
23
|
-
assert !d.auto_size?
|
24
|
-
assert_equal Tracksperanto::Import::NukeScript, d.importer_klass
|
25
|
-
assert_equal Tracksperanto::Import::NukeScript.human_name, d.human_importer_name
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_match_flame
|
29
|
-
file = "/usr/discreet/project/StupidCommercial/stabilizer/uno.stabilizer"
|
30
|
-
d = Tracksperanto::FormatDetector.new(file)
|
31
|
-
assert d.frozen?
|
32
|
-
|
33
|
-
assert d.match?
|
34
|
-
assert d.auto_size?
|
35
|
-
assert_equal Tracksperanto::Import::FlameStabilizer, d.importer_klass
|
36
|
-
assert_equal "Flame .stabilizer file", d.human_importer_name
|
37
|
-
end
|
38
|
-
|
39
|
-
end
|
data/test/test_keyframe.rb
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
2
|
-
|
3
|
-
class TestKeyframe < Test::Unit::TestCase
|
4
|
-
def test_supports_block_init
|
5
|
-
keyframe = Tracksperanto::Keyframe.new do |k|
|
6
|
-
k.frame = 0
|
7
|
-
k.abs_x = 10.3
|
8
|
-
k.abs_y = 12.5
|
9
|
-
end
|
10
|
-
|
11
|
-
assert_equal 0, keyframe.frame
|
12
|
-
assert_equal 10.3, keyframe.abs_x
|
13
|
-
assert_equal 12.5, keyframe.abs_y
|
14
|
-
end
|
15
|
-
|
16
|
-
def test_sorts_on_frame
|
17
|
-
kf = Tracksperanto::Keyframe.new(:frame => 4, :abs_x => 10, :abs_y => 12.0)
|
18
|
-
kf2 = Tracksperanto::Keyframe.new(:frame => 2, :abs_x => 10, :abs_y => 12.0)
|
19
|
-
assert_equal [kf2, kf], [kf, kf2].sort
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_compares_equally_with_same_values
|
23
|
-
kf = Tracksperanto::Keyframe.new(:frame => 2, :abs_x => 10, :abs_y => 12.0)
|
24
|
-
kf2 = Tracksperanto::Keyframe.new(:frame => 2, :abs_x => 10, :abs_y => 12.0)
|
25
|
-
assert_equal kf, kf2
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_dup
|
29
|
-
kf = Tracksperanto::Keyframe.new(:frame => 2, :abs_x => 10, :abs_y => 12.0)
|
30
|
-
kf2 = kf.dup
|
31
|
-
kf2.frame = 15
|
32
|
-
assert_not_equal kf, kf2
|
33
|
-
end
|
34
|
-
|
35
|
-
def test_inspect
|
36
|
-
kf = Tracksperanto::Keyframe.new(:frame => 0, :abs_x => 10, :abs_y => 12.0)
|
37
|
-
assert_equal "#< 10.0x12.0 @0 ~0.00) >", kf.inspect
|
38
|
-
end
|
39
|
-
|
40
|
-
def test_frame_translated_to_int
|
41
|
-
kf = Tracksperanto::Keyframe.new {|k| k.frame = '0' }
|
42
|
-
assert_equal 0, kf.frame
|
43
|
-
end
|
44
|
-
|
45
|
-
def test_residual_defaults_to_zero
|
46
|
-
kf = Tracksperanto::Keyframe.new
|
47
|
-
assert_in_delta 0.0, kf.residual, 0.01
|
48
|
-
end
|
49
|
-
|
50
|
-
def test_abs_x_abs_y_translated_to_float
|
51
|
-
kf = Tracksperanto::Keyframe.new {|k| k.abs_x = '123.45678'; k.abs_y = '321.45678' }
|
52
|
-
assert_kind_of Float, kf.abs_x
|
53
|
-
assert_kind_of Float, kf.abs_y
|
54
|
-
end
|
55
|
-
|
56
|
-
end
|
data/test/test_parameters.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
2
|
-
|
3
|
-
class TestParameters < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def setup
|
6
|
-
@class = Class.new do
|
7
|
-
include Tracksperanto::Parameters
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
def test_parameters_empty_by_default
|
12
|
-
assert_equal [], @class.parameters
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_parameter_initialization
|
16
|
-
flexmock(@class).should_receive(:attr_accessor).once.with(:foo)
|
17
|
-
@class.parameter :foo
|
18
|
-
assert_equal 1, @class.parameters.length
|
19
|
-
|
20
|
-
first_param = @class.parameters[0]
|
21
|
-
assert_equal :foo, first_param.name
|
22
|
-
assert_nil first_param.desc
|
23
|
-
end
|
24
|
-
|
25
|
-
def test_parameter_initialization_with_safety
|
26
|
-
flexmock(@class).should_receive(:attr_accessor).once.with(:foo)
|
27
|
-
flexmock(@class).should_receive(:safe_reader).once.with(:foo)
|
28
|
-
@class.parameter :foo, :required => true
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_parameter_initialization_with_cast
|
32
|
-
flexmock(@class).should_receive(:attr_accessor).once.with(:foo)
|
33
|
-
flexmock(@class).should_receive(:cast_to_junk).once.with(:foo)
|
34
|
-
@class.parameter :foo, :cast => :junk
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
data/test/test_pipeline.rb
DELETED
@@ -1,192 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
2
|
-
|
3
|
-
class TestPipeline < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def create_stabilizer_file
|
6
|
-
@stabilizer = "input.stabilizer"
|
7
|
-
trackers = %w( Foo Bar Baz).map do | name |
|
8
|
-
t = Tracksperanto::Tracker.new(:name => name)
|
9
|
-
t.keyframe!(:frame => 3, :abs_x => 100, :abs_y => 200)
|
10
|
-
t.keyframe!(:frame => 4, :abs_x => 200, :abs_y => 120)
|
11
|
-
t.keyframe!(:frame => 5, :abs_x => 210, :abs_y => 145)
|
12
|
-
t
|
13
|
-
end
|
14
|
-
|
15
|
-
File.open(@stabilizer, "wb") do | f |
|
16
|
-
exporter = Tracksperanto::Export::FlameStabilizer.new(f)
|
17
|
-
exporter.just_export(trackers, 720, 576)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_supports_block_init
|
22
|
-
pipeline = Tracksperanto::Pipeline::Base.new(:tool_tuples => [:a, :b])
|
23
|
-
assert_equal [:a, :b], pipeline.tool_tuples
|
24
|
-
end
|
25
|
-
|
26
|
-
def test_run_with_autodetected_importer_and_size_without_progress_block
|
27
|
-
in_temp_dir do
|
28
|
-
create_stabilizer_file
|
29
|
-
pipeline = Tracksperanto::Pipeline::Base.new
|
30
|
-
assert_nothing_raised { pipeline.run(@stabilizer) }
|
31
|
-
assert_equal 3, pipeline.converted_points
|
32
|
-
assert_equal 9, pipeline.converted_keyframes, "Should report conversion of 9 keyframes"
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def test_run_with_error_picks_up_known_snags_from_importer
|
37
|
-
in_temp_dir do
|
38
|
-
create_stabilizer_file
|
39
|
-
pipeline = Tracksperanto::Pipeline::Base.new
|
40
|
-
flexmock(Tracksperanto::Import::ShakeScript).should_receive(:known_snags).times(1)
|
41
|
-
assert_raise(Tracksperanto::Pipeline::NoTrackersRecoveredError) do
|
42
|
-
pipeline.run(@stabilizer, :importer => "ShakeScript", :width => 2910, :height => 1080)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
def test_run_for_unsupported_format_raises_exception
|
48
|
-
pipeline = Tracksperanto::Pipeline::Base.new
|
49
|
-
%w( file.MOV file.mb vfx/shots/file.SNI ).each do | path |
|
50
|
-
assert_raise(Tracksperanto::UnsupportedFormatError) do
|
51
|
-
pipeline.run(path)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
def test_run_with_autodetected_importer_and_size_with_progress_block
|
57
|
-
in_temp_dir do
|
58
|
-
create_stabilizer_file
|
59
|
-
processing_log = ""
|
60
|
-
accum = lambda do | percent, message |
|
61
|
-
processing_log << ("%d -> %s\n" % [percent, message])
|
62
|
-
end
|
63
|
-
|
64
|
-
pipeline = Tracksperanto::Pipeline::Base.new(:progress_block => accum)
|
65
|
-
assert_nothing_raised { pipeline.run(@stabilizer) }
|
66
|
-
assert processing_log.include?("Parsing the file")
|
67
|
-
assert processing_log.include?("Parsing channel \"tracker1/ref/y\"")
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
def test_run_returns_the_number_of_trackers_and_keyframes_processed
|
72
|
-
in_temp_dir do
|
73
|
-
create_stabilizer_file
|
74
|
-
pipeline = Tracksperanto::Pipeline::Base.new
|
75
|
-
result = pipeline.run(@stabilizer)
|
76
|
-
assert_equal [3, 9], result
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
def test_run_crashes_with_empty_file
|
81
|
-
in_temp_dir do
|
82
|
-
empty_file_path = "input_empty.stabilizer"
|
83
|
-
f = File.open(empty_file_path, "w"){|f| f.write('') }
|
84
|
-
pipeline = Tracksperanto::Pipeline::Base.new
|
85
|
-
assert_raise(Tracksperanto::Pipeline::EmptySourceFileError) { pipeline.run(empty_file_path) }
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
def test_run_crashes_with_no_trackers
|
90
|
-
in_temp_dir do
|
91
|
-
empty_file_path = "input_empty.stabilizer"
|
92
|
-
f = File.open(empty_file_path, "w"){|f| f.write('xx') }
|
93
|
-
pipeline = Tracksperanto::Pipeline::Base.new
|
94
|
-
assert_raise(Tracksperanto::Pipeline::NoTrackersRecoveredError) { pipeline.run(empty_file_path) }
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
def test_tool_initialization_from_tuples
|
99
|
-
in_temp_dir do
|
100
|
-
create_stabilizer_file
|
101
|
-
|
102
|
-
pipeline = Tracksperanto::Pipeline::Base.new
|
103
|
-
pipeline.tool_tuples = [
|
104
|
-
["Bla", {:foo=> 234}]
|
105
|
-
]
|
106
|
-
|
107
|
-
mock_mux = flexmock("MUX")
|
108
|
-
mock_lint = flexmock("LINT")
|
109
|
-
flexmock(Tracksperanto::Export::Mux).should_receive(:new).and_return(mock_mux)
|
110
|
-
flexmock(Tracksperanto::Tool::Lint).should_receive(:new).with(mock_mux).and_return(mock_lint)
|
111
|
-
|
112
|
-
m = flexmock("tool object")
|
113
|
-
mock_tool_class = flexmock("tool class")
|
114
|
-
|
115
|
-
flexmock(Tracksperanto).should_receive(:get_tool).with("Bla").once.and_return(mock_tool_class)
|
116
|
-
mock_tool_class.should_receive(:new).with(mock_lint, {:foo => 234}).once
|
117
|
-
|
118
|
-
assert_raise(NoMethodError) { pipeline.run(@stabilizer) }
|
119
|
-
end
|
120
|
-
end
|
121
|
-
|
122
|
-
def test_run_with_autodetected_importer_that_requires_size
|
123
|
-
in_temp_dir do
|
124
|
-
FileUtils.cp( File.dirname(__FILE__) + "/import/samples/shake_script/four_tracks_in_one_stabilizer.shk", "input.shk")
|
125
|
-
pipeline = Tracksperanto::Pipeline::Base.new
|
126
|
-
assert_raise(Tracksperanto::Pipeline::DimensionsRequiredError) { pipeline.run("input.shk") }
|
127
|
-
end
|
128
|
-
end
|
129
|
-
|
130
|
-
def test_run_with_autodetected_importer_that_requires_size_when_size_supplied
|
131
|
-
in_temp_dir do
|
132
|
-
FileUtils.cp( File.dirname(__FILE__) + "/import/samples/shake_script/four_tracks_in_one_stabilizer.shk", "input.shk")
|
133
|
-
pipeline = Tracksperanto::Pipeline::Base.new
|
134
|
-
assert_nothing_raised { pipeline.run("input.shk", :width => 720, :height => 576) }
|
135
|
-
end
|
136
|
-
end
|
137
|
-
|
138
|
-
def test_run_with_overridden_importer_and_no_size
|
139
|
-
in_temp_dir do
|
140
|
-
FileUtils.cp( File.dirname(__FILE__) + "/import/samples/shake_script/four_tracks_in_one_stabilizer.shk", "input.shk")
|
141
|
-
pipeline = Tracksperanto::Pipeline::Base.new
|
142
|
-
num_exporters = Tracksperanto.exporters.length
|
143
|
-
assert_nothing_raised { pipeline.run("input.shk", :importer => "ShakeScript", :width => 720, :height => 576) }
|
144
|
-
assert_equal num_exporters, Dir.glob("input_*").length, "#{num_exporters} files should be present for the input and outputs"
|
145
|
-
end
|
146
|
-
end
|
147
|
-
|
148
|
-
def test_run_with_overridden_importer_and_size_for_file_that_would_be_recognized_differently
|
149
|
-
in_temp_dir do
|
150
|
-
FileUtils.cp( File.dirname(__FILE__) + "/import/samples/shake_script/four_tracks_in_one_stabilizer.shk", "input.stabilizer")
|
151
|
-
pipeline = Tracksperanto::Pipeline::Base.new
|
152
|
-
assert_nothing_raised { pipeline.run("input.stabilizer", :importer => "ShakeScript", :width => 720, :height => 576) }
|
153
|
-
end
|
154
|
-
end
|
155
|
-
|
156
|
-
def test_run_with_unknown_format_raises
|
157
|
-
in_temp_dir do
|
158
|
-
File.open("input.txt", "w"){|f| f.write("foo") }
|
159
|
-
|
160
|
-
pipeline = Tracksperanto::Pipeline::Base.new
|
161
|
-
assert_raise(Tracksperanto::Pipeline::UnknownFormatError) { pipeline.run("input.txt") }
|
162
|
-
assert_raise(Tracksperanto::Pipeline::UnknownFormatError) { pipeline.run("input.txt", :width => 100, :height => 100) }
|
163
|
-
assert_raise(Tracksperanto::Pipeline::DimensionsRequiredError) { pipeline.run("input.txt", :importer => "Syntheyes") }
|
164
|
-
end
|
165
|
-
end
|
166
|
-
|
167
|
-
def test_importing_file_with_trackers_of_zero_length_does_not_accumulate_any_trackers
|
168
|
-
in_temp_dir do
|
169
|
-
pft_with_empty_trackers = File.dirname(__FILE__) + "/import/samples/pftrack5/empty_trackers.2dt"
|
170
|
-
i = Tracksperanto::Import::PFTrack.new(:io => File.open(pft_with_empty_trackers), :width => 1920, :height => 1080)
|
171
|
-
tks = i.to_a
|
172
|
-
assert_equal 3, tks.length
|
173
|
-
assert_equal 0, tks[0].length, "The tracker should have 0 keyframes for this test to make sense"
|
174
|
-
|
175
|
-
FileUtils.cp(pft_with_empty_trackers, "input_empty.2dt")
|
176
|
-
|
177
|
-
pipeline = Tracksperanto::Pipeline::Base.new
|
178
|
-
num_t, num_k = pipeline.run("input_empty.2dt", :width => 1920, :height => 1080)
|
179
|
-
assert_equal 1, num_t, "Only one tracker should have been sent through the export"
|
180
|
-
end
|
181
|
-
end
|
182
|
-
|
183
|
-
def test_run_with_overridden_importer_and_size
|
184
|
-
in_temp_dir do
|
185
|
-
FileUtils.cp( File.dirname(__FILE__) + "/import/samples/3de_v4/3de_export_cube.txt", "input.txt")
|
186
|
-
pipeline = Tracksperanto::Pipeline::Base.new
|
187
|
-
assert_raise(Tracksperanto::Pipeline::DimensionsRequiredError) { pipeline.run("input.txt", :importer => "Equalizer4") }
|
188
|
-
assert_nothing_raised { pipeline.run("input.txt", :importer => "Equalizer4", :width => 720, :height => 576) }
|
189
|
-
end
|
190
|
-
end
|
191
|
-
|
192
|
-
end
|
data/test/test_safety.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
2
|
-
|
3
|
-
class TestSafety < Test::Unit::TestCase
|
4
|
-
class Testable
|
5
|
-
include Tracksperanto::Safety
|
6
|
-
attr_accessor :foo, :bar
|
7
|
-
safe_reader :foo, :bar
|
8
|
-
end
|
9
|
-
|
10
|
-
def test_safe_reader_raises_with_no_ivar
|
11
|
-
t = Testable.new
|
12
|
-
assert_raise(RuntimeError) { t.foo }
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_safe_reader_does_not_raise_with_value_assigned
|
16
|
-
t = Testable.new
|
17
|
-
t.foo = 123
|
18
|
-
assert_nothing_raised { assert_equal 123, t.foo }
|
19
|
-
end
|
20
|
-
end
|
data/test/test_simple_export.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
2
|
-
|
3
|
-
class SimpleExportTest < Test::Unit::TestCase
|
4
|
-
|
5
|
-
class Probe
|
6
|
-
include Tracksperanto::SimpleExport
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_message_sends
|
10
|
-
probe = Probe.new
|
11
|
-
flexmock(probe).should_receive(:start_export).with(1920, 1080).once
|
12
|
-
flexmock(probe).should_receive(:start_tracker_segment).with("Foo").once
|
13
|
-
flexmock(probe).should_receive(:export_point).with(2, 345.0, 678.0, 0.0).once
|
14
|
-
flexmock(probe).should_receive(:end_tracker_segment).once
|
15
|
-
flexmock(probe).should_receive(:end_export).once
|
16
|
-
|
17
|
-
t = Tracksperanto::Tracker.new(:name => "Foo")
|
18
|
-
t.keyframe! :frame => 2, :abs_x => 345.0, :abs_y => 678.0, :residual => 0.0
|
19
|
-
probe.just_export([t], 1920, 1080)
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
data/test/test_tracker.rb
DELETED
@@ -1,149 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
2
|
-
|
3
|
-
class TrackerTest < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def setup
|
6
|
-
@keyframes = [
|
7
|
-
Tracksperanto::Keyframe.new(:frame => 15, :abs_x => 123, :abs_y => 456),
|
8
|
-
Tracksperanto::Keyframe.new(:frame => 8, :abs_x => 678, :abs_y => 901),
|
9
|
-
Tracksperanto::Keyframe.new(:frame => 1, :abs_x => 342, :abs_y => 312),
|
10
|
-
]
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_supports_block_init
|
14
|
-
t = Tracksperanto::Tracker.new do |t|
|
15
|
-
t.name = 'Foo'
|
16
|
-
end
|
17
|
-
assert_equal "Foo", t.name
|
18
|
-
end
|
19
|
-
|
20
|
-
def test_responds_to_needed_methods
|
21
|
-
t = Tracksperanto::Tracker.new
|
22
|
-
assert_respond_to t, :name
|
23
|
-
assert_respond_to t, :each
|
24
|
-
assert_respond_to t, :keyframes
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_to_ruby
|
28
|
-
one_f = Tracksperanto::Tracker.new(:name => "Cde") do | t |
|
29
|
-
t.keyframe! :abs_x => 12, :abs_y => 23, :frame => 1
|
30
|
-
end
|
31
|
-
ref = "Tracksperanto::Tracker.new(:name => \"Cde\") do |t|\n t.keyframe!(:frame => 1, :abs_x => 12.00000, :abs_y => 23.00000, :residual => 0.00000)\nend"
|
32
|
-
assert_equal ref, one_f.to_ruby
|
33
|
-
|
34
|
-
tracker = Tracksperanto::Tracker.new(:name => "Cde") do | t |
|
35
|
-
t.keyframe! :abs_x => 12, :abs_y => 23, :frame => 1
|
36
|
-
t.keyframe! :abs_x => 13, :abs_y => 24, :frame => 2
|
37
|
-
end
|
38
|
-
|
39
|
-
result = eval(tracker.to_ruby)
|
40
|
-
assert_equal result, tracker
|
41
|
-
end
|
42
|
-
|
43
|
-
def test_properly_ignores_flattening
|
44
|
-
t = []
|
45
|
-
t << Tracksperanto::Tracker.new(:name => "Abc")
|
46
|
-
t[-1].keyframe! :abs_x => 12, :abs_y => 23, :frame => 1
|
47
|
-
t[-1].keyframe! :abs_x => 13, :abs_y => 24, :frame => 2
|
48
|
-
|
49
|
-
t << Tracksperanto::Tracker.new(:name => "Cde")
|
50
|
-
t[-1].keyframe! :abs_x => 12, :abs_y => 23, :frame => 1
|
51
|
-
t[-1].keyframe! :abs_x => 13, :abs_y => 24, :frame => 2
|
52
|
-
|
53
|
-
assert_kind_of Tracksperanto::Tracker, t.flatten[0]
|
54
|
-
assert_equal 2, t.flatten.length
|
55
|
-
end
|
56
|
-
|
57
|
-
def test_supports_hash_init
|
58
|
-
assert_equal "Foo", Tracksperanto::Tracker.new(:name => "Foo").name
|
59
|
-
end
|
60
|
-
|
61
|
-
def test_supports_hash_init_with_keyframes
|
62
|
-
kfs = Tracksperanto::Keyframe.new(:frame => 1, :abs_x => 123, :abs_y => 456)
|
63
|
-
assert_equal [kfs], Tracksperanto::Tracker.new(:keyframes => [kfs]).keyframes
|
64
|
-
end
|
65
|
-
|
66
|
-
def test_clear
|
67
|
-
t = Tracksperanto::Tracker.new do | t |
|
68
|
-
t.keyframe! :abs_x => 123, :abs_y => 456
|
69
|
-
end
|
70
|
-
assert_equal 1, t.length
|
71
|
-
t.clear
|
72
|
-
assert t.length.zero?
|
73
|
-
end
|
74
|
-
|
75
|
-
def test_supports_array_methods
|
76
|
-
kfs = Tracksperanto::Keyframe.new(:frame => 1, :abs_x => 123, :abs_y => 456)
|
77
|
-
t = Tracksperanto::Tracker.new(:keyframes => [kfs])
|
78
|
-
|
79
|
-
assert_equal [kfs], t.to_a
|
80
|
-
assert_equal 1, t.length
|
81
|
-
end
|
82
|
-
|
83
|
-
def test_push
|
84
|
-
kf = Tracksperanto::Keyframe.new(:frame => 1, :abs_x => 123, :abs_y => 456)
|
85
|
-
t = Tracksperanto::Tracker.new(:name => "Test")
|
86
|
-
t.push(kf)
|
87
|
-
assert_equal 1, t.length
|
88
|
-
|
89
|
-
kf = Tracksperanto::Keyframe.new(:frame => 1, :abs_x => 333, :abs_y => 456)
|
90
|
-
assert_raise(Tracksperanto::Tracker::Dupe) do
|
91
|
-
t.push(kf)
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
def test_set
|
96
|
-
t = Tracksperanto::Tracker.new(:name => "Shmoo", :keyframes => @keyframes)
|
97
|
-
replacement_key = Tracksperanto::Keyframe.new(:frame => 15, :abs_x => 92193921)
|
98
|
-
t.set(replacement_key)
|
99
|
-
assert_in_delta 0.0001, 92193921.0, t[-1].abs_x
|
100
|
-
end
|
101
|
-
|
102
|
-
def test_bracket_subscript
|
103
|
-
t = Tracksperanto::Tracker.new(:name => "Shmoo", :keyframes => @keyframes)
|
104
|
-
kf = t[0]
|
105
|
-
assert_equal kf, @keyframes[-1], "Keyframe at 1 should be returned"
|
106
|
-
end
|
107
|
-
|
108
|
-
def test_at_frame
|
109
|
-
t = Tracksperanto::Tracker.new(:name => "Shmoo", :keyframes => @keyframes)
|
110
|
-
assert_equal @keyframes[0], t.at_frame(15)
|
111
|
-
assert_nil t.at_frame(200), "Should return nil for nonexisting frames"
|
112
|
-
end
|
113
|
-
|
114
|
-
def test_keyframes_assignment_overwrites
|
115
|
-
t = Tracksperanto::Tracker.new(:name => "Shmoo", :keyframes => @keyframes)
|
116
|
-
assert_equal [1, 8, 15], t.to_a.map{|e| e.frame}
|
117
|
-
new_key = @keyframes[1]
|
118
|
-
t.keyframes = [new_key]
|
119
|
-
|
120
|
-
assert_equal [8], t.to_a.map{|e| e.frame}
|
121
|
-
end
|
122
|
-
|
123
|
-
def test_empty?
|
124
|
-
t = Tracksperanto::Tracker.new(:name => "Test")
|
125
|
-
assert t.empty?
|
126
|
-
|
127
|
-
t = Tracksperanto::Tracker.new(:name => "Test")
|
128
|
-
t.keyframe! :frame => 10, :abs_x => 123
|
129
|
-
assert !t.empty?
|
130
|
-
end
|
131
|
-
|
132
|
-
def test_inspect
|
133
|
-
t = Tracksperanto::Tracker.new(:name => "FooTracker")
|
134
|
-
assert_equal '<T "FooTracker" with 0 keyframes>', t.inspect
|
135
|
-
end
|
136
|
-
|
137
|
-
def test_ensure_tracker_forbids_spaces_in_names
|
138
|
-
t = Tracksperanto::Tracker.new(:name => "Mary had a \n \t little lamb")
|
139
|
-
assert_equal "Mary_had_a_little_lamb", t.name
|
140
|
-
end
|
141
|
-
|
142
|
-
def test_enumerates_keyframe_values_and_returns_length
|
143
|
-
t = Tracksperanto::Tracker.new(:keyframes => @keyframes)
|
144
|
-
assert_equal @keyframes.sort, t.map{|e| e}
|
145
|
-
assert_equal 3, t.length
|
146
|
-
assert_equal @keyframes[-1], t[0]
|
147
|
-
end
|
148
|
-
|
149
|
-
end
|