Sha256: 9c9913b623a8a8727e544beabbbd8679a80388b9f91abcbdd61f6baded0e0f13

Contents?: true

Size: 1.57 KB

Versions: 20

Compression:

Stored size: 1.57 KB

Contents

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

class MayaLiveImportTest < Test::Unit::TestCase
  DELTA = 0.001
  
  def test_introspects_properly
    i = Tracksperanto::Import::MayaLive
    assert_equal "Maya Live track export file", i.human_name
    assert i.autodetects_size?
  end
  
  def test_parse_file
    f = File.open(File.dirname(__FILE__) + "/samples/mayalive/mayalive_kipShot.txt")
    
    p = Tracksperanto::Import::MayaLive.new(:io => f)
    trackers = p.to_a
    
    assert_in_delta 2.37, p.aspect, DELTA
    assert_equal 1280, p.width
    assert_equal 540, p.height
    
    assert_equal 18, trackers.length
    
    first_t = trackers[0]
    assert_equal "trackedPoint1", first_t.name
    assert_equal 225, first_t.length
    first_kf = first_t[0]
    
    assert_equal 0, first_kf.frame
    assert_in_delta 388.542, first_kf.abs_x, DELTA
    assert_in_delta 513.346, first_kf.abs_y, DELTA
  end
  
  def test_parse_file_with_custom_aspect
    f = File.open(File.dirname(__FILE__) + "/samples/mayalive/mayalive_kipShot.txt")
    
    p = Tracksperanto::Import::MayaLive.new(:io => f)
    p.aspect = 1.78
    trackers = p.to_a
    
    assert_in_delta 1.78, p.aspect, DELTA
    
    assert_equal 1280, p.width
    assert_equal 540, p.height
    
    assert_equal 18, trackers.length
    
    first_t = trackers[0]
    assert_equal "trackedPoint1", first_t.name
    assert_equal 225, first_t.length
    first_kf = first_t[0]
    
    assert_equal 0, first_kf.frame
    assert_in_delta 305.141, first_kf.abs_x, DELTA
    assert_in_delta 513.346, first_kf.abs_y, DELTA
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
tracksperanto-2.8.6 test/import/test_maya_live_import.rb
tracksperanto-2.8.5 test/import/test_maya_live_import.rb
tracksperanto-2.8.4 test/import/test_maya_live_import.rb
tracksperanto-2.8.2 test/import/test_maya_live_import.rb
tracksperanto-2.8.1 test/import/test_maya_live_import.rb
tracksperanto-2.8.0 test/import/test_maya_live_import.rb
tracksperanto-2.7.0 test/import/test_maya_live_import.rb
tracksperanto-2.6.3 test/import/test_maya_live_import.rb
tracksperanto-2.6.2 test/import/test_maya_live_import.rb
tracksperanto-2.6.1 test/import/test_maya_live_import.rb
tracksperanto-2.6.0 test/import/test_maya_live_import.rb
tracksperanto-2.5.0 test/import/test_maya_live_import.rb
tracksperanto-2.4.1 test/import/test_maya_live_import.rb
tracksperanto-2.3.3 test/import/test_maya_live_import.rb
tracksperanto-2.3.2 test/import/test_maya_live_import.rb
tracksperanto-2.3.1 test/import/test_maya_live_import.rb
tracksperanto-2.3.0 test/import/test_maya_live_import.rb
tracksperanto-2.2.4 test/import/test_maya_live_import.rb
tracksperanto-2.2.2 test/import/test_maya_live_import.rb
tracksperanto-2.2.0 test/import/test_maya_live_import.rb