Class: Tracksperanto::Tool::LengthCutoff
- Defined in:
- lib/tools/length_cutoff.rb
Overview
This tool removes trackers that contain less than min_length keyframes from the exported batch
Class Method Summary collapse
Instance Method Summary collapse
- #end_tracker_segment ⇒ Object
- #export_point(frame, float_x, float_y, float_residual) ⇒ Object
- #start_tracker_segment(name) ⇒ Object
Methods inherited from Base
Methods included from Parameters
included, #parameter, #parameters
Methods included from SimpleExport
Methods included from ConstName
Methods included from BlockInit
Methods included from Casts
#cast_to_bool, #cast_to_float, #cast_to_int, #cast_to_string, included
Constructor Details
This class inherits a constructor from Tracksperanto::Tool::Base
Class Method Details
.action_description ⇒ Object
8 9 10 |
# File 'lib/tools/length_cutoff.rb', line 8 def self.action_description "Remove trackers that have less than the specified number of keyframes" end |
Instance Method Details
#end_tracker_segment ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/tools/length_cutoff.rb', line 16 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) ⇒ Object
24 25 26 |
# File 'lib/tools/length_cutoff.rb', line 24 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) ⇒ Object
12 13 14 |
# File 'lib/tools/length_cutoff.rb', line 12 def start_tracker_segment(name) @tracker = Tracksperanto::Tracker.new(:name => name) end |