tracksperanto 1.2.4 → 1.2.6

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.
data/History.txt CHANGED
@@ -1,3 +1,11 @@
1
+ === 1.2.6 / 2009-09-21
2
+
3
+ * Add const_name to the classes being introspected most often
4
+
5
+ === 1.2.5 / 2009-09-21
6
+
7
+ * Reset residual on Syntheyes imports to 0
8
+
1
9
  === 1.2.4 / 2009-09-21
2
10
 
3
11
  * Write to files in binary mode
data/Manifest.txt CHANGED
@@ -33,6 +33,7 @@ lib/pipeline/base.rb
33
33
  lib/tracksperanto.rb
34
34
  lib/tracksperanto/block_init.rb
35
35
  lib/tracksperanto/casts.rb
36
+ lib/tracksperanto/const_name.rb
36
37
  lib/tracksperanto/format_detector.rb
37
38
  lib/tracksperanto/keyframe.rb
38
39
  lib/tracksperanto/safety.rb
@@ -91,6 +92,7 @@ test/middleware/test_scaler_middleware.rb
91
92
  test/middleware/test_shift_middleware.rb
92
93
  test/middleware/test_slip_middleware.rb
93
94
  test/pipeline/test_pipeline_base.rb
95
+ test/test_const_name.rb
94
96
  test/test_format_detector.rb
95
97
  test/test_keyframe.rb
96
98
  test/test_tracker.rb
data/lib/export/base.rb CHANGED
@@ -3,6 +3,7 @@
3
3
  # exporter will be notified when a tracker will be exported and when a tracker has been passed
4
4
  # (the last keyframe has been sent)
5
5
  class Tracksperanto::Export::Base
6
+ include Tracksperanto::ConstName
6
7
 
7
8
  attr_reader :io
8
9
 
data/lib/import/base.rb CHANGED
@@ -6,6 +6,7 @@ class Tracksperanto::Import::Base
6
6
  include Tracksperanto::Casts
7
7
  include Tracksperanto::BlockInit
8
8
  include Tracksperanto::ZipTuples
9
+ include Tracksperanto::ConstName
9
10
 
10
11
  # Tracksperanto will assign a proc that reports the status of the import to the caller.
11
12
  # This block is automatically used by report_progress IF the proc is assigned. Should
@@ -29,7 +30,8 @@ class Tracksperanto::Import::Base
29
30
  cast_to_int :width, :height
30
31
  safe_reader :width, :height
31
32
 
32
- # Used to register your importer in the list of supported formats
33
+ # Used to register your importer in the list of supported formats.
34
+ # Normally you would not need to override this
33
35
  def self.inherited(by)
34
36
  Tracksperanto.importers << by
35
37
  super
@@ -7,7 +7,7 @@ class Tracksperanto::Import::Syntheyes < Tracksperanto::Import::Base
7
7
  def parse(io)
8
8
  trackers = []
9
9
  io.each_line do | line |
10
- name, frame, x, y, corr = line.split
10
+ name, frame, x, y, frame_status = line.split
11
11
 
12
12
  # Do we already have this tracker?
13
13
  t = trackers.find {|e| e.name == name}
@@ -22,7 +22,6 @@ class Tracksperanto::Import::Syntheyes < Tracksperanto::Import::Base
22
22
  e.frame = frame
23
23
  e.abs_x = convert_from_uv(width, x)
24
24
  e.abs_y = height - convert_from_uv(height, y) # Convert TL to BL
25
- e.residual = corr
26
25
  end
27
26
  report_progress("Adding keyframe #{frame} to #{name}")
28
27
  end
@@ -31,6 +30,8 @@ class Tracksperanto::Import::Syntheyes < Tracksperanto::Import::Base
31
30
  end
32
31
 
33
32
  private
33
+ # Syntheyes exports UV coordinates that go from -1 to 1, up and right and 0
34
+ # is the center
34
35
  def convert_from_uv(absolute_side, uv_value)
35
36
  # First, start from zero (-.1 becomes .4)
36
37
  value_off_corner = (uv_value.to_f / 2) + 0.5
@@ -4,7 +4,16 @@
4
4
  class Tracksperanto::Middleware::Base
