lib/middleware/lerp.rb in tracksperanto-2.9.5 vs lib/middleware/lerp.rb in tracksperanto-2.9.6
- old
+ new
@@ -1,17 +1,20 @@
# -*- encoding : utf-8 -*-
# This middleware adds linearly interpolated keyframes BETWEEN the keyframes passing through the exporter
class Tracksperanto::Middleware::Lerp < Tracksperanto::Middleware::Base
- attr_accessor :enabled
+ def self.action_description
+ "Interpolate missing keyframes of all the trackers"
+ end
+
def end_tracker_segment
@last_f, @last_x, @last_y, @last_res = nil, nil, nil, nil
super
end
def export_point(frame, float_x, float_y, float_residual)
- if @enabled && @last_f && (frame - @last_f > 1) # Interpolate!
+ if @last_f && (frame - @last_f > 1) # Interpolate!
interpolated_frames = []
interpolated_x = []
lerp(@last_f, @last_x, frame, float_x) do | interp_f, interp_x |
interpolated_frames << interp_f
interpolated_x << interp_x