Sha256: 70d9795e2af307b61bf9f636da02cbf00b81bc7f38ba1f4b0de2877903777e81
Contents?: true
Size: 1.33 KB
Versions: 4
Compression:
Stored size: 1.33 KB
Contents
# -*- encoding : utf-8 -*- class Tracksperanto::Import::Syntheyes < Tracksperanto::Import::Base include Tracksperanto::UVCoordinates def self.human_name "Syntheyes \"Tracker 2-D paths\" file" end def self.known_snags "Syntheyes has two formats for exporting tracks. One is called \"Tracker 2-D paths\" in the menu. " + "The other is called \"All Tracker Paths\". You told Tracksperanto to treat your file as " + "\"Tracker 2-D paths\", if something goes wrong might be a good idea to try the other Tracksperanto input format" end def each @io.each_line do | line | name, frame, x, y, frame_status = line.split # Do we already have this tracker? unless @last_tracker && @last_tracker.name == name yield(@last_tracker) if @last_tracker report_progress("Allocating tracker #{name}") @last_tracker = Tracksperanto::Tracker.new{|t| t.name = name } end # Add the keyframe k = Tracksperanto::Keyframe.new do |e| e.frame = frame e.abs_x = convert_from_uv(x, width) e.abs_y = height - convert_from_uv(y, height) # Convert TL to BL end @last_tracker.push(k) report_progress("Adding keyframe #{frame} to #{name}") end yield(@last_tracker) if @last_tracker && @last_tracker.any? end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
tracksperanto-3.5.9 | lib/import/syntheyes.rb |
tracksperanto-3.5.8 | lib/import/syntheyes.rb |
tracksperanto-3.5.7 | lib/import/syntheyes.rb |
tracksperanto-3.5.6 | lib/import/syntheyes.rb |