tracksperanto 2.9.2 → 2.9.3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/lib/export/cosa.rb +44 -0
- data/lib/tracksperanto.rb +1 -1
- data/test/export/samples/ref_AfterEffects.jsx +62 -0
- data/test/export/test_ae_export.rb +17 -0
- data/test/helper.rb +5 -1
- data/test/test_cli.rb +1 -1
- data/tracksperanto.gemspec +5 -2
- metadata +23 -20
data/History.txt
CHANGED
data/lib/export/cosa.rb
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
# Export each tracker as an AfterEffects script creating nulls
|
3
|
+
class Tracksperanto::Export::AE < Tracksperanto::Export::Base
|
4
|
+
|
5
|
+
PREAMBLE = 'function convertFrameToSeconds(layerWithFootage, frameValue)
|
6
|
+
{
|
7
|
+
var comp = layerWithFootage.containingComp;
|
8
|
+
var rate = 1.0 / comp.frameDuration;
|
9
|
+
// Frames in AE are 0-based by default
|
10
|
+
return (frameValue) / rate;
|
11
|
+
}'
|
12
|
+
|
13
|
+
def self.desc_and_extension
|
14
|
+
"createNulls.jsx"
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.human_name
|
18
|
+
"AfterEffects .jsx script generating null layers"
|
19
|
+
end
|
20
|
+
|
21
|
+
def start_export(w, h)
|
22
|
+
@io.puts(PREAMBLE)
|
23
|
+
@io.puts("")
|
24
|
+
@count = 0
|
25
|
+
@height = h
|
26
|
+
end
|
27
|
+
|
28
|
+
def start_tracker_segment(tracker_name)
|
29
|
+
@io.puts("")
|
30
|
+
@io.puts('var layer%d = app.project.activeItem.layers.addNull();' % @count)
|
31
|
+
@io.puts( 'layer%d.name = %s;' % [@count, tracker_name.inspect])
|
32
|
+
@io.puts("")
|
33
|
+
@io.puts('var pos = layer%d.property("Transform").property("Position");' % @count)
|
34
|
+
end
|
35
|
+
|
36
|
+
def export_point(frame, abs_float_x, abs_float_y, float_residual)
|
37
|
+
@io.puts('pos.setValueAtTime(convertFrameToSeconds(layer%d, %d), [%0.5f,%0.5f]);' % [@count, frame, abs_float_x, @height - abs_float_y])
|
38
|
+
end
|
39
|
+
|
40
|
+
def end_tracker_segment
|
41
|
+
@count += 1
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
data/lib/tracksperanto.rb
CHANGED
@@ -0,0 +1,62 @@
|
|
1
|
+
function convertFrameToSeconds(layerWithFootage, frameValue)
|
2
|
+
{
|
3
|
+
var comp = layerWithFootage.containingComp;
|
4
|
+
var rate = 1.0 / comp.frameDuration;
|
5
|
+
// Frames in AE are 0-based by default
|
6
|
+
return (frameValue) / rate;
|
7
|
+
}
|
8
|
+
|
9
|
+
|
10
|
+
var layer0 = app.project.activeItem.layers.addNull();
|
11
|
+
layer0.name = "Parabolic_1_from_top_left";
|
12
|
+
|
13
|
+
var pos = layer0.property("Transform").property("Position");
|
14
|
+
pos.setValueAtTime(convertFrameToSeconds(layer0, 0), [0.00000,0.00000]);
|
15
|
+
pos.setValueAtTime(convertFrameToSeconds(layer0, 1), [96.00000,205.20000]);
|
16
|
+
pos.setValueAtTime(convertFrameToSeconds(layer0, 2), [192.00000,388.80000]);
|
17
|
+
pos.setValueAtTime(convertFrameToSeconds(layer0, 3), [288.00000,550.80000]);
|
18
|
+
pos.setValueAtTime(convertFrameToSeconds(layer0, 4), [384.00000,691.20000]);
|
19
|
+
pos.setValueAtTime(convertFrameToSeconds(layer0, 5), [480.00000,810.00000]);
|
20
|
+
pos.setValueAtTime(convertFrameToSeconds(layer0, 6), [576.00000,907.20000]);
|
21
|
+
pos.setValueAtTime(convertFrameToSeconds(layer0, 7), [672.00000,982.80000]);
|
22
|
+
pos.setValueAtTime(convertFrameToSeconds(layer0, 8), [768.00000,1036.80000]);
|
23
|
+
pos.setValueAtTime(convertFrameToSeconds(layer0, 9), [864.00000,1069.20000]);
|
24
|
+
pos.setValueAtTime(convertFrameToSeconds(layer0, 12), [1152.00000,1036.80000]);
|
25
|
+
pos.setValueAtTime(convertFrameToSeconds(layer0, 13), [1248.00000,982.80000]);
|
26
|
+
pos.setValueAtTime(convertFrameToSeconds(layer0, 14), [1344.00000,907.20000]);
|
27
|
+
pos.setValueAtTime(convertFrameToSeconds(layer0, 15), [1440.00000,810.00000]);
|
28
|
+
pos.setValueAtTime(convertFrameToSeconds(layer0, 16), [1536.00000,691.20000]);
|
29
|
+
pos.setValueAtTime(convertFrameToSeconds(layer0, 17), [1632.00000,550.80000]);
|
30
|
+
pos.setValueAtTime(convertFrameToSeconds(layer0, 18), [1728.00000,388.80000]);
|
31
|
+
pos.setValueAtTime(convertFrameToSeconds(layer0, 19), [1824.00000,205.20000]);
|
32
|
+
pos.setValueAtTime(convertFrameToSeconds(layer0, 20), [1920.00000,0.00000]);
|
33
|
+
|
34
|
+
var layer1 = app.project.activeItem.layers.addNull();
|
35
|
+
layer1.name = "Parabolic_2_from_bottom_right";
|
36
|
+
|
37
|
+
var pos = layer1.property("Transform").property("Position");
|
38
|
+
pos.setValueAtTime(convertFrameToSeconds(layer1, 0), [1920.00000,1080.00000]);
|
39
|
+
pos.setValueAtTime(convertFrameToSeconds(layer1, 1), [1824.00000,874.80000]);
|
40
|
+
pos.setValueAtTime(convertFrameToSeconds(layer1, 2), [1728.00000,691.20000]);
|
41
|
+
pos.setValueAtTime(convertFrameToSeconds(layer1, 3), [1632.00000,529.20000]);
|
42
|
+
pos.setValueAtTime(convertFrameToSeconds(layer1, 4), [1536.00000,388.80000]);
|
43
|
+
pos.setValueAtTime(convertFrameToSeconds(layer1, 5), [1440.00000,270.00000]);
|
44
|
+
pos.setValueAtTime(convertFrameToSeconds(layer1, 6), [1344.00000,172.80000]);
|
45
|
+
pos.setValueAtTime(convertFrameToSeconds(layer1, 7), [1248.00000,97.20000]);
|
46
|
+
pos.setValueAtTime(convertFrameToSeconds(layer1, 8), [1152.00000,43.20000]);
|
47
|
+
pos.setValueAtTime(convertFrameToSeconds(layer1, 9), [1056.00000,10.80000]);
|
48
|
+
pos.setValueAtTime(convertFrameToSeconds(layer1, 12), [768.00000,43.20000]);
|
49
|
+
pos.setValueAtTime(convertFrameToSeconds(layer1, 13), [672.00000,97.20000]);
|
50
|
+
pos.setValueAtTime(convertFrameToSeconds(layer1, 14), [576.00000,172.80000]);
|
51
|
+
pos.setValueAtTime(convertFrameToSeconds(layer1, 15), [480.00000,270.00000]);
|
52
|
+
pos.setValueAtTime(convertFrameToSeconds(layer1, 16), [384.00000,388.80000]);
|
53
|
+
pos.setValueAtTime(convertFrameToSeconds(layer1, 17), [288.00000,529.20000]);
|
54
|
+
pos.setValueAtTime(convertFrameToSeconds(layer1, 18), [192.00000,691.20000]);
|
55
|
+
pos.setValueAtTime(convertFrameToSeconds(layer1, 19), [96.00000,874.80000]);
|
56
|
+
pos.setValueAtTime(convertFrameToSeconds(layer1, 20), [0.00000,1080.00000]);
|
57
|
+
|
58
|
+
var layer2 = app.project.activeItem.layers.addNull();
|
59
|
+
layer2.name = "SingleFrame";
|
60
|
+
|
61
|
+
var pos = layer2.property("Transform").property("Position");
|
62
|
+
pos.setValueAtTime(convertFrameToSeconds(layer2, 0), [970.00000,530.00000]);
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
3
|
+
|
4
|
+
class AEExportTest < Test::Unit::TestCase
|
5
|
+
include ParabolicTracks
|
6
|
+
|
7
|
+
P_LOCATORS = File.dirname(__FILE__) + "/samples/ref_AfterEffects.jsx"
|
8
|
+
|
9
|
+
def test_export_output_written
|
10
|
+
ensure_same_output Tracksperanto::Export::AE, P_LOCATORS
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_exporter_meta
|
14
|
+
assert_equal "createNulls.jsx", Tracksperanto::Export::AE.desc_and_extension
|
15
|
+
assert_equal "AfterEffects .jsx script generating null layers", Tracksperanto::Export::AE.human_name
|
16
|
+
end
|
17
|
+
end
|
data/test/helper.rb
CHANGED
@@ -29,7 +29,11 @@ end
|
|
29
29
|
# export_parabolics_with(my_exporter)
|
30
30
|
#
|
31
31
|
# The tracker residual will degrade linarly and wll be "good" at the first image, "medium" at the extreme
|
32
|
-
# and "bad" at end
|
32
|
+
# and "bad" at end.
|
33
|
+
#
|
34
|
+
# The test tracks are precomputed to prevent failing tests due to float rounding biases on different platforms.
|
35
|
+
# You can see the computation involved in generating these tracks in
|
36
|
+
# https://github.com/guerilla-di/tracksperanto/commit/371214b47b2ead857c4af17eee1f8d19c62d1dd6#diff-5
|
33
37
|
module ParabolicTracks
|
34
38
|
|
35
39
|
FIRST_TRACK = Tracksperanto::Tracker.new(:name => "Parabolic_1_from_top_left") do |t|
|
data/test/test_cli.rb
CHANGED
@@ -40,7 +40,7 @@ class CliTest < Test::Unit::TestCase
|
|
40
40
|
flm.stabilizer flm_3de_v3.txt flm_3de_v4.txt flm_boujou_text.txt flm_flame.stabilizer
|
41
41
|
flm_matchmover.rz2 flm_mayalive.txt flm_nuke.nk flm_pftrack_2011_pfmatchit.txt flm_pftrack_v4.2dt
|
42
42
|
flm_pftrack_v5.2dt flm_shake_trackers.txt flm_syntheyes_2dt.txt flm_flame_cornerpin.stabilizer
|
43
|
-
flm_tracksperanto_ruby.rb flm_mayaLocators.mel
|
43
|
+
flm_tracksperanto_ruby.rb flm_mayaLocators.mel flm_createNulls.jsx
|
44
44
|
)
|
45
45
|
|
46
46
|
assert_same_set fs, Dir.entries(TEMP_DIR)
|
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 = "2.9.
|
8
|
+
s.version = "2.9.3"
|
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 = "2012-01-
|
12
|
+
s.date = "2012-01-28"
|
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"]
|
@@ -27,6 +27,7 @@ Gem::Specification.new do |s|
|
|
27
27
|
"bin/tracksperanto",
|
28
28
|
"lib/export/base.rb",
|
29
29
|
"lib/export/boujou.rb",
|
30
|
+
"lib/export/cosa.rb",
|
30
31
|
"lib/export/equalizer3.rb",
|
31
32
|
"lib/export/equalizer4.rb",
|
32
33
|
"lib/export/flame_stabilizer.rb",
|
@@ -89,6 +90,7 @@ Gem::Specification.new do |s|
|
|
89
90
|
"lib/tracksperanto/uv_coordinates.rb",
|
90
91
|
"lib/tracksperanto/zip_tuples.rb",
|
91
92
|
"test/export/README_EXPORT_TESTS.txt",
|
93
|
+
"test/export/samples/ref_AfterEffects.jsx",
|
92
94
|
"test/export/samples/ref_FlameProperlyReorderedCornerpin.stabilizer",
|
93
95
|
"test/export/samples/ref_FlameSimpleReorderedCornerpin.stabilizer",
|
94
96
|
"test/export/samples/ref_MayaLocators.mel",
|
@@ -107,6 +109,7 @@ Gem::Specification.new do |s|
|
|
107
109
|
"test/export/samples/ref_flame.stabilizer",
|
108
110
|
"test/export/samples/ref_flameCornerpin.stabilizer",
|
109
111
|
"test/export/samples/ref_matchmover.rz2",
|
112
|
+
"test/export/test_ae_export.rb",
|
110
113
|
"test/export/test_boujou_export.rb",
|
111
114
|
"test/export/test_equalizer3_export.rb",
|
112
115
|
"test/export/test_equalizer_export.rb",
|
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: 2.9.
|
4
|
+
version: 2.9.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-01-
|
12
|
+
date: 2012-01-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: obuf
|
16
|
-
requirement: &
|
16
|
+
requirement: &4002190 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.0.4
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *4002190
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: progressive_io
|
27
|
-
requirement: &
|
27
|
+
requirement: &4001450 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '1.0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *4001450
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: flame_channel_parser
|
38
|
-
requirement: &
|
38
|
+
requirement: &4000830 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '4.0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *4000830
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: progressbar
|
49
|
-
requirement: &
|
49
|
+
requirement: &4000140 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0.9'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *4000140
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: update_hints
|
60
|
-
requirement: &
|
60
|
+
requirement: &3999670 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '1.0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *3999670
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: jeweler
|
71
|
-
requirement: &
|
71
|
+
requirement: &3998710 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *3998710
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: rake
|
82
|
-
requirement: &
|
82
|
+
requirement: &3998020 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *3998020
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: flexmock
|
93
|
-
requirement: &
|
93
|
+
requirement: &3996680 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ~>
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: '0.8'
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *3996680
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: cli_test
|
104
|
-
requirement: &
|
104
|
+
requirement: &3995630 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ~>
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
version: '1.0'
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *3995630
|
113
113
|
description: Converts 2D track exports between different apps like Flame, MatchMover,
|
114
114
|
PFTrack...
|
115
115
|
email: me@julik.nl
|
@@ -129,6 +129,7 @@ files:
|
|
129
129
|
- bin/tracksperanto
|
130
130
|
- lib/export/base.rb
|
131
131
|
- lib/export/boujou.rb
|
132
|
+
- lib/export/cosa.rb
|
132
133
|
- lib/export/equalizer3.rb
|
133
134
|
- lib/export/equalizer4.rb
|
134
135
|
- lib/export/flame_stabilizer.rb
|
@@ -191,6 +192,7 @@ files:
|
|
191
192
|
- lib/tracksperanto/uv_coordinates.rb
|
192
193
|
- lib/tracksperanto/zip_tuples.rb
|
193
194
|
- test/export/README_EXPORT_TESTS.txt
|
195
|
+
- test/export/samples/ref_AfterEffects.jsx
|
194
196
|
- test/export/samples/ref_FlameProperlyReorderedCornerpin.stabilizer
|
195
197
|
- test/export/samples/ref_FlameSimpleReorderedCornerpin.stabilizer
|
196
198
|
- test/export/samples/ref_MayaLocators.mel
|
@@ -209,6 +211,7 @@ files:
|
|
209
211
|
- test/export/samples/ref_flame.stabilizer
|
210
212
|
- test/export/samples/ref_flameCornerpin.stabilizer
|
211
213
|
- test/export/samples/ref_matchmover.rz2
|
214
|
+
- test/export/test_ae_export.rb
|
212
215
|
- test/export/test_boujou_export.rb
|
213
216
|
- test/export/test_equalizer3_export.rb
|
214
217
|
- test/export/test_equalizer_export.rb
|