5
5
  include Tracksperanto::Casts
6
6
  include Tracksperanto::BlockInit
7
+ include Tracksperanto::ConstName
7
8
 
9
+ # Used to automatically register your middleware in Tracksperanto.middlewares
10
+ # Normally you wouldn't need to override this
11
+ def self.inherited(by)
12
+ Tracksperanto.middlewares << by
13
+ super
14
+ end
15
+
16
+ # Constructor accepts the exporter that will be wrapped
8
17
  def initialize(exporter, *args_for_block_init)
9
18
  @exporter = exporter
10
19
  super(*args_for_block_init)
data/lib/tracksperanto.rb CHANGED
@@ -4,7 +4,7 @@ require 'delegate'
4
4
 
5
5
  module Tracksperanto
6
6
  PATH = File.expand_path(File.dirname(__FILE__))
7
- VERSION = '1.2.4'
7
+ VERSION = '1.2.6'
8
8
 
9
9
  module Import; end
10
10
  module Export; end
@@ -23,14 +23,26 @@ module Tracksperanto
23
23
 
24
24
  # Returns the names of all the importers
25
25
  def importer_names
26
- importers.map{|e| e.to_s.split('::').pop }
26
+ importers.map{|e| e.const_name }
27
27
  end
28
+
29
+ # Returns the names of all the exporters
30
+ def exporter_names
31
+ exporters.map{|e| e.const_name }
32
+ end
33
+
34
+ # Returns the names of all the middlewares
35
+ def middleware_names
36
+ middlewares.map{|e| e.const_name }
37
+ end
38
+
28
39
  end
40
+
29
41
  self.exporters, self.importers, self.middlewares = [], [], []
30
42
 
31
43
  end
32
44
 
33
- %w( casts block_init safety zip_tuples keyframe tracker format_detector).each do | submodule |
45
+ %w( const_name casts block_init safety zip_tuples keyframe tracker format_detector).each do | submodule |
34
46
  require File.join(Tracksperanto::PATH, "tracksperanto", submodule)
35
47
  end
36
48
 
@@ -0,0 +1,16 @@
1
+ module Tracksperanto::ConstName
2
+ module C
3
+ def const_name
4
+ to_s.split('::').pop
5
+ end
6
+ end
7
+
8
+ def const_name
9
+ self.class.const_name
10
+ end
11
+
12
+ def self.included(into)
13
+ into.extend(C)
14
+ super
15
+ end
16
+ end
@@ -25,6 +25,6 @@ class SyntheyesImportTest < Test::Unit::TestCase
25
25
  assert_equal 0, first_kf.frame
26
26
  assert_in_delta 715.839, first_kf.abs_x, DELTA
27
27
  assert_in_delta 886.212, first_kf.abs_y, DELTA
28
- assert_in_delta 30.0, first_kf.residual, DELTA
28
+ assert_in_delta 0.0, first_kf.residual, DELTA
29
29
  end
30
30
  end
@@ -0,0 +1,12 @@
1
+ require File.dirname(__FILE__) + '/helper'
2
+
3
+ class ConstNameTest < Test::Unit::TestCase
4
+
5
+ def test_const_name
6
+ assert_equal "Scaler", Tracksperanto::Middleware::Scaler.const_name
7
+ assert_equal "Scaler", Tracksperanto::Middleware::Scaler.new(nil).const_name
8
+ assert_equal "ShakeScript", Tracksperanto::Import::ShakeScript.const_name
9
+ assert_equal "ShakeText", Tracksperanto::Export::ShakeText.const_name
10
+ end
11
+
12
+ end
@@ -2,17 +2,17 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{tracksperanto}
5
- s.version = "1.2.2"
5
+ s.version = "1.2.6"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Julik Tarkhanov"]
9
- s.date = %q{2009-09-21}
9
+ s.date = %q{2009-09-22}
10
10
  s.default_executable = %q{tracksperanto}
11
11
  s.description = %q{Tracksperanto is a universal 2D-track translator between many apps.}
12
12
  s.email = ["me@julik.nl"]
13
13
  s.executables = ["tracksperanto"]
14
14
  s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.txt"]
