Sha256: 1f82be3b59d6407ce5e253a58ff1bfb76074dcd5e576637a718162b6a890f6f1

Contents?: true

Size: 1.25 KB

Versions: 4

Compression:

Stored size: 1.25 KB

Contents

require 'stringio'

class Tracksperanto::Import::FlameStabilizer < Tracksperanto::Import::Base
  # Flame records channels in it's .stabilizer file. Per tracker, we use tracker1/track/x and tracker1/track/y as the base
  # tracking value. Then, the tracker1/shift/x and tracker1/shift/y are added to it. The problem is that when we track backwards
  # the main reference keyframe for the x and y coordinates that sets the base for the animation might be at the last frame, at
  # a frame in the middle or in the end of the setup. We have to pluck it out and then we compute the shift relative to the values
  # in this main frame. Obviously we discard the track width and search width information as we cannot use it in any meaningful way.
  #
  # Here is how the relevant portions look like this (note the tab indents, not spaces, indentation starts at hashmark)
  #Channel tracker1/shift/x
  #	Extrapolation linear
  #	Value 0
  #	Size 185
  #	KeyVersion 1
  #	Key 0
  #		Frame 1
  #		Value 0
  #		Interpolation linear
  #		RightSlope 0.15802
  #		LeftSlope 0.15802
  #		End
  #	Key 1
  #
  # This is in big lines:
  # (tabs)Key(space)Value
  def parse(stabilizer_setup_content)
    trackers = []
    
    io = StringIO.new(stabilizer_setup_content)
    
    trackers
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tracksperanto-1.0.4 lib/import/flame_stabilizer.rb
tracksperanto-1.0.2 lib/import/flame_stabilizer.rb
tracksperanto-1.0.1 lib/import/flame_stabilizer.rb
tracksperanto-1.0.0 lib/import/flame_stabilizer.rb