Sha256: 36f1a61f4b7c7ed6944a2fa23b29a84d9798a1751ddb48168a46c52a6ebcd1d7

Contents?: true

Size: 881 Bytes

Versions: 27

Compression:

Stored size: 881 Bytes

Contents

class Tracksperanto::Import::Syntheyes < Tracksperanto::Import::Base
  include Tracksperanto::UVCoordinates
  
  def self.human_name
    "Syntheyes 2D tracker paths file"
  end
  
  def parse(io)
    trackers = []
    io.each_line do | line |
      name, frame, x, y, frame_status = line.split
      
      # Do we already have this tracker?
      t = trackers.find {|e| e.name == name}
      if !t
        report_progress("Allocating tracker #{name}")
        t = Tracksperanto::Tracker.new{|t| t.name = name }
        trackers << t
      end
      
      # Add the keyframe
      t.keyframes << Tracksperanto::Keyframe.new do |e| 
        e.frame = frame
        e.abs_x = convert_from_uv(width, x)
        e.abs_y = height - convert_from_uv(height, y) # Convert TL to BL
      end
      report_progress("Adding keyframe #{frame} to #{name}")
    end
    
    trackers
  end

end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
tracksperanto-1.9.8 lib/import/syntheyes.rb
tracksperanto-1.9.6 lib/import/syntheyes.rb
tracksperanto-1.9.5 lib/import/syntheyes.rb
tracksperanto-1.9.4 lib/import/syntheyes.rb
tracksperanto-1.9.3 lib/import/syntheyes.rb
tracksperanto-1.9.2 lib/import/syntheyes.rb
tracksperanto-1.9.1 lib/import/syntheyes.rb
tracksperanto-1.9.0 lib/import/syntheyes.rb
tracksperanto-1.8.4 lib/import/syntheyes.rb
tracksperanto-1.8.2 lib/import/syntheyes.rb
tracksperanto-1.8.1 lib/import/syntheyes.rb
tracksperanto-1.8.0 lib/import/syntheyes.rb
tracksperanto-1.7.5 lib/import/syntheyes.rb
tracksperanto-1.7.4 lib/import/syntheyes.rb
tracksperanto-1.7.3 lib/import/syntheyes.rb
tracksperanto-1.7.2 lib/import/syntheyes.rb
tracksperanto-1.7.1 lib/import/syntheyes.rb
tracksperanto-1.7.0 lib/import/syntheyes.rb
tracksperanto-1.6.9 lib/import/syntheyes.rb
tracksperanto-1.6.8 lib/import/syntheyes.rb