lib/import/shake_script.rb in tracksperanto-2.1.1 vs lib/import/shake_script.rb in tracksperanto-2.2.0
- old
+ new
@@ -1,20 +1,21 @@
-require File.dirname(__FILE__) + "/shake_grammar/lexer"
-require File.dirname(__FILE__) + "/shake_grammar/catcher"
+require File.expand_path(File.dirname(__FILE__)) + "/shake_grammar/lexer"
+require File.expand_path(File.dirname(__FILE__)) + "/shake_grammar/catcher"
+
class Tracksperanto::Import::ShakeScript < Tracksperanto::Import::Base
def self.human_name
"Shake .shk script file"
end
def self.distinct_file_ext
".shk"
end
- def stream_parse(script_io)
+ def each
progress_proc = lambda{|msg| report_progress(msg) }
- Traxtractor.new(script_io, [method(:send_tracker), progress_proc])
+ Traxtractor.new(@io, [Proc.new, progress_proc])
end
private
# Extractor. Here we define copies of Shake's standard node creation functions.
@@ -213,9 +214,11 @@
end.compact
end
def collect_stabilizer_tracker(name, x_curve, y_curve)
return unless valid_curves?(x_curve, y_curve)
+
+ report_progress("Scavenging tracker #{name}")
keyframes = zip_curve_tuples(x_curve, y_curve).map do | (frame, x, y) |
Tracksperanto::Keyframe.new(:frame => frame - 1, :abs_x => x, :abs_y => y)
end
\ No newline at end of file