15
- s.files = [".DS_Store", "History.txt", "Manifest.txt", "README.txt", "Rakefile", "bin/tracksperanto", "lib/.DS_Store", "lib/export/base.rb", "lib/export/match_mover.rb", "lib/export/mux.rb", "lib/export/nuke_script.rb", "lib/export/pftrack.rb", "lib/export/pftrack_5.rb", "lib/export/shake_text.rb", "lib/export/syntheyes.rb", "lib/import/base.rb", "lib/import/flame_stabilizer.rb", "lib/import/match_mover.rb", "lib/import/nuke_script.rb", "lib/import/pftrack.rb", "lib/import/shake_grammar/catcher.rb", "lib/import/shake_grammar/lexer.rb", "lib/import/shake_script.rb", "lib/import/shake_text.rb", "lib/import/syntheyes.rb", "lib/middleware/base.rb", "lib/middleware/golden.rb", "lib/middleware/reformat.rb", "lib/middleware/scaler.rb", "lib/middleware/shift.rb", "lib/middleware/slipper.rb", "lib/pipeline/base.rb", "lib/tracksperanto.rb", "lib/tracksperanto/block_init.rb", "lib/tracksperanto/casts.rb", "lib/tracksperanto/format_detector.rb", "lib/tracksperanto/keyframe.rb", "lib/tracksperanto/safety.rb", "lib/tracksperanto/tracker.rb", "lib/tracksperanto/zip_tuples.rb", "test/.DS_Store", "test/export/.DS_Store", "test/export/README_EXPORT_TESTS.txt", "test/export/samples/ref_NukeScript.nk", "test/export/samples/ref_NukeScript.nk.autosave", "test/export/samples/ref_PFTrack.2dt", "test/export/samples/ref_PFTrack5.2dt", "test/export/samples/ref_ShakeText.txt", "test/export/samples/ref_Syntheyes.txt", "test/export/samples/ref_matchmover.rz2", "test/export/test_match_mover_export.rb", "test/export/test_mux.rb", "test/export/test_nuke_export.rb", "test/export/test_pftrack5_export.rb", "test/export/test_pftrack_export.rb", "test/export/test_shake_export.rb", "test/export/test_syntheyes_export.rb", "test/helper.rb", "test/import/.DS_Store", "test/import/samples/.DS_Store", "test/import/samples/flyover2DP_syntheyes.txt", "test/import/samples/four_tracks_in_one_matchmove.shk", "test/import/samples/four_tracks_in_one_stabilizer.shk", "test/import/samples/fromCombustion_fromMidClip_wSnap.stabilizer", "test/import/samples/garage.2dt", "test/import/samples/hugeFlameSetup.stabilizer", "test/import/samples/kipPointsMatchmover.rz2", "test/import/samples/megaTrack.action.3dtrack.stabilizer", "test/import/samples/one_shake_tracker.txt", "test/import/samples/one_shake_tracker_from_first.txt", "test/import/samples/one_tracker_with_break.nk", "test/import/samples/one_tracker_with_break_in_grp.nk", "test/import/samples/shake_tracker_nodes.shk", "test/import/samples/shake_tracker_nodes_to_syntheyes.txt", "test/import/samples/sourcefile_pftrack.2dt", "test/import/samples/three_tracks_in_one_stabilizer.shk", "test/import/samples/two_shake_trackers.txt", "test/import/samples/two_tracks_in_one_tracker.shk", "test/import/test_flame_import.rb", "test/import/test_match_mover_import.rb", "test/import/test_nuke_import.rb", "test/import/test_pftrack_import.rb", "test/import/test_shake_catcher.rb", "test/import/test_shake_lexer.rb", "test/import/test_shake_script_import.rb", "test/import/test_shake_text_import.rb", "test/import/test_syntheyes_import.rb", "test/middleware/test_golden_middleware.rb", "test/middleware/test_reformat_middleware.rb", "test/middleware/test_scaler_middleware.rb", "test/middleware/test_shift_middleware.rb", "test/middleware/test_slip_middleware.rb", "test/pipeline/test_pipeline_base.rb", "test/test_format_detector.rb", "test/test_keyframe.rb", "test/test_tracker.rb", "tracksperanto.gemspec"]
15
+ s.files = [".DS_Store", "History.txt", "Manifest.txt", "README.txt", "Rakefile", "bin/tracksperanto", "lib/.DS_Store", "lib/export/base.rb", "lib/export/match_mover.rb", "lib/export/mux.rb", "lib/export/nuke_script.rb", "lib/export/pftrack.rb", "lib/export/pftrack_5.rb", "lib/export/shake_text.rb", "lib/export/syntheyes.rb", "lib/import/base.rb", "lib/import/flame_stabilizer.rb", "lib/import/match_mover.rb", "lib/import/nuke_script.rb", "lib/import/pftrack.rb", "lib/import/shake_grammar/catcher.rb", "lib/import/shake_grammar/lexer.rb", "lib/import/shake_script.rb", "lib/import/shake_text.rb", "lib/import/syntheyes.rb", "lib/middleware/base.rb", "lib/middleware/golden.rb", "lib/middleware/reformat.rb", "lib/middleware/scaler.rb", "lib/middleware/shift.rb", "lib/middleware/slipper.rb", "lib/pipeline/base.rb", "lib/tracksperanto.rb", "lib/tracksperanto/block_init.rb", "lib/tracksperanto/casts.rb", "lib/tracksperanto/const_name.rb", "lib/tracksperanto/format_detector.rb", "lib/tracksperanto/keyframe.rb", "lib/tracksperanto/safety.rb", "lib/tracksperanto/tracker.rb", "lib/tracksperanto/zip_tuples.rb", "test/.DS_Store", "test/export/.DS_Store", "test/export/README_EXPORT_TESTS.txt", "test/export/samples/ref_NukeScript.nk", "test/export/samples/ref_NukeScript.nk.autosave", "test/export/samples/ref_PFTrack.2dt", "test/export/samples/ref_PFTrack5.2dt", "test/export/samples/ref_ShakeText.txt", "test/export/samples/ref_Syntheyes.txt", "test/export/samples/ref_matchmover.rz2", "test/export/test_match_mover_export.rb", "test/export/test_mux.rb", "test/export/test_nuke_export.rb", "test/export/test_pftrack5_export.rb", "test/export/test_pftrack_export.rb", "test/export/test_shake_export.rb", "test/export/test_syntheyes_export.rb", "test/helper.rb", "test/import/.DS_Store", "test/import/samples/.DS_Store", "test/import/samples/flyover2DP_syntheyes.txt", "test/import/samples/four_tracks_in_one_matchmove.shk", "test/import/samples/four_tracks_in_one_stabilizer.shk", "test/import/samples/fromCombustion_fromMidClip_wSnap.stabilizer", "test/import/samples/garage.2dt", "test/import/samples/hugeFlameSetup.stabilizer", "test/import/samples/kipPointsMatchmover.rz2", "test/import/samples/megaTrack.action.3dtrack.stabilizer", "test/import/samples/one_shake_tracker.txt", "test/import/samples/one_shake_tracker_from_first.txt", "test/import/samples/one_tracker_with_break.nk", "test/import/samples/one_tracker_with_break_in_grp.nk", "test/import/samples/shake_tracker_nodes.shk", "test/import/samples/shake_tracker_nodes_to_syntheyes.txt", "test/import/samples/sourcefile_pftrack.2dt", "test/import/samples/three_tracks_in_one_stabilizer.shk", "test/import/samples/two_shake_trackers.txt", "test/import/samples/two_tracks_in_one_tracker.shk", "test/import/test_flame_import.rb", "test/import/test_match_mover_import.rb", "test/import/test_nuke_import.rb", "test/import/test_pftrack_import.rb", "test/import/test_shake_catcher.rb", "test/import/test_shake_lexer.rb", "test/import/test_shake_script_import.rb", "test/import/test_shake_text_import.rb", "test/import/test_syntheyes_import.rb", "test/middleware/test_golden_middleware.rb", "test/middleware/test_reformat_middleware.rb", "test/middleware/test_scaler_middleware.rb", "test/middleware/test_shift_middleware.rb", "test/middleware/test_slip_middleware.rb", "test/pipeline/test_pipeline_base.rb", "test/test_const_name.rb", "test/test_format_detector.rb", "test/test_keyframe.rb", "test/test_tracker.rb", "tracksperanto.gemspec"]
16
16
  s.has_rdoc = true
