flame_channel_parser 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,79 @@
1
+ TimewarpFileVersion 1.0
2
+ CreationDate Tue May 24 14:40:33 2011
3
+
4
+
5
+ Fields 0
6
+ Frames 230
7
+ Origin 1
8
+ RenderType no
9
+ SamplingStep 0
10
+ Interpolation 0
11
+ FlowQuality 2
12
+ Animation
13
+ Channel Speed
14
+ Extrapolation constant
15
+ Value -200
16
+ Size 2
17
+ KeyVersion 1
18
+ Key 0
19
+ Frame 41
20
+ Value -200
21
+ Interpolation constant
22
+ RightAutomaticSlope no
23
+ LeftAutomaticSlope no
24
+ BreakSlope yes
25
+ End
26
+ Key 1
27
+ Frame 230
28
+ Value 0
29
+ Interpolation constant
30
+ RightAutomaticSlope no
31
+ LeftAutomaticSlope no
32
+ BreakSlope yes
33
+ End
34
+ Uncollapsed
35
+ End
36
+ Channel Timing/Timing
37
+ Extrapolation linear
38
+ Value 459
39
+ Size 2
40
+ KeyVersion 1
41
+ Key 0
42
+ Frame 41
43
+ Value 379
44
+ Interpolation linear
45
+ RightSlope 1
46
+ RightAutomaticSlope no
47
+ LeftAutomaticSlope no
48
+ End
49
+ Key 1
50
+ Frame 230
51
+ Value 1
52
+ Interpolation linear
53
+ RightSlope -2
54
+ LeftSlope -2
55
+ End
56
+ Uncollapsed
57
+ End
58
+ Channel Mix/Mix
59
+ Extrapolation constant
60
+ Value 0
61
+ End
62
+ Channel Trail/Pre_Trail
63
+ Extrapolation constant
64
+ Value 1
65
+ End
66
+ Channel Trail/Pre_Weight
67
+ Extrapolation constant
68
+ Value 100
69
+ End
70
+ Channel Trail/Post_Trail
71
+ Extrapolation constant
72
+ Value 1
73
+ End
74
+ Channel Trail/Post_Weight
75
+ Extrapolation constant
76
+ Value 100
77
+ End
78
+ ChannelEnd
79
+ End
@@ -0,0 +1,79 @@
1
+ TimewarpFileVersion 1.0
2
+ CreationDate Tue May 24 14:42:03 2011
3
+
4
+
5
+ Fields 0
6
+ Frames 230
7
+ Origin 1
8
+ RenderType no
9
+ SamplingStep 0
10
+ Interpolation 0
11
+ FlowQuality 2
12
+ Animation
13
+ Channel Speed
14
+ Extrapolation constant
15
+ Value -315.344
16
+ Size 2
17
+ KeyVersion 1
18
+ Key 0
19
+ Frame 41
20
+ Value -315.344
21
+ Interpolation constant
22
+ RightAutomaticSlope no
23
+ LeftAutomaticSlope no
24
+ BreakSlope yes
25
+ End
26
+ Key 1
27
+ Frame 230
28
+ Value 0
29
+ Interpolation constant
30
+ RightAutomaticSlope no
31
+ LeftAutomaticSlope no
32
+ BreakSlope yes
33
+ End
34
+ Uncollapsed
35
+ End
36
+ Channel Timing/Timing
37
+ Extrapolation linear
38
+ Value 379
39
+ Size 2
40
+ KeyVersion 1
41
+ Key 0
42
+ Frame 41
43
+ Value 379
44
+ Interpolation linear
45
+ RightSlope 1
46
+ RightAutomaticSlope no
47
+ LeftAutomaticSlope no
48
+ End
49
+ Key 1
50
+ Frame 230
51
+ Value -217
52
+ Interpolation linear
53
+ RightSlope -3.15344
54
+ LeftSlope -3.15344
55
+ End
56
+ Uncollapsed
57
+ End
58
+ Channel Mix/Mix
59
+ Extrapolation constant
60
+ Value 0
61
+ End
62
+ Channel Trail/Pre_Trail
63
+ Extrapolation constant
64
+ Value 1
65
+ End
66
+ Channel Trail/Pre_Weight
67
+ Extrapolation constant
68
+ Value 100
69
+ End
70
+ Channel Trail/Post_Trail
71
+ Extrapolation constant
72
+ Value 1
73
+ End
74
+ Channel Trail/Post_Weight
75
+ Extrapolation constant
76
+ Value 100
77
+ End
78
+ ChannelEnd
79
+ End
@@ -0,0 +1,80 @@
1
+ TimewarpFileVersion 1.0
2
+ CreationDate Tue May 24 14:45:21 2011
3
+
4
+
5
+ Fields 0
6
+ Frames 230
7
+ Origin 1
8
+ RenderType no
9
+ SamplingStep 0
10
+ Interpolation 0
11
+ FlowQuality 2
12
+ Animation
13
+ Channel Speed
14
+ Extrapolation constant
15
+ Value -761.93
16
+ Size 2
17
+ KeyVersion 1
18
+ Key 0
19
+ Frame 41
20
+ Value -761.93
21
+ Interpolation hermite
22
+ RightAutomaticSlope no
23
+ LeftAutomaticSlope no
24
+ BreakSlope yes
25
+ End
26
+ Key 1
27
+ Frame 230
28
+ Value 0
29
+ Interpolation constant
30
+ LeftSlope -14.1773
31
+ RightAutomaticSlope no
32
+ LeftAutomaticSlope no
33
+ BreakSlope yes
34
+ End
35
+ Uncollapsed
36
+ End
37
+ Channel Timing/Timing
38
+ Extrapolation linear
39
+ Value 379
40
+ Size 2
41
+ KeyVersion 1
42
+ Key 0
43
+ Frame 41
44
+ Value 379
45
+ Interpolation hermite
46
+ RightSlope -7.6193
47
+ RightAutomaticSlope no
48
+ LeftAutomaticSlope no
49
+ End
50
+ Key 1
51
+ Frame 230
52
+ Value -217
53
+ Interpolation linear
54
+ RightSlope -3.15344
55
+ LeftSlope -3.15344
56
+ End
57
+ Uncollapsed
58
+ End
59
+ Channel Mix/Mix
60
+ Extrapolation constant
61
+ Value 0
62
+ End
63
+ Channel Trail/Pre_Trail
64
+ Extrapolation constant
65
+ Value 1
66
+ End
67
+ Channel Trail/Pre_Weight
68
+ Extrapolation constant
69
+ Value 100
70
+ End
71
+ Channel Trail/Post_Trail
72
+ Extrapolation constant
73
+ Value 1
74
+ End
75
+ Channel Trail/Post_Weight
76
+ Extrapolation constant
77
+ Value 100
78
+ End
79
+ ChannelEnd
80
+ End
@@ -0,0 +1,26 @@
1
+ require "test/unit"
2
+ require "stringio"
3
+
4
+ require File.dirname(__FILE__) + "/../lib/flame_channel_parser"
5
+
6
+ class TestExtractor < Test::Unit::TestCase
7
+ def test_basic_op
8
+ io = StringIO.new
9
+ FlameChannelParser::Extractor.extract(File.dirname(__FILE__) + "/snaps/RefT_Steadicam.timewarp", :destination => io)
10
+ assert_equal File.read(File.dirname(__FILE__) + "/snaps/RefT_Steadicam_Extraction.txt"), io.string
11
+ end
12
+
13
+ def test_frame_overrides
14
+ io = StringIO.new
15
+ o = {:destination => io, :start_frame => 19, :end_frame => 347 }
16
+ FlameChannelParser::Extractor.extract(File.dirname(__FILE__) + "/snaps/RefT_Steadicam.timewarp", o)
17
+
18
+ assert_equal File.read(File.dirname(__FILE__) + "/snaps/RefT_Steadicam_Extraction_F19_to_347.txt"), io.string
19
+ end
20
+
21
+ def test_raises_on_Missing_channel
22
+ assert_raise(FlameChannelParser::Extractor::ChannelNotFoundError) do
23
+ FlameChannelParser::Extractor.extract(File.dirname(__FILE__) + "/snaps/RefT_Steadicam.timewarp", :channel => "foo/bar")
24
+ end
25
+ end
26
+ end
@@ -18,7 +18,7 @@ class TestFlameChannelParser < Test::Unit::TestCase
18
18
  assert_kind_of Array, channels
