Sha256: a46ec41437b8521099b8d3bc85c17dd829b4ceda9b48a423fe44adbe03def81d

Contents?: true

Size: 932 Bytes

Versions: 5

Compression:

Stored size: 932 Bytes

Contents

class Tracksperanto::Export::Pftrack < Tracksperanto::Export::Base
    
    # Should return the suffix and extension of this export file (like "_flame.stabilizer")
    def self.desc_and_extension
      "pftrack.2dt"
    end
    
    def start_tracker_segment(tracker_name)
      # If there was a previous tracker, write it out
      # - now we know how many keyframes it has
      if @prev_tracker && @prev_tracker.any?
        block = [
          "\n",
          @tracker_name.inspect, # "autoquotes"
          @prev_tracker.length,
          @prev_tracker.join("\n")
        ]
        @io.puts block.join("\n")
      end
      
      # Setup for the next tracker
      @prev_tracker = []
      @tracker_name = tracker_name
    end
    
    def export_point(frame, abs_float_x, abs_float_y, float_residual)
      line = "%s %.3f %.3f %.3f" % [frame, abs_float_x, abs_float_y, float_residual]
      @prev_tracker << line
    end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tracksperanto-1.0.6 lib/export/pftrack.rb
tracksperanto-1.0.4 lib/export/pftrack.rb
tracksperanto-1.0.2 lib/export/pftrack.rb
tracksperanto-1.0.1 lib/export/pftrack.rb
tracksperanto-1.0.0 lib/export/pftrack.rb