class Tracksperanto::Export::Equalizer3
Export for 3DE v3 point files. 3DE always starts frames at 1.
Constants
- HEADER
Public Class Methods
desc_and_extension()
click to toggle source
# File lib/export/equalizer3.rb, line 6 def self.desc_and_extension "3de_v3.txt" end
human_name()
click to toggle source
# File lib/export/equalizer3.rb, line 10 def self.human_name "3DE v3 point export .txt file" end
Public Instance Methods
end_export()
click to toggle source
# File lib/export/equalizer3.rb, line 31 def end_export @buffer.rewind @io.puts(HEADER % [@w, @h, @highest_keyframe]) @io.puts(@buffer.read) until @buffer.eof? @buffer.close! @io.puts("") # Newline at end end
export_point(frame, abs_float_x, abs_float_y, float_residual)
click to toggle source
# File lib/export/equalizer3.rb, line 25 def export_point(frame, abs_float_x, abs_float_y, float_residual) off_by_one = frame + 1 @buffer.puts("\t%d\t%.3f\t%.3f" % [off_by_one, abs_float_x, abs_float_y]) @highest_keyframe = off_by_one if (@highest_keyframe < off_by_one) end
start_export( img_width, img_height)
click to toggle source
# File lib/export/equalizer3.rb, line 14 def start_export( img_width, img_height) @w, @h = img_width, img_height # 3DE needs to know the number of keyframes in advance @buffer = Tracksperanto::BufferIO.new @highest_keyframe = 0 end
start_tracker_segment(tracker_name)
click to toggle source
# File lib/export/equalizer3.rb, line 21 def start_tracker_segment(tracker_name) @buffer.puts(tracker_name) end