Sha256: c1e981dff2d68b9e11db77983d401a5b3b43bac821dabe17018f76faf2deb12c

Contents?: true

Size: 1.3 KB

Versions: 42

Compression:

Stored size: 1.3 KB

Contents

# -*- encoding : utf-8 -*-
# Export for Autodesk MatchMover/Image Modeler
class Tracksperanto::Export::MatchMover < Tracksperanto::Export::Base
  
  def self.desc_and_extension
    "matchmover.rz2"
  end
  
  def self.human_name
    "MatchMover REALVIZ Ascii Point Tracks .rz2 file"
  end
  
  PREAMBLE = %[imageSequence	"Sequence 01"\n{\n\t%d\t%d\tf( "D:/temp/sequence.%%04d.dpx" )\tb( 1 211 1 )\t\n}\n]
  TRACKER_PREAMBLE = "pointTrack  %s  rgb( 255 0 0 )	\n{\n"
  TRACKER_POSTAMBLE = "}\n"
  FIRST_KEYFRAME_TEMPLATE = "\t%d\t   %.3f     %.3f    ki( 0.8 )\t    s( 66 66 64 64 )  p( 24 24 25 25 )"
  KEYFRAME_TEMPLATE = "\t%d\t   %.3f     %.3f     p+( %.6f )\t"
  
  def start_export( img_width, img_height)
    @height = img_height
    @io.puts(PREAMBLE % [img_width, img_height])
  end
  
  def start_tracker_segment(tracker_name)
    @tracker_name = tracker_name
    @at_first_point = true
    @io.write(TRACKER_PREAMBLE % tracker_name.inspect)
  end
  
  def end_tracker_segment
    @io.write(TRACKER_POSTAMBLE)
  end
  
  def export_point(frame, abs_float_x, abs_float_y, float_residual)
    template = @at_first_point ? FIRST_KEYFRAME_TEMPLATE : KEYFRAME_TEMPLATE
    values = [frame + 1, abs_float_x, @height - abs_float_y, (1 - float_residual)]
    @io.puts(template % values)
    @at_first_point = false
  end
  
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
tracksperanto-3.5.9 lib/export/match_mover.rb
tracksperanto-3.5.8 lib/export/match_mover.rb
tracksperanto-3.5.7 lib/export/match_mover.rb
tracksperanto-3.5.6 lib/export/match_mover.rb
tracksperanto-3.5.5 lib/export/match_mover.rb
tracksperanto-3.5.4 lib/export/match_mover.rb
tracksperanto-3.5.2 lib/export/match_mover.rb
tracksperanto-3.5.1 lib/export/match_mover.rb
tracksperanto-3.5.0 lib/export/match_mover.rb
tracksperanto-3.4.1 lib/export/match_mover.rb
tracksperanto-3.4.0 lib/export/match_mover.rb
tracksperanto-3.3.13 lib/export/match_mover.rb
tracksperanto-3.3.12 lib/export/match_mover.rb
tracksperanto-3.3.11 lib/export/match_mover.rb
tracksperanto-3.3.10 lib/export/match_mover.rb
tracksperanto-3.3.9 lib/export/match_mover.rb
tracksperanto-3.3.8 lib/export/match_mover.rb
tracksperanto-3.3.7 lib/export/match_mover.rb
tracksperanto-3.3.6 lib/export/match_mover.rb
tracksperanto-3.3.0.pre lib/export/match_mover.rb