19
19
  assert_equal 1, channels.length, "Should find one channel"
20
20
 
21
- assert_kind_of FlameChannelParser::Parser2011::ChannelBlock, channels[0]
21
+ assert_kind_of FlameChannelParser::Parser2011::Channel, channels[0]
22
22
 
23
23
  ch = channels[0]
24
24
  assert_equal 4, ch.length
@@ -39,7 +39,12 @@ class TestFlameChannelParser < Test::Unit::TestCase
39
39
  channels.reject!{|c| c.length < 2 }
40
40
  assert_equal 2, channels.length, "Should have 2 channels with more than 2 keyframes"
41
41
  last_chan = channels[-1]
42
+
42
43
  assert_equal "position/y", last_chan.name
44
+ assert_equal "Axis", last_chan.node_type
45
+ assert_equal "axis1", last_chan.node_name
46
+ assert_equal "axis1/position/y", last_chan.path
47
+
43
48
  assert_equal 6, last_chan.length
44
49
  i = last_chan.to_interpolator
45
50
  assert_kind_of FlameChannelParser::Interpolator, i
@@ -105,4 +105,46 @@ class TestInterpolator < Test::Unit::TestCase
105
105
  assert_in_delta 374.75, interp.sample_at(300), DELTA
106
106
  end
107
107
 
