lib/import/syntheyes.rb in tracksperanto-1.1.1 vs lib/import/syntheyes.rb in tracksperanto-1.2.0
- old
+ new
@@ -1,14 +1,20 @@
class Tracksperanto::Import::Syntheyes < Tracksperanto::Import::Base
- def parse(file_content)
+
+ def self.human_name
+ "Syntheyes tracker export (UV) file"
+ end
+
+ def parse(io)
trackers = []
- file_content.split("\n").each do | line |
+ io.each_line do | line |
name, frame, x, y, corr = 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
@@ -16,9 +22,10 @@
e.frame = frame
e.abs_x = convert_from_uv(width, x)
e.abs_y = height - convert_from_uv(height, y) # Convert TL to BL
e.residual = corr
end
+ report_progress("Adding keyframe #{frame} to #{name}")
end
trackers
end
\ No newline at end of file