17
17
  s.homepage = %q{http://guerilla-di.org/tracksperanto}
18
18
  s.rdoc_options = ["--main", "README.txt"]
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.rubyforge_project = %q{guerilla-di}
21
21
  s.rubygems_version = %q{1.3.1}
22
22
  s.summary = %q{Tracksperanto is a universal 2D-track translator between many apps.}
23
- s.test_files = ["test/export/test_match_mover_export.rb", "test/export/test_mux.rb", "test/export/test_nuke_export.rb", "test/export/test_pftrack5_export.rb", "test/export/test_pftrack_export.rb", "test/export/test_shake_export.rb", "test/export/test_syntheyes_export.rb", "test/import/test_flame_import.rb", "test/import/test_match_mover_import.rb", "test/import/test_nuke_import.rb", "test/import/test_pftrack_import.rb", "test/import/test_shake_catcher.rb", "test/import/test_shake_lexer.rb", "test/import/test_shake_script_import.rb", "test/import/test_shake_text_import.rb", "test/import/test_syntheyes_import.rb", "test/middleware/test_golden_middleware.rb", "test/middleware/test_reformat_middleware.rb", "test/middleware/test_scaler_middleware.rb", "test/middleware/test_shift_middleware.rb", "test/middleware/test_slip_middleware.rb", "test/pipeline/test_pipeline_base.rb", "test/test_format_detector.rb", "test/test_keyframe.rb", "test/test_tracker.rb"]
23
+ s.test_files = ["test/export/test_match_mover_export.rb", "test/export/test_mux.rb", "test/export/test_nuke_export.rb", "test/export/test_pftrack5_export.rb", "test/export/test_pftrack_export.rb", "test/export/test_shake_export.rb", "test/export/test_syntheyes_export.rb", "test/import/test_flame_import.rb", "test/import/test_match_mover_import.rb", "test/import/test_nuke_import.rb", "test/import/test_pftrack_import.rb", "test/import/test_shake_catcher.rb", "test/import/test_shake_lexer.rb", "test/import/test_shake_script_import.rb", "test/import/test_shake_text_import.rb", "test/import/test_syntheyes_import.rb", "test/middleware/test_golden_middleware.rb", "test/middleware/test_reformat_middleware.rb", "test/middleware/test_scaler_middleware.rb", "test/middleware/test_shift_middleware.rb", "test/middleware/test_slip_middleware.rb", "test/pipeline/test_pipeline_base.rb", "test/test_const_name.rb", "test/test_format_detector.rb", "test/test_keyframe.rb", "test/test_tracker.rb"]
24
24
 
25
25
  if s.respond_to? :specification_version then
26
26
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
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: 1.2.4
4
+ version: 1.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julik Tarkhanov
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-21 00:00:00 +02:00
12
+ date: 2009-09-22 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -79,6 +79,7 @@ files:
79
79
  - lib/tracksperanto.rb
80
80
  - lib/tracksperanto/block_init.rb
81
81
  - lib/tracksperanto/casts.rb
82
+ - lib/tracksperanto/const_name.rb
82
83
  - lib/tracksperanto/format_detector.rb
83
84
  - lib/tracksperanto/keyframe.rb
84
85
  - lib/tracksperanto/safety.rb
@@ -137,6 +138,7 @@ files:
137
138
  - test/middleware/test_shift_middleware.rb
138
139
  - test/middleware/test_slip_middleware.rb
139
140
  - test/pipeline/test_pipeline_base.rb
141
+ - test/test_const_name.rb
140
142
  - test/test_format_detector.rb
141
143
  - test/test_keyframe.rb
142
144
  - test/test_tracker.rb
@@ -191,6 +193,7 @@ test_files:
191
193
  - test/middleware/test_shift_middleware.rb
192
194
  - test/middleware/test_slip_middleware.rb
193
195
  - test/pipeline/test_pipeline_base.rb
196
+ - test/test_const_name.rb
194
197
  - test/test_format_detector.rb
195
198
  - test/test_keyframe.rb
196
199
  - test/test_tracker.rb