class Tracksperanto::Export::Ruby

Exports the trackers to a script that is fit for massaging with Tracksperanto as is

Public Class Methods

desc_and_extension() click to toggle source
# File lib/export/ruby.rb, line 4
def self.desc_and_extension
  "tracksperanto_ruby.rb"
end
human_name() click to toggle source
# File lib/export/ruby.rb, line 8
def self.human_name
  "Bare Ruby code"
end

Public Instance Methods

end_export() click to toggle source
# File lib/export/ruby.rb, line 34
def end_export
  @io.puts(" ")
end
end_tracker_segment() click to toggle source
# File lib/export/ruby.rb, line 30
def end_tracker_segment
  @io.puts(@tracker.to_ruby)# Just leave that
end
export_point(f, x, y, r) click to toggle source
# File lib/export/ruby.rb, line 26
def export_point(f, x, y, r)
  @tracker.keyframe! :frame => f, :abs_x => x, :abs_y => y, :residual => r
end
start_export(w,h) click to toggle source
# File lib/export/ruby.rb, line 12
def start_export(w,h)
  @io.puts "require 'rubygems'"
  @io.puts "require 'tracksperanto'"
  @io.puts("width = %d" % w)
  @io.puts("height = %d" % h)
  @io.puts("trackers = []")
end
start_tracker_segment(name) click to toggle source
# File lib/export/ruby.rb, line 20
def start_tracker_segment(name)
  @io.puts(" ")
  @io.write("trackers << ")
  @tracker = Tracksperanto::Tracker.new(:name => name)
end