class Tracksperanto::Tool::LengthCutoff

This tool removes trackers that contain less than min_length keyframes from the exported batch

Public Class Methods

action_description() click to toggle source
# File lib/tools/length_cutoff.rb, line 7
def self.action_description
  "Remove trackers that have less than the specified number of keyframes"
end

Public Instance Methods

end_tracker_segment() click to toggle source
# File lib/tools/length_cutoff.rb, line 15
def end_tracker_segment
  return if ((min_length > 0)  && (@tracker.length < min_length))
  
  @exporter.start_tracker_segment(@tracker.name)
  @tracker.each{|kf| @exporter.export_point(kf.frame, kf.abs_x, kf.abs_y, kf.residual) }
  @exporter.end_tracker_segment
end
export_point(frame, float_x, float_y, float_residual) click to toggle source
# File lib/tools/length_cutoff.rb, line 23
def export_point(frame, float_x, float_y, float_residual)
  @tracker.keyframe! :abs_x => float_x, :abs_y => float_y, :residual => float_residual, :frame => frame
end
start_tracker_segment(name) click to toggle source
# File lib/tools/length_cutoff.rb, line 11
def start_tracker_segment(name)
  @tracker = Tracksperanto::Tracker.new(:name => name)
end