tracksperanto 3.2.2 → 3.3.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -2
- data/lib/export/flame_stabilizer_cornerpin.rb +9 -7
- data/lib/import/nuke_script.rb +13 -20
- data/test/import/test_nuke_import.rb +0 -13
- data/tracksperanto.gemspec +12 -7
- metadata +40 -9
- data/lib/import/nuke_grammar/utils.rb +0 -33
data/Gemfile
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
source :rubygems
|
3
3
|
|
4
|
-
# gem "bychar", "~> 1.1" - controlled by Tickly
|
5
4
|
gem "obuf", "~> 1.1"
|
6
|
-
gem "tickly", "~>
|
5
|
+
gem "tickly", "~> 2.0"
|
6
|
+
gem "bychar"
|
7
7
|
gem "progressive_io", "~> 1.0"
|
8
8
|
gem "flame_channel_parser", "~> 4.0"
|
9
9
|
gem "progressbar", "0.10.0"
|
@@ -12,17 +12,19 @@ class Tracksperanto::Export::FlameStabilizerCornerpin < Tracksperanto::Export::F
|
|
12
12
|
end
|
13
13
|
|
14
14
|
# The trackers for cornerpins should go in Z order, like this
|
15
|
-
#
|
16
|
-
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
15
|
+
#
|
16
|
+
# TL(0)---->TR(1)
|
17
|
+
# /
|
18
|
+
# /
|
19
|
+
# /
|
20
|
+
# /
|
21
|
+
# BL(2)----->BR(3)
|
22
|
+
#
|
20
23
|
# This "kinda tool" ensures that this is indeed taking place
|
21
|
-
class Sorter
|
24
|
+
class Sorter
|
22
25
|
include Tracksperanto::SimpleExport # so that it calls OUR methods
|
23
26
|
|
24
27
|
def initialize(exporter)
|
25
|
-
__setobj__(exporter)
|
26
28
|
@exp = exporter
|
27
29
|
end
|
28
30
|
|
data/lib/import/nuke_script.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
require 'tickly'
|
3
|
-
require File.expand_path(File.dirname(__FILE__)) + "/nuke_grammar/utils"
|
4
3
|
|
5
4
|
class Tracksperanto::Import::NukeScript < Tracksperanto::Import::Base
|
6
5
|
|
@@ -17,21 +16,16 @@ class Tracksperanto::Import::NukeScript < Tracksperanto::Import::Base
|
|
17
16
|
end
|
18
17
|
|
19
18
|
def each
|
20
|
-
parser = Tickly::
|
21
|
-
|
19
|
+
parser = Tickly::NodeProcessor.new
|
20
|
+
parser.add_node_handler_class(Tracker3)
|
21
|
+
parser.add_node_handler_class(Reconcile3D)
|
22
|
+
parser.add_node_handler_class(PlanarTracker1_0)
|
23
|
+
parser.add_node_handler_class(Tracker4)
|
22
24
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
evaluator.add_node_handler_class(Tracker4)
|
28
|
-
|
29
|
-
script_tree.each do | node |
|
30
|
-
evaluator.evaluate(node) do | node_object |
|
31
|
-
node_object.trackers.each do | t |
|
32
|
-
report_progress("Scavenging tracker #{t.name}")
|
33
|
-
yield t
|
34
|
-
end
|
25
|
+
parser.parse(@io) do | node |
|
26
|
+
node.trackers.each do | t |
|
27
|
+
report_progress("Scavenging tracker #{t.name}")
|
28
|
+
yield t
|
35
29
|
end
|
36
30
|
end
|
37
31
|
end
|
@@ -70,11 +64,10 @@ class Tracksperanto::Import::NukeScript < Tracksperanto::Import::Base
|
|
70
64
|
end
|
71
65
|
|
72
66
|
def extract_curves_from_channel(point_channel)
|
73
|
-
u = Tracksperanto::NukeGrammarUtils.new
|
74
67
|
# First element is the :c curly identifier
|
75
68
|
point_channel[1..-1].map do | curve_argument |
|
76
69
|
if curve_argument[1] == "curve"
|
77
|
-
|
70
|
+
Tickly::Curve.new(curve_argument)
|
78
71
|
else
|
79
72
|
nil
|
80
73
|
end
|
@@ -117,14 +110,14 @@ class Tracksperanto::Import::NukeScript < Tracksperanto::Import::Base
|
|
117
110
|
# "key_search_t", "key_track_x", "key_track_y", "key_track_r", "key_track_t", "key_centre_offset_x", "key_centre_offset_y")
|
118
111
|
tracker_rows = values[0]
|
119
112
|
|
120
|
-
u = Tracksperanto::NukeGrammarUtils.new
|
121
|
-
|
122
113
|
# The 0 element is the :c symbol
|
123
114
|
tracker_rows[1..-1].each do | row |
|
124
115
|
row_content = row[0]
|
125
116
|
|
126
117
|
# For offsets see above
|
127
|
-
point_name
|
118
|
+
point_name = row_content[2]
|
119
|
+
x_curve = Tickly::Curve.new(row_content[3])
|
120
|
+
y_curve = Tickly::Curve.new(row_content[4])
|
128
121
|
|
129
122
|
full_name = [options["name"], point_name].join('_')
|
130
123
|
tracker = package_tracker(full_name, x_curve, y_curve)
|
@@ -157,19 +157,6 @@ class NukeImportTest < Test::Unit::TestCase
|
|
157
157
|
assert_in_delta 510.107, sec_tracker.keyframes[-1].abs_y, DELTA
|
158
158
|
end
|
159
159
|
|
160
|
-
def test_parsing_nuke_curve
|
161
|
-
curve = [:c] + %w( curve x742 888 890.2463989 891.6602783
|
162
|
-
893.5056763 895.6155396 s95 897.2791748 899.1762695
|
163
|
-
x754 912.0731812 x755 913.7190552 916.0959473 918.1025391 920.0751953 922.1898804 )
|
164
|
-
p = Tracksperanto::NukeGrammarUtils.new
|
165
|
-
result = p.parse_curve(curve)
|
166
|
-
assert_kind_of Array, result
|
167
|
-
assert_equal 13, result.length
|
168
|
-
assert_equal 742, result[0][0]
|
169
|
-
assert_equal 754, result[7][0]
|
170
|
-
end
|
171
|
-
|
172
|
-
|
173
160
|
def test_zip_channels
|
174
161
|
tuples_x = [[1, 125], [3, 234], [5, 456], [9,876]]
|
175
162
|
tuples_y = [[2, 437], [3, 123], [6, 432], [9, 430]]
|
data/tracksperanto.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "tracksperanto"
|
8
|
-
s.version = "3.
|
8
|
+
s.version = "3.3.0.pre"
|
9
9
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Julik Tarkhanov"]
|
12
|
-
s.date = "2013-03-
|
12
|
+
s.date = "2013-03-22"
|
13
13
|
s.description = "Converts 2D track exports between different apps like Flame, MatchMover, PFTrack..."
|
14
14
|
s.email = "me@julik.nl"
|
15
15
|
s.executables = ["tracksperanto"]
|
@@ -54,7 +54,6 @@ Gem::Specification.new do |s|
|
|
54
54
|
"lib/import/match_mover.rb",
|
55
55
|
"lib/import/match_mover_rzml.rb",
|
56
56
|
"lib/import/maya_live.rb",
|
57
|
-
"lib/import/nuke_grammar/utils.rb",
|
58
57
|
"lib/import/nuke_script.rb",
|
59
58
|
"lib/import/pftrack.rb",
|
60
59
|
"lib/import/shake_grammar/catcher.rb",
|
@@ -211,11 +210,13 @@ Gem::Specification.new do |s|
|
|
211
210
|
|
212
211
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
213
212
|
s.add_runtime_dependency(%q<obuf>, ["~> 1.1"])
|
214
|
-
s.add_runtime_dependency(%q<tickly>, ["~>
|
213
|
+
s.add_runtime_dependency(%q<tickly>, ["~> 2.0"])
|
214
|
+
s.add_runtime_dependency(%q<bychar>, [">= 0"])
|
215
215
|
s.add_runtime_dependency(%q<progressive_io>, ["~> 1.0"])
|
216
216
|
s.add_runtime_dependency(%q<flame_channel_parser>, ["~> 4.0"])
|
217
217
|
s.add_runtime_dependency(%q<progressbar>, ["= 0.10.0"])
|
218
218
|
s.add_runtime_dependency(%q<update_hints>, ["~> 1.0"])
|
219
|
+
s.add_runtime_dependency(%q<bundler>, [">= 0"])
|
219
220
|
s.add_development_dependency(%q<approximately>, [">= 0"])
|
220
221
|
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
221
222
|
s.add_development_dependency(%q<rake>, [">= 0"])
|
@@ -225,11 +226,13 @@ Gem::Specification.new do |s|
|
|
225
226
|
s.add_development_dependency(%q<ruby-prof>, [">= 0"])
|
226
227
|
else
|
227
228
|
s.add_dependency(%q<obuf>, ["~> 1.1"])
|
228
|
-
s.add_dependency(%q<tickly>, ["~>
|
229
|
+
s.add_dependency(%q<tickly>, ["~> 2.0"])
|
230
|
+
s.add_dependency(%q<bychar>, [">= 0"])
|
229
231
|
s.add_dependency(%q<progressive_io>, ["~> 1.0"])
|
230
232
|
s.add_dependency(%q<flame_channel_parser>, ["~> 4.0"])
|
231
233
|
s.add_dependency(%q<progressbar>, ["= 0.10.0"])
|
232
234
|
s.add_dependency(%q<update_hints>, ["~> 1.0"])
|
235
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
233
236
|
s.add_dependency(%q<approximately>, [">= 0"])
|
234
237
|
s.add_dependency(%q<jeweler>, [">= 0"])
|
235
238
|
s.add_dependency(%q<rake>, [">= 0"])
|
@@ -240,11 +243,13 @@ Gem::Specification.new do |s|
|
|
240
243
|
end
|
241
244
|
else
|
242
245
|
s.add_dependency(%q<obuf>, ["~> 1.1"])
|
243
|
-
s.add_dependency(%q<tickly>, ["~>
|
246
|
+
s.add_dependency(%q<tickly>, ["~> 2.0"])
|
247
|
+
s.add_dependency(%q<bychar>, [">= 0"])
|
244
248
|
s.add_dependency(%q<progressive_io>, ["~> 1.0"])
|
245
249
|
s.add_dependency(%q<flame_channel_parser>, ["~> 4.0"])
|
246
250
|
s.add_dependency(%q<progressbar>, ["= 0.10.0"])
|
247
251
|
s.add_dependency(%q<update_hints>, ["~> 1.0"])
|
252
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
248
253
|
s.add_dependency(%q<approximately>, [">= 0"])
|
249
254
|
s.add_dependency(%q<jeweler>, [">= 0"])
|
250
255
|
s.add_dependency(%q<rake>, [">= 0"])
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tracksperanto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
5
|
-
prerelease:
|
4
|
+
version: 3.3.0.pre
|
5
|
+
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Julik Tarkhanov
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: obuf
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
requirements:
|
35
35
|
- - ~>
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
37
|
+
version: '2.0'
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,7 +42,23 @@ dependencies:
|
|
42
42
|
requirements:
|
43
43
|
- - ~>
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
45
|
+
version: '2.0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: bychar
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
46
62
|
- !ruby/object:Gem::Dependency
|
47
63
|
name: progressive_io
|
48
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -107,6 +123,22 @@ dependencies:
|
|
107
123
|
- - ~>
|
108
124
|
- !ruby/object:Gem::Version
|
109
125
|
version: '1.0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: bundler
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :runtime
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
110
142
|
- !ruby/object:Gem::Dependency
|
111
143
|
name: approximately
|
112
144
|
requirement: !ruby/object:Gem::Requirement
|
@@ -265,7 +297,6 @@ files:
|
|
265
297
|
- lib/import/match_mover.rb
|
266
298
|
- lib/import/match_mover_rzml.rb
|
267
299
|
- lib/import/maya_live.rb
|
268
|
-
- lib/import/nuke_grammar/utils.rb
|
269
300
|
- lib/import/nuke_script.rb
|
270
301
|
- lib/import/pftrack.rb
|
271
302
|
- lib/import/shake_grammar/catcher.rb
|
@@ -425,13 +456,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
425
456
|
version: '0'
|
426
457
|
segments:
|
427
458
|
- 0
|
428
|
-
hash:
|
459
|
+
hash: 506904342212099543
|
429
460
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
430
461
|
none: false
|
431
462
|
requirements:
|
432
|
-
- - ! '
|
463
|
+
- - ! '>'
|
433
464
|
- !ruby/object:Gem::Version
|
434
|
-
version:
|
465
|
+
version: 1.3.1
|
435
466
|
requirements: []
|
436
467
|
rubyforge_project:
|
437
468
|
rubygems_version: 1.8.24
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
class Tracksperanto::NukeGrammarUtils
|
3
|
-
SECTION_START = /^x(\d+)$/
|
4
|
-
KEYFRAME = /^([-\d\.]+)$/
|
5
|
-
|
6
|
-
# Scan a TCL curve expression into a number of tuples of [frame, value]
|
7
|
-
def parse_curve(atoms)
|
8
|
-
# Replace the closing curly brace with a curly brace with space so that it gets caught by split
|
9
|
-
atoms.shift # remove the :c curly designator
|
10
|
-
atoms.shift # remove the "curve" keyword
|
11
|
-
tuples = []
|
12
|
-
# Nuke saves curves very efficiently. x(keyframe_number) means that an uninterrupted sequence of values will start,
|
13
|
-
# after which values follow. When the curve is interrupted in some way a new x(keyframe_number) will signifu that we
|
14
|
-
# skip to that specified keyframe and the curve continues from there, in gap size defined by the last fragment.
|
15
|
-
# That is, x1 1 x3 2 3 4 will place 2, 3 and 4 at 2-frame increments
|
16
|
-
|
17
|
-
last_processed_keyframe = 1
|
18
|
-
intraframe_gap_size = 1
|
19
|
-
while atom = atoms.shift
|
20
|
-
if atom =~ SECTION_START
|
21
|
-
last_processed_keyframe = $1.to_i
|
22
|
-
if tuples.any?
|
23
|
-
last_captured_frame = tuples[-1][0]
|
24
|
-
intraframe_gap_size = last_processed_keyframe - last_captured_frame
|
25
|
-
end
|
26
|
-
elsif atom =~ KEYFRAME
|
27
|
-
tuples << [last_processed_keyframe, $1.to_f]
|
28
|
-
last_processed_keyframe += intraframe_gap_size
|
29
|
-
end
|
30
|
-
end
|
31
|
-
tuples
|
32
|
-
end
|
33
|
-
end
|