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.5.9 lib/export/ruby.rb
tracksperanto-3.5.8 lib/export/ruby.rb
tracksperanto-3.5.7 lib/export/ruby.rb
tracksperanto-3.5.6 lib/export/ruby.rb
tracksperanto-3.5.5 lib/export/ruby.rb
tracksperanto-3.5.4 lib/export/ruby.rb
tracksperanto-3.5.2 lib/export/ruby.rb
tracksperanto-3.5.1 lib/export/ruby.rb
tracksperanto-3.5.0 lib/export/ruby.rb
tracksperanto-3.4.1 lib/export/ruby.rb
tracksperanto-3.4.0 lib/export/ruby.rb
tracksperanto-3.3.13 lib/export/ruby.rb
tracksperanto-3.3.12 lib/export/ruby.rb
tracksperanto-3.3.11 lib/export/ruby.rb
tracksperanto-3.3.10 lib/export/ruby.rb
tracksperanto-3.3.9 lib/export/ruby.rb
tracksperanto-3.3.8 lib/export/ruby.rb
tracksperanto-3.3.7 lib/export/ruby.rb
tracksperanto-3.3.6 lib/export/ruby.rb
tracksperanto-3.3.0.pre lib/export/ruby.rb