test/import/test_nuke_import.rb in tracksperanto-3.1.0 vs test/import/test_nuke_import.rb in tracksperanto-3.2.0
- old
+ new
@@ -43,11 +43,11 @@
trackers = parser.to_a
assert_equal 4, trackers.length
ref_names = %w( PlanarTracker2_outputBottomLeft PlanarTracker2_outputBottomRight
- PlanarTracker2_outputTopRight PlanarTracker2_outputTopLeft )
+ PlanarTracker2_outputTopLeft PlanarTracker2_outputTopRight )
assert_equal ref_names, trackers.map{|e| e.name }
end
def test_parsing_from_nuke
fixture = File.open(File.dirname(__FILE__) + '/samples/nuke/one_tracker_with_break.nk')
@@ -104,10 +104,29 @@
assert_equal 5, t[3].frame
assert_equal 8, t[4].frame
assert_equal 11, t[5].frame
end
+ def test_parsing_from_nuke7_tracker4
+ fixture = File.open(File.dirname(__FILE__) + '/samples/nuke/nuke7_tracker_2tracks.nk')
+
+ parser = Tracksperanto::Import::NukeScript.new(:io => fixture)
+ parser.width = 1280
+ parser.height = 720
+
+ trackers = parser.to_a
+ assert_equal 2, trackers.length
+ assert_equal "Tracker1_track_1", trackers[0].name
+ assert_equal "Tracker1_track_2", trackers[1].name
+ assert_equal 15, trackers[1].length
+
+ kf = trackers[1][5]
+ assert_in_delta 106.75, kf.abs_x, DELTA
+ assert_in_delta 77.01, kf.abs_y, DELTA
+ assert_equal 9, kf.frame
+ end
+
def test_parsing_from_nuke_group
fixture = File.open(File.dirname(__FILE__) + '/samples/nuke/one_tracker_with_break_in_grp.nk')
parser = Tracksperanto::Import::NukeScript.new(:io => fixture)
parser.width = 2048
@@ -122,12 +141,12 @@
assert_in_delta 1147.972, sec_tracker.keyframes[-1].abs_x, DELTA
assert_in_delta 510.107, sec_tracker.keyframes[-1].abs_y, DELTA
end
def test_parsing_nuke_curve
- curve = '{curve x742 888 890.2463989 891.6602783 \
-893.5056763 895.6155396 s95 897.2791748 899.1762695 \
-x754 912.0731812 x755 913.7190552 916.0959473 918.1025391 920.0751953 922.1898804}'
+ curve = %w( curve x742 888 890.2463989 891.6602783
+893.5056763 895.6155396 s95 897.2791748 899.1762695
+x754 912.0731812 x755 913.7190552 916.0959473 918.1025391 920.0751953 922.1898804 )
p = Tracksperanto::NukeGrammarUtils.new
result = p.parse_curve(curve)
assert_kind_of Array, result
assert_equal 13, result.length
assert_equal 742, result[0][0]