test/import/test_nuke_import.rb in tracksperanto-3.3.6 vs test/import/test_nuke_import.rb in tracksperanto-3.3.7

- old
+ new

@@ -4,11 +4,11 @@ class NukeImportTest < Test::Unit::TestCase DELTA = 0.01 def test_introspects_properly i = Tracksperanto::Import::NukeScript - assert_equal "Nuke .nk script file with Tracker, Reconcile3D and PlanarTracker nodes", i.human_name + assert_equal "Nuke .nk script file with Tracker, Reconcile3D, PlanarTracker and CornerPin nodes", i.human_name assert !i.autodetects_size? end def test_parsing_big_file_from_nuke fixture = File.open(File.dirname(__FILE__) + '/samples/nuke/45trackers.nk') @@ -32,10 +32,21 @@ assert_equal 5, trackers.length assert_equal 128, trackers[0].length end + def test_parsing_cornerpin + fixture = File.open(File.dirname(__FILE__) + '/samples/nuke/cornerpin.nk') + + parser = Tracksperanto::Import::NukeScript.new(:io => fixture) + parser.width = 4096 + parser.height = 2304 + + trackers = parser.to_a + assert_equal 4, trackers.length + end + def test_parsing_planar_tracker fixture = File.open(File.dirname(__FILE__) + '/samples/nuke/planar.nk') parser = Tracksperanto::Import::NukeScript.new(:io => fixture) parser.width = 4096 @@ -44,9 +55,24 @@ trackers = parser.to_a assert_equal 4, trackers.length ref_names = %w( PlanarTracker2_outputBottomLeft PlanarTracker2_outputBottomRight PlanarTracker2_outputTopLeft PlanarTracker2_outputTopRight ) + assert_equal ref_names, trackers.map{|e| e.name } + end + + def test_parsing_planar_tracker_nuke7 + fixture = File.open(File.dirname(__FILE__) + '/samples/nuke/nuke7_planar.nk') + + parser = Tracksperanto::Import::NukeScript.new(:io => fixture) + parser.width = 1920 + parser.height = 1080 + + trackers = parser.to_a + assert_equal 4, trackers.length + + ref_names = %w( PlanarTracker1_outputBottomLeft PlanarTracker1_outputBottomRight + PlanarTracker1_outputTopLeft PlanarTracker1_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')