Sha256: e6e5a97368ea9d0618a5103d99a108c1d3426aa75ff3ecb9b1ff860c781a2ad8

Contents?: true

Size: 1.29 KB

Versions: 1

Compression:

Stored size: 1.29 KB

Contents

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

class SyntheyesImportTest < Test::Unit::TestCase
  DELTA = 0.9 # our SynthEyes sample is somewhat inaccurate :-P
  def test_introspects_properly
    i = Tracksperanto::Import::Syntheyes
    assert_equal "Syntheyes tracker export (UV) file", i.human_name
    assert !i.autodetects_size?
  end
  
  def test_parsing_from_importable
    fixture = File.open(File.dirname(__FILE__) + '/samples/shake_tracker_nodes_to_syntheyes.txt')
    
    parser = Tracksperanto::Import::Syntheyes.new
    parser.width = 2560
    parser.height = 1080
    
    trackers = parser.parse(fixture)
    assert_equal 50, trackers.length
    
    first_kf = trackers[0].keyframes[0]
    
    assert_equal "Tracker1", trackers[0].name
    
    assert_equal 0, first_kf.frame
    assert_in_delta 715.839, first_kf.abs_x, DELTA
    assert_in_delta 886.212, first_kf.abs_y, DELTA
    assert_in_delta 30.0, first_kf.residual, DELTA
  end
  
  def test_syntheyes_import_from_victorw
    fixture = File.open(File.dirname(__FILE__) + "/samples/testalltrackers_VictorW.txt")
    parser = Tracksperanto::Import::Syntheyes.new
    parser.width = 1920
    parser.height = 1080
    
    trackers = parser.parse(fixture)
    for tracker in trackers
      puts tracker.inspect
      STDOUT.flush
    end
    
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tracksperanto-1.2.1 test/import/test_syntheyes_import.rb