lib/import/maya_live.rb in tracksperanto-1.9.8 vs lib/import/maya_live.rb in tracksperanto-1.9.9

- old
+ new

@@ -13,27 +13,27 @@ true end COMMENT = /^# / - def parse(original_io) + def stream_parse(original_io) io = Tracksperanto::ExtIO.new(original_io) extract_width_height_and_aspect(io.gets_non_empty) - trackers = [] while line = io.gets_and_strip if line =~ COMMENT - trackers << Tracksperanto::Tracker.new(:name => line.gsub(/#{COMMENT} Name(\s+)/, '')) + send_tracker(@last_tracker) if @last_tracker + @last_tracker = Tracksperanto::Tracker.new(:name => line.gsub(/#{COMMENT} Name(\s+)/, '')) next end tracker_num, frame, x, y, residual = line.split abs_x, abs_y = aspect_values_to_pixels(x, y) - trackers[-1].keyframe! :frame => frame, :abs_x => abs_x, :abs_y => abs_y, :residual => set_residual(residual) + @last_tracker.keyframe! :frame => frame, :abs_x => abs_x, :abs_y => abs_y, :residual => set_residual(residual) end - trackers + send_tracker(@last_tracker) if @last_tracker end private def aspect_values_to_pixels(x, y) \ No newline at end of file