108
+ def test_descending_linear_prepolate
109
+ data = File.open(File.dirname(__FILE__) + "/snaps/RefT_Steadicam.timewarp")
110
+ channels_in_tw = FlameChannelParser.parse(data)
111
+ chan = channels_in_tw.find{|c| c.name == "Timing/Timing"}
112
+
113
+ interp = chan.to_interpolator
114
+ assert_in_delta 459, interp.sample_at(1), DELTA
115
+ assert_in_delta 421, interp.sample_at(20), DELTA
116
+ assert_in_delta 1, interp.sample_at(230), DELTA
117
+ end
118
+
119
+ def test_descending_linear_prepolate_two_KFs
120
+ data = File.open(File.dirname(__FILE__) + "/snaps/RefT_Steadicam_TwoKFs.timewarp")
121
+ channels_in_tw = FlameChannelParser.parse(data)
122
+ chan = channels_in_tw.find{|c| c.name == "Timing/Timing"}
123
+
124
+ interp = chan.to_interpolator
125
+ assert_in_delta 459, interp.sample_at(1), DELTA
126
+ assert_in_delta 421, interp.sample_at(20), DELTA
127
+ assert_in_delta 1, interp.sample_at(230), DELTA
128
+ assert_in_delta -39, interp.sample_at(250), DELTA
129
+ end
130
+
131
+ def test_descending_linear_prepolate_two_KFs_different_slope
132
+ data = File.open(File.dirname(__FILE__) + "/snaps/RefT_Steadicam_TwoKFs_AnotherSlope.timewarp")
133
+ channels_in_tw = FlameChannelParser.parse(data)
134
+ chan = channels_in_tw.find{|c| c.name == "Timing/Timing"}
135
+
136
+ interp = chan.to_interpolator
137
+ assert_in_delta 379, interp.sample_at(41), DELTA
138
+ assert_in_delta 505.138, interp.sample_at(1), DELTA
139
+ end
140
+
141
+ def test_descending_linear_prepolate_hermite
142
+ data = File.open(File.dirname(__FILE__) + "/snaps/RefT_Steadicam_TwoKFs_HermiteAtBegin.timewarp")
143
+ channels_in_tw = FlameChannelParser.parse(data)
144
+ chan = channels_in_tw.find{|c| c.name == "Timing/Timing"}
145
+
146
+ interp = chan.to_interpolator
147
+ assert_in_delta 379, interp.sample_at(41), DELTA
148
+ assert_in_delta 683.772, interp.sample_at(1), DELTA
149
+ end
108
150
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flame_channel_parser
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 2
8
+ - 3
9
9
  - 0
