tracksperanto 2.9.6 → 2.9.7

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 2.9.7
2
+
3
+ * Add Syntheyes "All tracker paths" support
4
+
1
5
  === 2.9.6
2
6
 
3
7
  * Add Nuke Reconcile3D support
data/bin/tracksperanto CHANGED
@@ -69,7 +69,7 @@ op.on("--code PATH_TO_SCRIPT", String, "Load custom Ruby code into tracksperanto
69
69
  end
70
70
 
71
71
 
72
- op.on(" -f", "--from TRANSLATOR", String, "Use the specific import translator") { |f| options[:importer] = f }
72
+ op.on(" -f", "--from TRANSLATOR", String, "Use the specific import translator - #{readers.join(", ")}") { |f| options[:importer] = f }
73
73
  op.on(" -w", "--width WIDTH_IN_PIXELS", Integer, "Absolute input comp width in pixels (will try to autodetect)") { |w| options[:width] = w }
74
74
  op.on(" -h", "--height HEIGHT_IN_PIXELS", Integer, "Absolute input comp height in pixels (will try to autodetect)") {|w| options[:height] = w }
75
75
  op.on(" -o", "--only EXPORTER_NAME", String, "Only export the selected format, format must be one of #{writers.join(", ")}") { |f| writer_class_name = f }
@@ -0,0 +1,38 @@
1
+ # -*- encoding : utf-8 -*-
2
+ class Tracksperanto::Import::SyntheyesAllTrackerPaths < Tracksperanto::Import::Base
3
+ def self.human_name
4
+ "Syntheyes \"All Tracker Paths\" export .txt file"
5
+ end
6
+
7
+ CHARACTERS_OR_QUOTES = /[AZaz"]/
8
+ TRACKER_KEYFRAME = /^(\d+) ((\d+)\.(\d+)) ((\d+)\.(\d+))/
9
+
10
+ def each
11
+ t = Tracksperanto::Tracker.new
12
+ while line = @io.gets do
13
+ if line =~ CHARACTERS_OR_QUOTES
14
+ t = Tracksperanto::Tracker.new(:name => line)
15
+ fill_tracker(t, @io)
16
+ yield(t)
17
+ end
18
+ end
19
+ end
20
+
21
+ private
22
+
23
+ def fill_tracker(t, io)
24
+ loop do
25
+ prev_pos = io.pos
26
+ line = io.gets
27
+ if line =~ TRACKER_KEYFRAME
28
+ parts = line.scan(TRACKER_KEYFRAME).flatten
29
+ t.keyframe!(:frame => parts[0], :abs_x => parts[1], :abs_y => parts[2])
30
+ else
31
+ # Backtrack to where we started the line and return control
32
+ io.pos = prev_pos
33
+ return
34
+ end
35
+ end
36
+ end
37
+
38
+ end
data/lib/tracksperanto.rb CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  module Tracksperanto
5
5
  PATH = File.expand_path(File.dirname(__FILE__))
6
- VERSION = '2.9.6'
6
+ VERSION = '2.9.7'
7
7
 
8
8
  module Import; end
9
9
  module Export; end
@@ -117,6 +117,11 @@ class Tracksperanto::Tracker
117
117
  @frame_table.length
118
118
  end
119
119
 
120
+ # Removes all the keyframes in the tracker
121
+ def clear
122
+ @frame_table = {}
123
+ end
124
+
120
125
  private
121
126
 
122
127
  def ordered_frame_numbers
@@ -0,0 +1,25 @@
1
+ # -*- encoding : utf-8 -*-
2
+ require File.expand_path(File.dirname(__FILE__)) + '/../helper'
3
+
4
+ class SyntheyesAllPathsImportTest < Test::Unit::TestCase
5
+ DELTA = 0.001 # our SynthEyes sample is somewhat inaccurate :-P
6
+
7
+ def test_introspects_properly
8
+ i = Tracksperanto::Import::SyntheyesAllTrackerPaths
9
+ assert_equal "Syntheyes \"All Tracker Paths\" export .txt file", i.human_name
10
+ assert !i.autodetects_size?
11
+ end
12
+
13
+ def test_parsing_from_importable
14
+ fixture = File.open(File.dirname(__FILE__) + '/samples/syntheyes_all_tracker_paths/shot06_2dTracks.txt')
15
+ trackers = Tracksperanto::Import::SyntheyesAllTrackerPaths.new(:io => fixture, :width => 2560, :height => 1080).to_a
16
+ assert_equal 139, trackers.length
17
+ assert_equal "Tracker2_", trackers[0].name
18
+ assert_equal "Tracker3_", trackers[1].name
19
+ assert_equal 44, trackers[0].length
20
+
21
+ first_kf = trackers[0].at_frame(0)
22
+ assert_in_delta 760.632, first_kf.abs_x, DELTA
23
+ assert_in_delta 760.0, first_kf.abs_y, DELTA
24
+ end
25
+ end
data/test/test_tracker.rb CHANGED
@@ -64,6 +64,15 @@ class TrackerTest < Test::Unit::TestCase
64
64
  assert_equal [kfs], Tracksperanto::Tracker.new(:keyframes => [kfs]).keyframes
65
65
  end
66
66
 
67
+ def test_clear
68
+ t = Tracksperanto::Tracker.new do | t |
69
+ t.keyframe! :abs_x => 123, :abs_y => 456
70
+ end
71
+ assert_equal 1, t.length
72
+ t.clear
73
+ assert t.length.zero?
74
+ end
75
+
67
76
  def test_supports_array_methods
68
77
  kfs = Tracksperanto::Keyframe.new(:frame => 1, :abs_x => 123, :abs_y => 456)
69
78
  t = Tracksperanto::Tracker.new(:keyframes => [kfs])
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "tracksperanto"
8
- s.version = "2.9.6"
8
+ s.version = "2.9.7"
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-03-14"
12
+ s.date = "2012-03-17"
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"]
@@ -59,6 +59,7 @@ Gem::Specification.new do |s|
59
59
  "lib/import/shake_script.rb",
60
60
  "lib/import/shake_text.rb",
61
61
  "lib/import/syntheyes.rb",
62
+ "lib/import/syntheyes_all_tracker_paths.rb",
62
63
  "lib/middleware/base.rb",
63
64
  "lib/middleware/crop.rb",
64
65
  "lib/middleware/flip.rb",
@@ -145,6 +146,7 @@ Gem::Specification.new do |s|
145
146
  "test/import/test_shake_lexer.rb",
146
147
  "test/import/test_shake_script_import.rb",
147
148
  "test/import/test_shake_text_import.rb",
149
+ "test/import/test_syntheyes_all_tracker_paths_import.rb",
148
150
  "test/import/test_syntheyes_import.rb",
149
151
  "test/middleware/test_crop_middleware.rb",
150
152
  "test/middleware/test_flip_middleware.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.6
4
+ version: 2.9.7
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-03-14 00:00:00.000000000 Z
12
+ date: 2012-03-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: obuf
16
- requirement: &4119790 !ruby/object:Gem::Requirement
16
+ requirement: &4013890 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.1.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *4119790
24
+ version_requirements: *4013890
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: progressive_io
27
- requirement: &4118300 !ruby/object:Gem::Requirement
27
+ requirement: &4013530 !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: *4118300
35
+ version_requirements: *4013530
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: flame_channel_parser
38
- requirement: &4117790 !ruby/object:Gem::Requirement
38
+ requirement: &4013220 !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: *4117790
46
+ version_requirements: *4013220
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: progressbar
49
- requirement: &4116990 !ruby/object:Gem::Requirement
49
+ requirement: &4012820 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - =
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.10.0
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *4116990
57
+ version_requirements: *4012820
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: update_hints
60
- requirement: &4116480 !ruby/object:Gem::Requirement
60
+ requirement: &4012430 !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: *4116480
68
+ version_requirements: *4012430
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: jeweler
71
- requirement: &4115890 !ruby/object:Gem::Requirement
71
+ requirement: &4011740 !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: *4115890
79
+ version_requirements: *4011740
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rake
82
- requirement: &4115490 !ruby/object:Gem::Requirement
82
+ requirement: &4010310 !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: *4115490
90
+ version_requirements: *4010310
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: flexmock
93
- requirement: &4114820 !ruby/object:Gem::Requirement
93
+ requirement: &4010050 !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: *4114820
101
+ version_requirements: *4010050
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: cli_test
104
- requirement: &4114300 !ruby/object:Gem::Requirement
104
+ requirement: &4009660 !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: *4114300
112
+ version_requirements: *4009660
113
113
  description: Converts 2D track exports between different apps like Flame, MatchMover,
114
114
  PFTrack...
115
115
  email: me@julik.nl
@@ -161,6 +161,7 @@ files:
161
161
  - lib/import/shake_script.rb
162
162
  - lib/import/shake_text.rb
163
163
  - lib/import/syntheyes.rb
164
+ - lib/import/syntheyes_all_tracker_paths.rb
164
165
  - lib/middleware/base.rb
165
166
  - lib/middleware/crop.rb
166
167
  - lib/middleware/flip.rb
@@ -247,6 +248,7 @@ files:
247
248
  - test/import/test_shake_lexer.rb
248
249
  - test/import/test_shake_script_import.rb
249
250
  - test/import/test_shake_text_import.rb
251
+ - test/import/test_syntheyes_all_tracker_paths_import.rb
250
252
  - test/import/test_syntheyes_import.rb
251
253
  - test/middleware/test_crop_middleware.rb
252
254
  - test/middleware/test_flip_middleware.rb