Class: FlameChannelParser::FramecurveWriters::Kronos

Inherits:
SoftfxTimewarp show all
Defined in:
lib/framecurve_writers/kronos.rb

Overview

Writes out a framecurve setup

Constant Summary collapse

TOKEN =
Regexp.new('__INSERT_FRAME_ANIM__')
TEMPLATE =
File.dirname(__FILE__) + "/templates/SampleKronos.F_Kronos"

Constants inherited from SoftfxTimewarp

SoftfxTimewarp::DATETIME_FORMAT, SoftfxTimewarp::TIME

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

inherited, #run_export_from_framecurve, with_each_writer

Class Method Details

.extensionObject



6
7
8
# File 'lib/framecurve_writers/kronos.rb', line 6

def self.extension
  '.F_Kronos'
end

Instance Method Details

#run_export(io) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/framecurve_writers/kronos.rb', line 10

def run_export(io)
  buf = StringIO.new
  w = FlameChannelParser::Builder.new(buf)
  w.channel("Frame") do | c |
    writer = KeyWriter.new
    yield(writer)
    write_animation(writer.keys, c, :linear)
  end
  
  # Entab everything
  template = File.read(TEMPLATE)
  io.write(template.gsub(TOKEN, buf.string))
end