lib/import/flame_stabilizer.rb in tracksperanto-1.6.4 vs lib/import/flame_stabilizer.rb in tracksperanto-1.6.5
- old
+ new
@@ -68,11 +68,13 @@
raise "Did not detect any keyframes!"
end
end
def parse(io)
+ report_progress("Extracting setup size")
self.width, self.height = extract_width_and_height_from_stream(io)
+ report_progress("Extracting all animation channels")
channels = extract_channels_from_stream(io)
raise "The setup contained no channels that we could process" if channels.empty?
raise "A channel was nil" if channels.find{|e| e.nil? }
@@ -138,10 +140,11 @@
channels = []
channel_matcher = /Channel (.+)\n/
until io.eof?
line = io.gets
if line =~ channel_matcher
+ report_progress("Extracting channel #{$1}")
channels << extract_channel_from(io, $1)
end
end
channels
end
@@ -153,10 +156,11 @@
REF_CHANNEL = "ref" # or "track" - sometimes works sometimes don't
def scavenge_trackers_from_channels(channels)
trackers = []
channels.select{|e| e.name =~ /\/#{REF_CHANNEL}\/x/}.each do | track_x |
+ report_progress("Detected reference channel #{track_x}")
trackers << grab_tracker(channels, track_x)
end
trackers
end
@@ -172,9 +176,10 @@
shift_tuples = zip_curve_tuples(shift_x, shift_y)
track_tuples = zip_curve_tuples(track_x, track_y)
base_x, base_y = begin
+ report_progress("Detecting base value")
find_base_x_and_y(track_tuples, shift_tuples)
rescue UseBase
[track_x.base_value, track_y.base_value]
end
\ No newline at end of file