Sha256: 8c10827af41933d41173d67de86cfc68e30885e774b366656964cbbf41157492

Contents?: true

Size: 891 Bytes

Versions: 42

Compression:

Stored size: 891 Bytes

Contents

# -*- encoding : utf-8 -*-
# Exports the trackers to a script that is fit for massaging with Tracksperanto as is
class Tracksperanto::Export::Ruby < Tracksperanto::Export::Base
  
  def self.desc_and_extension
    "tracksperanto_ruby.rb"
  end
  
  def self.human_name
    "Bare Ruby code"
  end
  
  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
  
  def start_tracker_segment(name)
    @io.puts(" ")
    @io.write("trackers << ")
    @tracker = Tracksperanto::Tracker.new(:name => name)
  end
  
  def export_point(f, x, y, r)
    @tracker.keyframe! :frame => f, :abs_x => x, :abs_y => y, :residual => r
  end
  
  def end_tracker_segment
    @io.puts(@tracker.to_ruby)# Just leave that
  end
  
  def end_export
    @io.puts(" ")
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
tracksperanto-3.2.2 lib/export/ruby.rb
tracksperanto-3.2.1 lib/export/ruby.rb
tracksperanto-3.2.0 lib/export/ruby.rb
tracksperanto-3.1.0 lib/export/ruby.rb
tracksperanto-3.0.1 lib/export/ruby.rb
tracksperanto-3.0.0 lib/export/ruby.rb
tracksperanto-2.12.0 lib/export/ruby.rb
tracksperanto-2.11.3 lib/export/ruby.rb
tracksperanto-2.11.2 lib/export/ruby.rb
tracksperanto-2.11.1 lib/export/ruby.rb
tracksperanto-2.11.0 lib/export/ruby.rb
tracksperanto-2.10.0 lib/export/ruby.rb
tracksperanto-2.9.9 lib/export/ruby.rb
tracksperanto-2.9.8 lib/export/ruby.rb
tracksperanto-2.9.7 lib/export/ruby.rb
tracksperanto-2.9.6 lib/export/ruby.rb
tracksperanto-2.9.5 lib/export/ruby.rb
tracksperanto-2.9.4 lib/export/ruby.rb
tracksperanto-2.9.3 lib/export/ruby.rb
tracksperanto-2.9.2 lib/export/ruby.rb