10
- version: 1.2.0
10
+ version: 1.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Julik Tarkhanov
@@ -15,13 +15,27 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-20 00:00:00 +02:00
18
+ date: 2011-05-25 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- name: hoe
22
+ name: update_hints
23
23
  prerelease: false
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: hoe
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
25
39
  none: false
26
40
  requirements:
27
41
  - - ">="
@@ -33,14 +47,14 @@ dependencies:
33
47
  - 1
34
48
  version: 2.9.1
35
49
  type: :development
36
- version_requirements: *id001
50
+ version_requirements: *id002
37
51
  description: |-
38
52
  Includes a small library for extracting, parsing and baking animation curves made on Discrodesk Floke/Inflinto, also known as flame.
39
53
  Thanks to Marijn Eken, Philippe Soeiro and Andre Gagnon for their support and advice.
40
54
  email:
41
55
  - me@julik.nl
42
- executables: []
43
-
56
+ executables:
57
+ - bake_flame_channel
44
58
  extensions: []
45
59
 
46
60
  extra_rdoc_files:
@@ -53,13 +67,13 @@ files:
53
67
  - Manifest.txt
54
68
  - README.rdoc
55
69
  - Rakefile
70
+ - bin/bake_flame_channel
71
+ - lib/extractor.rb
56
72
  - lib/flame_channel_parser.rb
57
73
  - lib/interpolator.rb
58
74
  - lib/parser_2011.rb
59
75
  - lib/parser_2012.rb
60
76
  - lib/segments.rb
61
- - plots.numbers
62
- - plots_2012.numbers
63
77
  - test/channel_with_constants.dat
64
78
  - test/sample_channel.dat
65
79
  - test/snaps/FLEM_BrokenTangents.action
@@ -69,8 +83,16 @@ files:
69
83
  - test/snaps/FLEM_curves_example.action
70
84
  - test/snaps/FLEM_curves_example_migrated_to_2012.action
71
85
  - test/snaps/FLEM_std_curve.png
86
+ - test/snaps/RefT_Steadicam.timewarp
87
+ - test/snaps/RefT_Steadicam_Baked.timewarp
88
+ - test/snaps/RefT_Steadicam_Extraction.txt
89
+ - test/snaps/RefT_Steadicam_Extraction_F19_to_347.txt
90
+ - test/snaps/RefT_Steadicam_TwoKFs.timewarp
91
+ - test/snaps/RefT_Steadicam_TwoKFs_AnotherSlope.timewarp
92
+ - test/snaps/RefT_Steadicam_TwoKFs_HermiteAtBegin.timewarp
72
93
  - test/snaps/TW.timewarp
73
94
  - test/snaps/TW_SingleFrameExtrapolated_from2011.timewarp
95
+ - test/test_extractor.rb
74
96
  - test/test_flame_channel_parser.rb
75
97
  - test/test_interpolator.rb
76
98
  - test/test_segments.rb
@@ -111,6 +133,7 @@ signing_key:
111
133
  specification_version: 3
112
134
  summary: Includes a small library for extracting, parsing and baking animation curves made on Discrodesk Floke/Inflinto, also known as flame
113
135
  test_files:
136
+ - test/test_extractor.rb
114
137
  - test/test_flame_channel_parser.rb
115
138
  - test/test_interpolator.rb
116
139
  - test/test_segments.rb
Binary file
Binary file