Skip to content

Instantly share code, notes, and snippets.

@julik
Created August 9, 2011 20:12
Show Gist options
  • Save julik/1135071 to your computer and use it in GitHub Desktop.
Save julik/1135071 to your computer and use it in GitHub Desktop.
Example for flame channel parser use
require "rubygems"
require "flame_channel_parser"
# Parse the setup into channels
channels = File.open("TW_Setup.timewarp") do | f |
FlameChannelParser.parse(f)
end
# Find the channel that we are interested in, in this case
# this is the "Timing" channel from any Timewarp setup
frame_channel = channels.find{|c| c.name == "Timing/Timing" }
# Grab the interpolator object for this channel.
interpolator = frame_channel.to_interpolator
# Now sample from frame 20 to frame 250.
# You can also sample at fractional frames if you want to.
(20..250).each do | frame_in_setup |
p interpolator.value_at(frame_in_setup)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment