flame_channel_parser 4.0.2 → 4.2.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.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/.travis.yml +6 -1
- data/Gemfile +4 -8
- data/History.txt +12 -0
- data/{README.rdoc → README.md} +33 -14
- data/Rakefile +3 -21
- data/bin/bake_flame_channel +1 -1
- data/bin/flame_channel_inspect +26 -0
- data/flame_channel_parser.gemspec +14 -116
- data/lib/builder.rb +3 -2
- data/lib/extractor.rb +2 -2
- data/lib/flame_channel_parser/version.rb +3 -0
- data/lib/flame_channel_parser.rb +5 -9
- data/lib/framecurve_writers/base.rb +6 -4
- data/lib/framecurve_writers/batch_timewarp.rb +3 -2
- data/lib/framecurve_writers/kronos.rb +3 -2
- data/lib/framecurve_writers/softfx_timewarp.rb +2 -1
- data/lib/inspector.rb +74 -0
- data/lib/interpolator.rb +1 -0
- data/lib/parser.rb +1 -0
- data/lib/segments.rb +2 -1
- data/lib/timewarp_extractor.rb +1 -0
- data/lib/xml_parser.rb +13 -18
- data/test/stabilizer_examples/2014_cornerpin_points.stabilizer +16835 -0
- data/test/test_flame_channel_parser.rb +0 -1
- data/test/test_inspector.rb +39 -0
- data/test/test_inspector_ref_output_stabilizer.txt +76 -0
- data/test/test_inspector_ref_output_timewarp.txt +10 -0
- data/test/test_interpolator.rb +11 -3
- data/test/test_ractor.rb +30 -0
- metadata +94 -41
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
require "helper"
|
|
2
|
+
|
|
3
|
+
class TestInspector < Test::Unit::TestCase
|
|
4
|
+
REF_TIMEWARP = File.dirname(__FILE__) + "/snaps/TW.timewarp"
|
|
5
|
+
REF_TIMEWARP_OUTPUT_PATH = File.dirname(__FILE__) + "/test_inspector_ref_output_timewarp.txt"
|
|
6
|
+
|
|
7
|
+
REF_STABILIZER = File.dirname(__FILE__) + '/stabilizer_examples/2014_cornerpin_points.stabilizer'
|
|
8
|
+
REF_STABILIZER_OUTPUT_PATH = File.dirname(__FILE__) + "/test_inspector_ref_output_stabilizer.txt"
|
|
9
|
+
|
|
10
|
+
def test_inspecting_baked_timewarp_from_2011
|
|
11
|
+
data = File.open(REF_TIMEWARP)
|
|
12
|
+
channels = FlameChannelParser.parse(data)
|
|
13
|
+
|
|
14
|
+
inspector = FlameChannelParser::Inspector.new(channels)
|
|
15
|
+
output = ''
|
|
16
|
+
|
|
17
|
+
inspector.pretty_print(StringIO.new(output))
|
|
18
|
+
|
|
19
|
+
#File.open(REF_TIMEWARP_OUTPUT_PATH, 'w'){|f| f << output }
|
|
20
|
+
|
|
21
|
+
ref = File.read(REF_TIMEWARP_OUTPUT_PATH)
|
|
22
|
+
assert_equal ref, output
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def test_parsing_stabilizer_from_2014
|
|
26
|
+
data = File.open(REF_STABILIZER)
|
|
27
|
+
channels = FlameChannelParser.parse(data)
|
|
28
|
+
|
|
29
|
+
inspector = FlameChannelParser::Inspector.new(channels)
|
|
30
|
+
output = ''
|
|
31
|
+
|
|
32
|
+
inspector.pretty_print(StringIO.new(output))
|
|
33
|
+
|
|
34
|
+
#File.open(REF_STABILIZER_OUTPUT_PATH, 'w'){|f| f << output }
|
|
35
|
+
|
|
36
|
+
ref = File.read(REF_STABILIZER_OUTPUT_PATH)
|
|
37
|
+
assert_equal ref, output
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
tracker0_0
|
|
2
|
+
ref
|
|
3
|
+
x - animated, 1 key at 1, value 505.5
|
|
4
|
+
y - animated, 1 key at 1, value -496.5
|
|
5
|
+
width - no animations, value 10.0
|
|
6
|
+
height - no animations, value 10.0
|
|
7
|
+
dx - animated, 2 keys, first at 0 last at 1
|
|
8
|
+
dy - animated, 2 keys, first at 0 last at 1
|
|
9
|
+
track
|
|
10
|
+
x - no animations, value 960.0
|
|
11
|
+
y - no animations, value 540.0
|
|
12
|
+
width - no animations, value 15.0
|
|
13
|
+
height - no animations, value 15.0
|
|
14
|
+
shift
|
|
15
|
+
x - animated, 201 keys, first at 1 last at 201
|
|
16
|
+
y - animated, 201 keys, first at 1 last at 201
|
|
17
|
+
offset
|
|
18
|
+
x - no animations, value 0.0
|
|
19
|
+
y - no animations, value 0.0
|
|
20
|
+
tracker0_1
|
|
21
|
+
ref
|
|
22
|
+
x - animated, 1 key at 1, value 550.5
|
|
23
|
+
y - animated, 1 key at 1, value -12.5
|
|
24
|
+
width - no animations, value 10.0
|
|
25
|
+
height - no animations, value 10.0
|
|
26
|
+
dx - animated, 2 keys, first at 0 last at 1
|
|
27
|
+
dy - animated, 2 keys, first at 0 last at 1
|
|
28
|
+
track
|
|
29
|
+
x - no animations, value 960.0
|
|
30
|
+
y - no animations, value 540.0
|
|
31
|
+
width - no animations, value 15.0
|
|
32
|
+
height - no animations, value 15.0
|
|
33
|
+
shift
|
|
34
|
+
x - animated, 201 keys, first at 1 last at 201
|
|
35
|
+
y - animated, 201 keys, first at 1 last at 201
|
|
36
|
+
offset
|
|
37
|
+
x - no animations, value 0.0
|
|
38
|
+
y - no animations, value 0.0
|
|
39
|
+
tracker1_0
|
|
40
|
+
ref
|
|
41
|
+
x - animated, 1 key at 1, value 1409.75403
|
|
42
|
+
y - animated, 1 key at 1, value -504.210999
|
|
43
|
+
width - no animations, value 10.0
|
|
44
|
+
height - no animations, value 10.0
|
|
45
|
+
dx - animated, 2 keys, first at 0 last at 1
|
|
46
|
+
dy - animated, 2 keys, first at 0 last at 1
|
|
47
|
+
track
|
|
48
|
+
x - no animations, value 960.0
|
|
49
|
+
y - no animations, value 540.0
|
|
50
|
+
width - no animations, value 15.0
|
|
51
|
+
height - no animations, value 15.0
|
|
52
|
+
shift
|
|
53
|
+
x - animated, 201 keys, first at 1 last at 201
|
|
54
|
+
y - animated, 201 keys, first at 1 last at 201
|
|
55
|
+
offset
|
|
56
|
+
x - no animations, value 0.0
|
|
57
|
+
y - no animations, value 0.0
|
|
58
|
+
tracker1_1
|
|
59
|
+
ref
|
|
60
|
+
x - animated, 1 key at 1, value 1402.0
|
|
61
|
+
y - animated, 1 key at 1, value -13.0
|
|
62
|
+
width - no animations, value 10.0
|
|
63
|
+
height - no animations, value 10.0
|
|
64
|
+
dx - animated, 2 keys, first at 0 last at 1
|
|
65
|
+
dy - animated, 2 keys, first at 0 last at 1
|
|
66
|
+
track
|
|
67
|
+
x - no animations, value 960.0
|
|
68
|
+
y - no animations, value 540.0
|
|
69
|
+
width - no animations, value 15.0
|
|
70
|
+
height - no animations, value 15.0
|
|
71
|
+
shift
|
|
72
|
+
x - animated, 202 keys, first at 1 last at 202
|
|
73
|
+
y - animated, 202 keys, first at 1 last at 202
|
|
74
|
+
offset
|
|
75
|
+
x - no animations, value 0.0
|
|
76
|
+
y - no animations, value 0.0
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Speed - animated, 816 keys, first at 1 last at 816
|
|
2
|
+
Timing
|
|
3
|
+
Timing - animated, 816 keys, first at 1 last at 816
|
|
4
|
+
Mix
|
|
5
|
+
Mix - no animations, value 0.0
|
|
6
|
+
Trail
|
|
7
|
+
Pre_Trail - no animations, value 1.0
|
|
8
|
+
Pre_Weight - no animations, value 100.0
|
|
9
|
+
Post_Trail - no animations, value 1.0
|
|
10
|
+
Post_Weight - no animations, value 100.0
|
data/test/test_interpolator.rb
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
require "helper"
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
require File.dirname(__FILE__) + "/../lib/flame_channel_parser"
|
|
5
|
-
|
|
3
|
+
# TODO: refactor to not use the parser
|
|
6
4
|
class TestInterpolator < Test::Unit::TestCase
|
|
7
5
|
DELTA = 0.05
|
|
8
6
|
|
|
@@ -121,6 +119,16 @@ class TestInterpolator < Test::Unit::TestCase
|
|
|
121
119
|
assert_in_delta 374.75, interp.sample_at(300), DELTA
|
|
122
120
|
end
|
|
123
121
|
|
|
122
|
+
def test_xml_timewarp_with_float_frames
|
|
123
|
+
data = File.open(File.dirname(__FILE__) + "/snaps/BatchTimewarp_ext1.timewarp_node")
|
|
124
|
+
channels_in_tw = FlameChannelParser.parse(data)
|
|
125
|
+
chan = channels_in_tw.find{|c| c.name == "Timing"}
|
|
126
|
+
|
|
127
|
+
interp = chan.to_interpolator
|
|
128
|
+
assert_in_delta 1, interp.sample_at(1), DELTA
|
|
129
|
+
assert_in_delta 242.88, interp.sample_at(300), DELTA
|
|
130
|
+
end
|
|
131
|
+
|
|
124
132
|
def test_descending_linear_prepolate
|
|
125
133
|
data = File.open(File.dirname(__FILE__) + "/snaps/RefT_Steadicam.timewarp")
|
|
126
134
|
channels_in_tw = FlameChannelParser.parse(data)
|
data/test/test_ractor.rb
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require "helper"
|
|
2
|
+
|
|
3
|
+
class TestRactor < Test::Unit::TestCase
|
|
4
|
+
def test_parses_interpolates_and_builds_inside_a_ractor
|
|
5
|
+
omit "Needs Ruby 4.0+ Ractors" unless defined?(Ractor) && Ractor.method_defined?(:value)
|
|
6
|
+
|
|
7
|
+
path = File.dirname(__FILE__) + "/snaps/FLEM_curves_example.action"
|
|
8
|
+
expected = run_conversion(path)
|
|
9
|
+
|
|
10
|
+
experimental_warnings, Warning[:experimental] = Warning[:experimental], false
|
|
11
|
+
begin
|
|
12
|
+
from_ractor = Ractor.new(path) { |p| TestRactor.new("ractor").run_conversion(p) }.value
|
|
13
|
+
assert_equal expected, from_ractor
|
|
14
|
+
ensure
|
|
15
|
+
Warning[:experimental] = experimental_warnings
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def run_conversion(path)
|
|
20
|
+
channels = File.open(path, "rb") { |f| FlameChannelParser.parse(f) }
|
|
21
|
+
values = channels.reject(&:empty?).map do |channel|
|
|
22
|
+
interpolator = FlameChannelParser::Interpolator.new(channel)
|
|
23
|
+
(1..20).map { |frame| interpolator.sample_at(frame) }
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
out = StringIO.new
|
|
27
|
+
FlameChannelParser::Builder.new(out).write_block!("Channel", "foo") { |b| b.some_value 1.0 }
|
|
28
|
+
[values, out.string]
|
|
29
|
+
end
|
|
30
|
+
end
|
metadata
CHANGED
|
@@ -1,88 +1,138 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: flame_channel_parser
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.0
|
|
5
|
-
prerelease:
|
|
4
|
+
version: 4.2.0
|
|
6
5
|
platform: ruby
|
|
7
6
|
authors:
|
|
8
7
|
- Julik Tarkhanov
|
|
9
|
-
autorequire:
|
|
10
8
|
bindir: bin
|
|
11
9
|
cert_chain: []
|
|
12
|
-
date:
|
|
10
|
+
date: 2026-10-02 00:00:00.000000000 Z
|
|
13
11
|
dependencies:
|
|
14
12
|
- !ruby/object:Gem::Dependency
|
|
15
13
|
name: update_hints
|
|
16
|
-
requirement:
|
|
17
|
-
none: false
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
18
15
|
requirements:
|
|
19
|
-
- - ~>
|
|
16
|
+
- - "~>"
|
|
20
17
|
- !ruby/object:Gem::Version
|
|
21
18
|
version: '1.0'
|
|
22
19
|
type: :runtime
|
|
23
20
|
prerelease: false
|
|
24
|
-
version_requirements:
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - "~>"
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '1.0'
|
|
25
26
|
- !ruby/object:Gem::Dependency
|
|
26
27
|
name: framecurve
|
|
27
|
-
requirement:
|
|
28
|
-
none: false
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
29
|
requirements:
|
|
30
|
-
- - ~>
|
|
30
|
+
- - "~>"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version:
|
|
32
|
+
version: '2'
|
|
33
|
+
- - ">="
|
|
34
|
+
- !ruby/object:Gem::Version
|
|
35
|
+
version: 2.2.4
|
|
33
36
|
type: :runtime
|
|
34
37
|
prerelease: false
|
|
35
|
-
version_requirements:
|
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
39
|
+
requirements:
|
|
40
|
+
- - "~>"
|
|
41
|
+
- !ruby/object:Gem::Version
|
|
42
|
+
version: '2'
|
|
43
|
+
- - ">="
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: 2.2.4
|
|
36
46
|
- !ruby/object:Gem::Dependency
|
|
37
|
-
name:
|
|
38
|
-
requirement:
|
|
39
|
-
none: false
|
|
47
|
+
name: matrix
|
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
|
40
49
|
requirements:
|
|
41
|
-
- -
|
|
50
|
+
- - ">="
|
|
42
51
|
- !ruby/object:Gem::Version
|
|
43
52
|
version: '0'
|
|
44
|
-
type: :
|
|
53
|
+
type: :runtime
|
|
45
54
|
prerelease: false
|
|
46
|
-
version_requirements:
|
|
55
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
56
|
+
requirements:
|
|
57
|
+
- - ">="
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: '0'
|
|
60
|
+
- !ruby/object:Gem::Dependency
|
|
61
|
+
name: rexml
|
|
62
|
+
requirement: !ruby/object:Gem::Requirement
|
|
63
|
+
requirements:
|
|
64
|
+
- - ">="
|
|
65
|
+
- !ruby/object:Gem::Version
|
|
66
|
+
version: '0'
|
|
67
|
+
type: :runtime
|
|
68
|
+
prerelease: false
|
|
69
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
70
|
+
requirements:
|
|
71
|
+
- - ">="
|
|
72
|
+
- !ruby/object:Gem::Version
|
|
73
|
+
version: '0'
|
|
47
74
|
- !ruby/object:Gem::Dependency
|
|
48
75
|
name: rake
|
|
49
|
-
requirement:
|
|
50
|
-
none: false
|
|
76
|
+
requirement: !ruby/object:Gem::Requirement
|
|
51
77
|
requirements:
|
|
52
|
-
- -
|
|
78
|
+
- - ">="
|
|
53
79
|
- !ruby/object:Gem::Version
|
|
54
80
|
version: '0'
|
|
55
81
|
type: :development
|
|
56
82
|
prerelease: false
|
|
57
|
-
version_requirements:
|
|
83
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
84
|
+
requirements:
|
|
85
|
+
- - ">="
|
|
86
|
+
- !ruby/object:Gem::Version
|
|
87
|
+
version: '0'
|
|
58
88
|
- !ruby/object:Gem::Dependency
|
|
59
89
|
name: cli_test
|
|
60
|
-
requirement:
|
|
61
|
-
|
|
90
|
+
requirement: !ruby/object:Gem::Requirement
|
|
91
|
+
requirements:
|
|
92
|
+
- - "~>"
|
|
93
|
+
- !ruby/object:Gem::Version
|
|
94
|
+
version: '1.0'
|
|
95
|
+
type: :development
|
|
96
|
+
prerelease: false
|
|
97
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
62
98
|
requirements:
|
|
63
|
-
- - ~>
|
|
99
|
+
- - "~>"
|
|
64
100
|
- !ruby/object:Gem::Version
|
|
65
101
|
version: '1.0'
|
|
102
|
+
- !ruby/object:Gem::Dependency
|
|
103
|
+
name: test-unit
|
|
104
|
+
requirement: !ruby/object:Gem::Requirement
|
|
105
|
+
requirements:
|
|
106
|
+
- - ">="
|
|
107
|
+
- !ruby/object:Gem::Version
|
|
108
|
+
version: '0'
|
|
66
109
|
type: :development
|
|
67
110
|
prerelease: false
|
|
68
|
-
version_requirements:
|
|
111
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
112
|
+
requirements:
|
|
113
|
+
- - ">="
|
|
114
|
+
- !ruby/object:Gem::Version
|
|
115
|
+
version: '0'
|
|
69
116
|
description: Reads and interpolates animation channels in IFFS setups
|
|
70
117
|
email: me@julik.nl
|
|
71
118
|
executables:
|
|
72
119
|
- bake_flame_channel
|
|
120
|
+
- flame_channel_inspect
|
|
73
121
|
- framecurve_from_flame
|
|
74
122
|
- framecurve_to_flame
|
|
75
123
|
extensions: []
|
|
76
124
|
extra_rdoc_files:
|
|
77
|
-
- README.
|
|
125
|
+
- README.md
|
|
78
126
|
files:
|
|
79
|
-
- .autotest
|
|
80
|
-
- .
|
|
127
|
+
- ".autotest"
|
|
128
|
+
- ".gitignore"
|
|
129
|
+
- ".travis.yml"
|
|
81
130
|
- Gemfile
|
|
82
131
|
- History.txt
|
|
83
|
-
- README.
|
|
132
|
+
- README.md
|
|
84
133
|
- Rakefile
|
|
85
134
|
- bin/bake_flame_channel
|
|
135
|
+
- bin/flame_channel_inspect
|
|
86
136
|
- bin/framecurve_from_flame
|
|
87
137
|
- bin/framecurve_to_flame
|
|
88
138
|
- flame_channel_parser.gemspec
|
|
@@ -90,6 +140,7 @@ files:
|
|
|
90
140
|
- lib/channel.rb
|
|
91
141
|
- lib/extractor.rb
|
|
92
142
|
- lib/flame_channel_parser.rb
|
|
143
|
+
- lib/flame_channel_parser/version.rb
|
|
93
144
|
- lib/framecurve_writers/base.rb
|
|
94
145
|
- lib/framecurve_writers/batch_timewarp.rb
|
|
95
146
|
- lib/framecurve_writers/kronos.rb
|
|
@@ -98,6 +149,7 @@ files:
|
|
|
98
149
|
- lib/framecurve_writers/templates/SampleKronos.F_Kronos
|
|
99
150
|
- lib/framecurve_writers/templates/TW_Sample.timewarp
|
|
100
151
|
- lib/framecurve_writers/templates/key.xml
|
|
152
|
+
- lib/inspector.rb
|
|
101
153
|
- lib/interpolator.rb
|
|
102
154
|
- lib/key.rb
|
|
103
155
|
- lib/parser.rb
|
|
@@ -129,6 +181,7 @@ files:
|
|
|
129
181
|
- test/snaps/TW_SingleFrameExtrapolated_from2011.timewarp
|
|
130
182
|
- test/snaps/TW_TEST.F_Kronos
|
|
131
183
|
- test/snaps/timewarp_where_interp_fails_at_end.timewarp
|
|
184
|
+
- test/stabilizer_examples/2014_cornerpin_points.stabilizer
|
|
132
185
|
- test/test_bake_flame_channel_binary.rb
|
|
133
186
|
- test/test_base_timewarp_writer.rb
|
|
134
187
|
- test/test_batch_timewarp_writer.rb
|
|
@@ -138,9 +191,13 @@ files:
|
|
|
138
191
|
- test/test_extractor.rb
|
|
139
192
|
- test/test_flame_builder.rb
|
|
140
193
|
- test/test_flame_channel_parser.rb
|
|
194
|
+
- test/test_inspector.rb
|
|
195
|
+
- test/test_inspector_ref_output_stabilizer.txt
|
|
196
|
+
- test/test_inspector_ref_output_timewarp.txt
|
|
141
197
|
- test/test_interpolator.rb
|
|
142
198
|
- test/test_key.rb
|
|
143
199
|
- test/test_kronos_timewarp_writer.rb
|
|
200
|
+
- test/test_ractor.rb
|
|
144
201
|
- test/test_segments.rb
|
|
145
202
|
- test/test_softfx_timewarp_writer.rb
|
|
146
203
|
- test/test_timewarp_extractor.rb
|
|
@@ -159,26 +216,22 @@ files:
|
|
|
159
216
|
homepage: http://guerilla-di.org/flame-channel-parser/
|
|
160
217
|
licenses:
|
|
161
218
|
- MIT
|
|
162
|
-
|
|
219
|
+
metadata: {}
|
|
163
220
|
rdoc_options: []
|
|
164
221
|
require_paths:
|
|
165
222
|
- lib
|
|
166
223
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
167
|
-
none: false
|
|
168
224
|
requirements:
|
|
169
|
-
- -
|
|
225
|
+
- - ">="
|
|
170
226
|
- !ruby/object:Gem::Version
|
|
171
|
-
version: '
|
|
227
|
+
version: '2.6'
|
|
172
228
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
|
-
none: false
|
|
174
229
|
requirements:
|
|
175
|
-
- -
|
|
230
|
+
- - ">="
|
|
176
231
|
- !ruby/object:Gem::Version
|
|
177
232
|
version: '0'
|
|
178
233
|
requirements: []
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
signing_key:
|
|
182
|
-
specification_version: 3
|
|
234
|
+
rubygems_version: 4.0.3
|
|
235
|
+
specification_version: 4
|
|
183
236
|
summary: A parser/interpolator for Flame/Smoke animation curves
|
|
184
237
|
test_files: []
|