Sha256: 7fd328a35f75c749288e82d3f95942ae4686ed458d655a65bdf5547838a0e794

Contents?: true

Size: 1.61 KB

Versions: 7

Compression:

Stored size: 1.61 KB

Contents

require File.dirname(__FILE__) + '/helper'

class ShakeScriptImportTest < Test::Unit::TestCase
  DELTA = 0.001
  
  def test_parsing_many_tracker_noes_with_one_track_each
    fixture = File.read(File.dirname(__FILE__) + '/samples/shake_tracker_nodes.shk')
    
    trackers = Tracksperanto::Import::ShakeScript.new.parse(fixture)
    assert_equal 50, trackers.length
    
    t = trackers[0]
    assert_equal "Tracker1", t.name
    
    first_kf = t.keyframes[0]
    assert_equal 0, first_kf.frame
    assert_in_delta 886.212, first_kf.abs_y, DELTA
    assert_in_delta 715.839, first_kf.abs_x, DELTA
    assert_in_delta 0.0, first_kf.residual, DELTA
    
    second_kf = t.keyframes[1]
    assert_in_delta 0.00129, second_kf.residual, DELTA
  end

  def test_parsing_many_tracks_in_one_tracker_node
    fixture = File.read(File.dirname(__FILE__) + '/samples/two_tracks_in_one_tracker.shk')
    
    trackers = Tracksperanto::Import::ShakeScript.new.parse(fixture)
    assert_equal 2, trackers.length
    
    t = trackers[0]
    assert_equal "Tracker1", t.name
    
    first_kf = t.keyframes[0]
    assert_equal 0, first_kf.frame
    assert_in_delta 886.212, first_kf.abs_y, DELTA
    assert_in_delta 715.839, first_kf.abs_x, DELTA
    assert_in_delta 0.0, first_kf.residual, DELTA
    
    second_kf = t.keyframes[1]
    assert_in_delta 0.00129, second_kf.residual, DELTA
  end

  def test_parsing_many_tracks_in_one_stabilizer_node
    fixture = File.read(File.dirname(__FILE__) + '/samples/three_tracks_in_one_stabilizer.shk')
    
    trackers = Tracksperanto::Import::ShakeScript.new.parse(fixture)
    assert_equal 3, trackers.length
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tracksperanto-1.1.1 test/test_shake_script_import.rb
tracksperanto-1.1.0 test/test_shake_script_import.rb
tracksperanto-1.0.6 test/test_shake_script_import.rb
tracksperanto-1.0.4 test/test_shake_script_import.rb
tracksperanto-1.0.2 test/test_shake_script_import.rb
tracksperanto-1.0.1 test/test_shake_script_import.rb
tracksperanto-1.0.0 test/test_shake_script_import.rb