Sha256: 9ebf593b0630880c7bc9b25d40c97b3e5d78ae416487d34af3c67f8a1d5aa3f0

Contents?: true

Size: 842 Bytes

Versions: 33

Compression:

Stored size: 842 Bytes

Contents

# Export for PFTrack .2dt files
class Tracksperanto::Export::PFTrack4 < Tracksperanto::Export::Base
    
    KEYFRAME_TEMPLATE = "%s %.3f %.3f %.3f"
    
    def self.desc_and_extension
      "pftrack_v4.2dt"
    end
    
    def self.human_name
      "PFTrack v4 .2dt file"
    end
    
    def start_tracker_segment(tracker_name)
      # Setup for the next tracker
      @prev_tracker = []
      @tracker_name = tracker_name
    end
    
    def end_tracker_segment
      block = [ "\n",
        @tracker_name.inspect, # "autoquotes"
        @prev_tracker.length,
        @prev_tracker.join("\n") ]
      @io.puts block.join("\n")
    end
    
    def export_point(frame, abs_float_x, abs_float_y, float_residual)
      line = KEYFRAME_TEMPLATE % [frame, abs_float_x, abs_float_y, float_residual / 8]
      @prev_tracker << line
    end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
tracksperanto-1.5.5 lib/export/pftrack.rb
tracksperanto-1.5.4 lib/export/pftrack.rb
tracksperanto-1.5.3 lib/export/pftrack.rb
tracksperanto-1.5.2 lib/export/pftrack.rb
tracksperanto-1.5.1 lib/export/pftrack.rb
tracksperanto-1.5.0 lib/export/pftrack.rb
tracksperanto-1.4.0 lib/export/pftrack.rb
tracksperanto-1.2.6 lib/export/pftrack.rb
tracksperanto-1.3.1 lib/export/pftrack.rb
tracksperanto-1.3.0 lib/export/pftrack.rb
tracksperanto-1.2.4 lib/export/pftrack.rb
tracksperanto-1.2.3 lib/export/pftrack.rb
tracksperanto-1.2.2 lib/export/pftrack.rb