tracksperanto 3.2.0 → 3.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/History.txt +4 -0
- data/lib/import/nuke_grammar/utils.rb +1 -0
- data/lib/import/nuke_script.rb +27 -16
- data/lib/tracksperanto.rb +1 -1
- data/test/import/test_nuke_import.rb +16 -1
- data/tracksperanto.gemspec +5 -5
- metadata +5 -5
data/Gemfile
CHANGED
data/History.txt
CHANGED
@@ -6,6 +6,7 @@ class Tracksperanto::NukeGrammarUtils
|
|
6
6
|
# Scan a TCL curve expression into a number of tuples of [frame, value]
|
7
7
|
def parse_curve(atoms)
|
8
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
|
9
10
|
atoms.shift # remove the "curve" keyword
|
10
11
|
tuples = []
|
11
12
|
# Nuke saves curves very efficiently. x(keyframe_number) means that an uninterrupted sequence of values will start,
|
data/lib/import/nuke_script.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
|
-
require 'delegate'
|
3
|
-
require File.expand_path(File.dirname(__FILE__)) + "/nuke_grammar/utils"
|
4
2
|
require 'tickly'
|
3
|
+
require File.expand_path(File.dirname(__FILE__)) + "/nuke_grammar/utils"
|
5
4
|
|
6
5
|
class Tracksperanto::Import::NukeScript < Tracksperanto::Import::Base
|
7
6
|
|
@@ -17,18 +16,29 @@ class Tracksperanto::Import::NukeScript < Tracksperanto::Import::Base
|
|
17
16
|
'The only supported nodes that we can extract tracks from are Reconcile3D, PlanarTracker and Tracker (supported Nuke versions are 5, 6 and 7)'
|
18
17
|
end
|
19
18
|
|
19
|
+
class Tickly::Parser
|
20
|
+
end
|
21
|
+
|
22
|
+
class Levaluator < Tickly::Evaluator
|
23
|
+
def evaluate(expr)
|
24
|
+
s = super
|
25
|
+
yield(s) if s
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
20
29
|
def each
|
30
|
+
parser = Tickly::NodeExtractor.new("Tracker3", "Tracker4", "PlanarTracker1_0", "Reconcile3D")
|
21
31
|
script_tree = Tickly::Parser.new.parse(@io)
|
22
|
-
|
32
|
+
|
33
|
+
evaluator = Levaluator.new
|
23
34
|
evaluator.add_node_handler_class(Tracker3)
|
24
35
|
evaluator.add_node_handler_class(Reconcile3D)
|
25
36
|
evaluator.add_node_handler_class(PlanarTracker1_0)
|
26
37
|
evaluator.add_node_handler_class(Tracker4)
|
27
38
|
|
28
39
|
script_tree.each do | node |
|
29
|
-
|
30
|
-
|
31
|
-
result.trackers.each do | t |
|
40
|
+
evaluator.evaluate(node) do | node_object |
|
41
|
+
node_object.trackers.each do | t |
|
32
42
|
report_progress("Scavenging tracker #{t.name}")
|
33
43
|
yield t
|
34
44
|
end
|
@@ -71,8 +81,9 @@ class Tracksperanto::Import::NukeScript < Tracksperanto::Import::Base
|
|
71
81
|
|
72
82
|
def extract_curves_from_channel(point_channel)
|
73
83
|
u = Tracksperanto::NukeGrammarUtils.new
|
74
|
-
|
75
|
-
|
84
|
+
# First element is the :c curly identifier
|
85
|
+
point_channel[1..-1].map do | curve_argument |
|
86
|
+
if curve_argument[1] == "curve"
|
76
87
|
u.parse_curve(curve_argument.to_a)
|
77
88
|
else
|
78
89
|
nil
|
@@ -105,12 +116,10 @@ class Tracksperanto::Import::NukeScript < Tracksperanto::Import::Base
|
|
105
116
|
@name = options["name"]
|
106
117
|
@trackers = []
|
107
118
|
tracks = options["tracks"]
|
108
|
-
preamble = tracks[
|
109
|
-
headers = tracks[
|
110
|
-
values = tracks[
|
119
|
+
preamble = tracks[1]
|
120
|
+
headers = tracks[2]
|
121
|
+
values = tracks[3]
|
111
122
|
|
112
|
-
table_headers = headers[0].map{|header| header[0][-1]}
|
113
|
-
#puts table_headers.inspect
|
114
123
|
# When this was written, this was the order of the columns in the table:
|
115
124
|
# le("e", "name", "track_x", "track_y", "offset_x", "offset_y", "T", "R", "S", "error",
|
116
125
|
# "error_min", "error_max", "pattern_x", "pattern_y", "pattern_r", "pattern_t", "search_x",
|
@@ -120,10 +129,12 @@ class Tracksperanto::Import::NukeScript < Tracksperanto::Import::Base
|
|
120
129
|
|
121
130
|
u = Tracksperanto::NukeGrammarUtils.new
|
122
131
|
|
123
|
-
|
124
|
-
|
132
|
+
# The 0 element is the :c symbol
|
133
|
+
tracker_rows[1..-1].each do | row |
|
134
|
+
row_content = row[0]
|
135
|
+
|
125
136
|
# For offsets see above
|
126
|
-
point_name, x_curve, y_curve = row_content[
|
137
|
+
point_name, x_curve, y_curve = row_content[2], u.parse_curve(row_content[3].to_a), u.parse_curve(row_content[4].to_a)
|
127
138
|
|
128
139
|
full_name = [options["name"], point_name].join('_')
|
129
140
|
tracker = package_tracker(full_name, x_curve, y_curve)
|
data/lib/tracksperanto.rb
CHANGED
@@ -125,6 +125,21 @@ class NukeImportTest < Test::Unit::TestCase
|
|
125
125
|
assert_equal 9, kf.frame
|
126
126
|
end
|
127
127
|
|
128
|
+
|
129
|
+
def test_parsing_from_nuke7v05_job_1872
|
130
|
+
fixture = File.open(File.dirname(__FILE__) + '/samples/nuke/failing_nuke7_trackers_job_1872.nk')
|
131
|
+
|
132
|
+
parser = Tracksperanto::Import::NukeScript.new(:io => fixture)
|
133
|
+
parser.width = 2048
|
134
|
+
parser.height = 1556
|
135
|
+
|
136
|
+
trackers = parser.to_a
|
137
|
+
assert_equal 2, trackers.length
|
138
|
+
assert_equal "Tracker5_track_1", trackers[0].name
|
139
|
+
assert_equal "Tracker5_track_2", trackers[1].name
|
140
|
+
assert_equal 16, trackers[1].length
|
141
|
+
end
|
142
|
+
|
128
143
|
def test_parsing_from_nuke_group
|
129
144
|
fixture = File.open(File.dirname(__FILE__) + '/samples/nuke/one_tracker_with_break_in_grp.nk')
|
130
145
|
|
@@ -143,7 +158,7 @@ class NukeImportTest < Test::Unit::TestCase
|
|
143
158
|
end
|
144
159
|
|
145
160
|
def test_parsing_nuke_curve
|
146
|
-
curve = %w( curve x742 888 890.2463989 891.6602783
|
161
|
+
curve = [:c] + %w( curve x742 888 890.2463989 891.6602783
|
147
162
|
893.5056763 895.6155396 s95 897.2791748 899.1762695
|
148
163
|
x754 912.0731812 x755 913.7190552 916.0959473 918.1025391 920.0751953 922.1898804 )
|
149
164
|
p = Tracksperanto::NukeGrammarUtils.new
|
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.2.
|
8
|
+
s.version = "3.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Julik Tarkhanov"]
|
12
|
-
s.date = "2013-03-
|
12
|
+
s.date = "2013-03-14"
|
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"]
|
@@ -212,7 +212,7 @@ Gem::Specification.new do |s|
|
|
212
212
|
s.specification_version = 3
|
213
213
|
|
214
214
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
215
|
-
s.add_runtime_dependency(%q<tickly>, ["~> 0.0.
|
215
|
+
s.add_runtime_dependency(%q<tickly>, ["~> 0.0.4"])
|
216
216
|
s.add_runtime_dependency(%q<obuf>, ["~> 1.1.0"])
|
217
217
|
s.add_runtime_dependency(%q<progressive_io>, ["~> 1.0"])
|
218
218
|
s.add_runtime_dependency(%q<flame_channel_parser>, ["~> 4.0"])
|
@@ -225,7 +225,7 @@ Gem::Specification.new do |s|
|
|
225
225
|
s.add_development_dependency(%q<cli_test>, ["~> 1.0"])
|
226
226
|
s.add_development_dependency(%q<rake-hooks>, [">= 0"])
|
227
227
|
else
|
228
|
-
s.add_dependency(%q<tickly>, ["~> 0.0.
|
228
|
+
s.add_dependency(%q<tickly>, ["~> 0.0.4"])
|
229
229
|
s.add_dependency(%q<obuf>, ["~> 1.1.0"])
|
230
230
|
s.add_dependency(%q<progressive_io>, ["~> 1.0"])
|
231
231
|
s.add_dependency(%q<flame_channel_parser>, ["~> 4.0"])
|
@@ -239,7 +239,7 @@ Gem::Specification.new do |s|
|
|
239
239
|
s.add_dependency(%q<rake-hooks>, [">= 0"])
|
240
240
|
end
|
241
241
|
else
|
242
|
-
s.add_dependency(%q<tickly>, ["~> 0.0.
|
242
|
+
s.add_dependency(%q<tickly>, ["~> 0.0.4"])
|
243
243
|
s.add_dependency(%q<obuf>, ["~> 1.1.0"])
|
244
244
|
s.add_dependency(%q<progressive_io>, ["~> 1.0"])
|
245
245
|
s.add_dependency(%q<flame_channel_parser>, ["~> 4.0"])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tracksperanto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: tickly
|
@@ -18,7 +18,7 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.0.
|
21
|
+
version: 0.0.4
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ~>
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.0.
|
29
|
+
version: 0.0.4
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: obuf
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -411,7 +411,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
411
411
|
version: '0'
|
412
412
|
segments:
|
413
413
|
- 0
|
414
|
-
hash:
|
414
|
+
hash: -1926493712064861893
|
415
415
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
416
416
|
none: false
|
417
417
|
requirements:
|