tracksperanto 2.9.4 → 2.9.5
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/DEVELOPER_DOCS.rdoc +2 -8
- data/History.txt +4 -0
- data/MIT_LICENSE.txt +1 -1
- data/lib/export/base.rb +1 -2
- data/lib/export/maya_locators.rb +10 -2
- data/lib/import/base.rb +2 -15
- data/lib/import/match_mover_rzml.rb +3 -0
- data/lib/pipeline/base.rb +10 -14
- data/lib/tracksperanto.rb +2 -15
- data/test/export/samples/{ref_MayaLocators.mel → ref_MayaLocators.ma} +4 -0
- data/test/export/test_maya_locators_export.rb +3 -3
- data/test/test_casts.rb +59 -0
- data/test/test_cli.rb +2 -2
- data/test/test_const_name.rb +1 -1
- data/test/test_format_detector.rb +1 -1
- data/test/test_keyframe.rb +1 -1
- data/test/test_pipeline.rb +8 -1
- data/test/test_safety.rb +21 -0
- data/test/test_zip_tuples.rb +25 -0
- data/tracksperanto.gemspec +6 -3
- metadata +24 -21
data/DEVELOPER_DOCS.rdoc
CHANGED
|
@@ -14,7 +14,7 @@ Tracksperanto is currently being developed on Ruby 1.9.3 but it should also work
|
|
|
14
14
|
in the Gemfile plus Bundler. Please develop against the git repo checkout since we no longer package the test fixtures with the gem.
|
|
15
15
|
|
|
16
16
|
* Checkout the repo at http://github.com/guerilla-di/tracksperanto
|
|
17
|
-
* Run `bundle install' and
|
|
17
|
+
* Run `bundle install' and `bundle exec rake' to run the tests
|
|
18
18
|
* Carry your development, in your own branch or feature branch
|
|
19
19
|
* File a pull request or send a patch to info at guerilla-di.org
|
|
20
20
|
|
|
@@ -48,12 +48,6 @@ to write your own Pipeline class or reimplement parts of it.
|
|
|
48
48
|
Almost every module in Tracksperanto has a method called report_progress. This method is used to notify an external callback of what you are doing, and helps keep
|
|
49
49
|
the software user-friendly. A well-behaved Tracksperanto module should manage it's progress reports properly.
|
|
50
50
|
|
|
51
|
-
=== Reusing components
|
|
52
|
-
|
|
53
|
-
Tracksperanto contains some nice bits, such as a full grammar lexer for Shake scripts (Tracksperanto::ShakeGrammar::Lexer), a couple of handy buffering
|
|
54
|
-
classes (Tracksperanto::BufferIO and Tracksperanto::Accumulator) and a parser for any Flame setups containing channels (Tracksperanto::Import::FlameStabilizer).
|
|
55
|
-
Play responsibly.
|
|
56
|
-
|
|
57
51
|
=== Sample script
|
|
58
52
|
|
|
59
53
|
require "rubygems"
|
|
@@ -73,7 +67,7 @@ Play responsibly.
|
|
|
73
67
|
|
|
74
68
|
# The importer responds to each() so if your file is not too big you can just load all the trackers
|
|
75
69
|
# as an array. If you expect to have alot of trackers investigate a way to buffer them on disk
|
|
76
|
-
# instead (see
|
|
70
|
+
# instead (see Obuf)
|
|
77
71
|
trackers = some_importer.to_a
|
|
78
72
|
|
|
79
73
|
# Create the exporter and pass the output file to it
|
data/History.txt
CHANGED
data/MIT_LICENSE.txt
CHANGED
data/lib/export/base.rb
CHANGED
|
@@ -24,8 +24,7 @@
|
|
|
24
24
|
#
|
|
25
25
|
# By contract export_point will be called at least once for each tracker being exported (no empty trackers will be sent)
|
|
26
26
|
class Tracksperanto::Export::Base
|
|
27
|
-
include Tracksperanto::ConstName
|
|
28
|
-
include Tracksperanto::SimpleExport
|
|
27
|
+
include Tracksperanto::ConstName, Tracksperanto::SimpleExport
|
|
29
28
|
|
|
30
29
|
attr_reader :io
|
|
31
30
|
|
data/lib/export/maya_locators.rb
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
|
2
2
|
# Export each tracker as a moving Maya locator
|
|
3
3
|
class Tracksperanto::Export::MayaLocators < Tracksperanto::Export::Base
|
|
4
|
+
SCENE_PREAMBLE = [
|
|
5
|
+
'//Maya ASCII 2011 scene',
|
|
6
|
+
'//Name: TracksperantoLocators.ma',
|
|
7
|
+
'//Codeset: UTF-8',
|
|
8
|
+
'requires maya "1.0";'
|
|
9
|
+
].join("\n")
|
|
10
|
+
|
|
4
11
|
PREAMBLE = 'polyPlane -name "TracksperantoImagePlane" -width %0.5f -height %0.5f;'
|
|
5
12
|
LOCATOR_PREAMBLE = 'spaceLocator -name "%s" -p 0 0 0;'
|
|
6
13
|
KEYFRAME_TEMPLATE = 'setKeyframe -time %d -value %0.5f "%s.%s";';
|
|
7
14
|
MULTIPLIER = 10.0
|
|
8
15
|
|
|
9
16
|
def self.desc_and_extension
|
|
10
|
-
"mayaLocators.
|
|
17
|
+
"mayaLocators.ma"
|
|
11
18
|
end
|
|
12
19
|
|
|
13
20
|
def self.human_name
|
|
14
|
-
"Maya
|
|
21
|
+
"Maya ASCII scene with locators on an image plane"
|
|
15
22
|
end
|
|
16
23
|
|
|
17
24
|
def start_export(w, h)
|
|
@@ -19,6 +26,7 @@ class Tracksperanto::Export::MayaLocators < Tracksperanto::Export::Base
|
|
|
19
26
|
# and scale the height to that
|
|
20
27
|
@factor = (1 / w.to_f) * MULTIPLIER
|
|
21
28
|
|
|
29
|
+
@io.puts(SCENE_PREAMBLE)
|
|
22
30
|
@io.puts(PREAMBLE % [MULTIPLIER, h * @factor])
|
|
23
31
|
@io.puts('rotate -r -os 90;') # Position it in the XY plane
|
|
24
32
|
@io.puts('move -r %0.5f %0.5f 0;' % [MULTIPLIER / 2.0, h * @factor / 2.0])
|
data/lib/import/base.rb
CHANGED
|
@@ -5,12 +5,8 @@
|
|
|
5
5
|
# basic, and consists only of a few methods. The main method is
|
|
6
6
|
# `each`.
|
|
7
7
|
class Tracksperanto::Import::Base
|
|
8
|
-
include Enumerable
|
|
9
|
-
include Tracksperanto::
|
|
10
|
-
include Tracksperanto::Casts
|
|
11
|
-
include Tracksperanto::BlockInit
|
|
12
|
-
include Tracksperanto::ZipTuples
|
|
13
|
-
include Tracksperanto::ConstName
|
|
8
|
+
include Enumerable, Tracksperanto::Safety, Tracksperanto::Casts
|
|
9
|
+
include Tracksperanto::BlockInit, Tracksperanto::ZipTuples, Tracksperanto::ConstName
|
|
14
10
|
|
|
15
11
|
# Handle to the IO with data being parsed
|
|
16
12
|
attr_accessor :io
|
|
@@ -41,9 +37,6 @@ class Tracksperanto::Import::Base
|
|
|
41
37
|
super
|
|
42
38
|
end
|
|
43
39
|
|
|
44
|
-
# OBSOLETE, do not use
|
|
45
|
-
attr_accessor :receiver
|
|
46
|
-
|
|
47
40
|
# Return an extension WITH DOT if this format has a typical extension that
|
|
48
41
|
# you can detect (like ".nk" for Nuke)
|
|
49
42
|
def self.distinct_file_ext
|
|
@@ -72,10 +65,4 @@ class Tracksperanto::Import::Base
|
|
|
72
65
|
# width and height as well.
|
|
73
66
|
def each
|
|
74
67
|
end
|
|
75
|
-
|
|
76
|
-
# OBSOLETE: do not use
|
|
77
|
-
def send_tracker(tracker_obj)
|
|
78
|
-
STDERR.puts "Import::Base#send_tracker has been deprecated, please rewrite your importer to use yield(t) inside each instead"
|
|
79
|
-
@receiver.push(tracker_obj)
|
|
80
|
-
end
|
|
81
68
|
end
|
|
@@ -42,6 +42,7 @@ class Tracksperanto::Import::MatchMoverRZML < Tracksperanto::Import::Base
|
|
|
42
42
|
# <IFRM>
|
|
43
43
|
# <M i="1" k="i" x="626.68" y="488.56" tt="0.8000000119" cf="0">
|
|
44
44
|
if element_name.downcase == 'm'
|
|
45
|
+
@parser.report_progress "Adding tracker"
|
|
45
46
|
@trackers.push(Tracksperanto::Tracker.new(:name => attrs["i"]))
|
|
46
47
|
end
|
|
47
48
|
|
|
@@ -51,6 +52,7 @@ class Tracksperanto::Import::MatchMoverRZML < Tracksperanto::Import::Base
|
|
|
51
52
|
|
|
52
53
|
if element_name.downcase == "m"
|
|
53
54
|
target_marker = @trackers.find{|e| e.name == attrs["i"] }
|
|
55
|
+
@parser.report_progress "Recovering keyframe at #{@frame}"
|
|
54
56
|
target_marker.keyframe!(:frame => @frame, :abs_x => attrs["x"], :abs_y => (@parser.height - attrs["y"].to_f), :residual => attrs["tt"])
|
|
55
57
|
end
|
|
56
58
|
end
|
|
@@ -61,6 +63,7 @@ class Tracksperanto::Import::MatchMoverRZML < Tracksperanto::Import::Base
|
|
|
61
63
|
@trackers.reject!{|e| e.empty? }
|
|
62
64
|
|
|
63
65
|
@trackers.each do | recovered_tracker |
|
|
66
|
+
@parser.report_progress "Pushing tracker #{recovered_tracker.name.inspect}"
|
|
64
67
|
@cb.call(recovered_tracker)
|
|
65
68
|
end
|
|
66
69
|
end
|
data/lib/pipeline/base.rb
CHANGED
|
@@ -14,7 +14,7 @@ module Tracksperanto::Pipeline
|
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
class NoTrackersRecoveredError < RuntimeError
|
|
17
|
-
def message;
|
|
17
|
+
def message;
|
|
18
18
|
"Could not recover any non-empty trackers from this file.\n" +
|
|
19
19
|
"Wrong import format maybe?\n" +
|
|
20
20
|
"Note that PFTrack will only export trackers from the solved segment of the shot.";
|
|
@@ -40,8 +40,7 @@ module Tracksperanto::Pipeline
|
|
|
40
40
|
|
|
41
41
|
include Tracksperanto::BlockInit
|
|
42
42
|
|
|
43
|
-
# How many points have been converted
|
|
44
|
-
# after they have been exported
|
|
43
|
+
# How many points have been converted
|
|
45
44
|
attr_reader :converted_points
|
|
46
45
|
|
|
47
46
|
# How many keyframes have been converted
|
|
@@ -53,7 +52,7 @@ module Tracksperanto::Pipeline
|
|
|
53
52
|
# percent complete
|
|
54
53
|
attr_accessor :progress_block
|
|
55
54
|
|
|
56
|
-
# Assign an array of
|
|
55
|
+
# Assign an array of exporter classes to use them instead of the default "All"
|
|
57
56
|
attr_accessor :exporters
|
|
58
57
|
|
|
59
58
|
# Contains arrays of the form ["MiddewareName", {:param => value}]
|
|
@@ -65,6 +64,8 @@ module Tracksperanto::Pipeline
|
|
|
65
64
|
@ios = []
|
|
66
65
|
end
|
|
67
66
|
|
|
67
|
+
# Will scan the middleware_tuples attribute and create a processing chain.
|
|
68
|
+
# Middlewares will be instantiated and wrap each other, starting with the first one
|
|
68
69
|
def wrap_output_with_middlewares(output)
|
|
69
70
|
return output unless (middleware_tuples && middleware_tuples.any?)
|
|
70
71
|
|
|
@@ -77,7 +78,8 @@ module Tracksperanto::Pipeline
|
|
|
77
78
|
# * width - The comp width, for the case that the format does not support auto size
|
|
78
79
|
# * height - The comp height, for the case that the format does not support auto size
|
|
79
80
|
# * parser - The parser class, for the case that it can't be autodetected from the file name
|
|
80
|
-
|
|
81
|
+
# Returns the number of trackers and the number of keyframes processed during the run
|
|
82
|
+
def run(from_input_file_path, passed_options = {})
|
|
81
83
|
|
|
82
84
|
# Check for empty files
|
|
83
85
|
raise EmptySourceFileError if File.stat(from_input_file_path).size.zero?
|
|
@@ -148,7 +150,7 @@ module Tracksperanto::Pipeline
|
|
|
148
150
|
# Wrap the input in a progressive IO, setup a lambda that will spy on the reader and
|
|
149
151
|
# update the percentage. We will only broadcast messages that come from the parser
|
|
150
152
|
# though (complementing it with a percentage)
|
|
151
|
-
io_with_progress =
|
|
153
|
+
io_with_progress = ProgressiveIO.new(tracker_data_io) do | offset, of_total |
|
|
152
154
|
percent_complete = (50.0 / of_total) * offset
|
|
153
155
|
|
|
154
156
|
# Some importers do not signal where they are and do not send nice reports. The way we can help that in the interim
|
|
@@ -163,14 +165,8 @@ module Tracksperanto::Pipeline
|
|
|
163
165
|
|
|
164
166
|
begin
|
|
165
167
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
importer.each {|t| @accumulator.push(t) unless t.empty? }
|
|
169
|
-
else # OBSOLETE - for this version we are going to permit it.
|
|
170
|
-
STDERR.puts "Import::Base#stream_parse(io) is obsolete, please rewrite your importer to use each instead"
|
|
171
|
-
importer.receiver = @accumulator
|
|
172
|
-
importer.stream_parse(io_with_progress)
|
|
173
|
-
end
|
|
168
|
+
importer.io = io_with_progress
|
|
169
|
+
importer.each {|t| @accumulator.push(t) unless t.empty? }
|
|
174
170
|
|
|
175
171
|
report_progress(percent_complete = 50.0, "Validating #{@accumulator.size} imported trackers")
|
|
176
172
|
raise NoTrackersRecoveredError if @accumulator.size.zero?
|
data/lib/tracksperanto.rb
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
|
2
|
-
|
|
3
|
-
require 'delegate'
|
|
4
|
-
require 'tempfile'
|
|
5
|
-
require 'flame_channel_parser'
|
|
6
|
-
require "obuf"
|
|
7
|
-
require "progressive_io"
|
|
2
|
+
%w( stringio delegate tempfile flame_channel_parser obuf progressive_io ).map(&method(:require))
|
|
8
3
|
|
|
9
4
|
module Tracksperanto
|
|
10
5
|
PATH = File.expand_path(File.dirname(__FILE__))
|
|
11
|
-
VERSION = '2.9.
|
|
6
|
+
VERSION = '2.9.5'
|
|
12
7
|
|
|
13
8
|
module Import; end
|
|
14
9
|
module Export; end
|
|
@@ -74,14 +69,6 @@ module Tracksperanto
|
|
|
74
69
|
raise UnknownImporterError, "Unknown importer #{name.inspect}"
|
|
75
70
|
end
|
|
76
71
|
|
|
77
|
-
# DEPRECATED, will be removed in Tracksperanto 3
|
|
78
|
-
class Accumulator < Obuf
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
# DEPRECATED, will be removed in Tracksperanto 3
|
|
82
|
-
class Tracksperanto::ProgressiveIO < ProgressiveIO
|
|
83
|
-
end
|
|
84
|
-
|
|
85
72
|
end
|
|
86
73
|
|
|
87
74
|
%w(
|
|
@@ -4,14 +4,14 @@ require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
|
|
4
4
|
class MayaLocatorsExportTest < Test::Unit::TestCase
|
|
5
5
|
include ParabolicTracks
|
|
6
6
|
|
|
7
|
-
P_LOCATORS = File.dirname(__FILE__) + "/samples/ref_MayaLocators.
|
|
7
|
+
P_LOCATORS = File.dirname(__FILE__) + "/samples/ref_MayaLocators.ma"
|
|
8
8
|
|
|
9
9
|
def test_export_output_written
|
|
10
10
|
ensure_same_output Tracksperanto::Export::MayaLocators, P_LOCATORS
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
def test_exporter_meta
|
|
14
|
-
assert_equal "mayaLocators.
|
|
15
|
-
assert_equal "Maya
|
|
14
|
+
assert_equal "mayaLocators.ma", Tracksperanto::Export::MayaLocators.desc_and_extension
|
|
15
|
+
assert_equal "Maya ASCII scene with locators on an image plane", Tracksperanto::Export::MayaLocators.human_name
|
|
16
16
|
end
|
|
17
17
|
end
|
data/test/test_casts.rb
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
|
3
|
+
|
|
4
|
+
class TestCasts < Test::Unit::TestCase
|
|
5
|
+
D = 0.0001
|
|
6
|
+
|
|
7
|
+
class Testable
|
|
8
|
+
include Tracksperanto::Casts
|
|
9
|
+
attr_accessor :vanilla, :str_attr, :int_attr, :float_attr
|
|
10
|
+
cast_to_string :str_attr
|
|
11
|
+
cast_to_int :int_attr
|
|
12
|
+
cast_to_float :float_attr
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
class Junk
|
|
16
|
+
def to_s
|
|
17
|
+
"Random"
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def test_cast_to_float
|
|
22
|
+
t = Testable.new
|
|
23
|
+
assert_kind_of Float, t.float_attr, "Uninitialized float attr should be a float"
|
|
24
|
+
assert_in_delta 0, t.float_attr, D
|
|
25
|
+
|
|
26
|
+
t.float_attr = "3"
|
|
27
|
+
assert_kind_of Float, t.float_attr
|
|
28
|
+
assert_in_delta 3.0, t.float_attr, D
|
|
29
|
+
|
|
30
|
+
t.float_attr = "a"
|
|
31
|
+
assert_kind_of Float, t.float_attr
|
|
32
|
+
assert_in_delta 0, t.float_attr, D
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def test_cast_to_int
|
|
36
|
+
t = Testable.new
|
|
37
|
+
|
|
38
|
+
assert_equal 0, t.int_attr, "Uninitialized int attr should be an int"
|
|
39
|
+
|
|
40
|
+
t.int_attr = "3.1"
|
|
41
|
+
assert_kind_of Fixnum, t.int_attr
|
|
42
|
+
assert_equal 3, t.int_attr
|
|
43
|
+
|
|
44
|
+
t.float_attr = 3.1
|
|
45
|
+
assert_kind_of Fixnum, t.int_attr
|
|
46
|
+
assert_equal 3, t.int_attr
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def test_cast_to_string
|
|
50
|
+
t = Testable.new
|
|
51
|
+
|
|
52
|
+
assert_equal '', t.str_attr
|
|
53
|
+
t.str_attr = 3.123
|
|
54
|
+
assert_equal "3.123", t.str_attr
|
|
55
|
+
|
|
56
|
+
t.str_attr = Junk.new
|
|
57
|
+
assert_equal "Random", t.str_attr
|
|
58
|
+
end
|
|
59
|
+
end
|
data/test/test_cli.rb
CHANGED
|
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
|
|
3
3
|
require "set"
|
|
4
4
|
require "cli_test"
|
|
5
5
|
|
|
6
|
-
class
|
|
6
|
+
class TestCli < Test::Unit::TestCase
|
|
7
7
|
TEMP_DIR = File.expand_path(File.dirname(__FILE__) + "/tmp")
|
|
8
8
|
BIN_P = File.expand_path(File.dirname(__FILE__) + "/../bin/tracksperanto")
|
|
9
9
|
|
|
@@ -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.
|
|
43
|
+
flm_tracksperanto_ruby.rb flm_mayaLocators.ma flm_createNulls.jsx
|
|
44
44
|
)
|
|
45
45
|
|
|
46
46
|
assert_same_set fs, Dir.entries(TEMP_DIR)
|
data/test/test_const_name.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
|
2
2
|
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
|
3
3
|
|
|
4
|
-
class
|
|
4
|
+
class TestConstName < Test::Unit::TestCase
|
|
5
5
|
|
|
6
6
|
def test_const_name
|
|
7
7
|
assert_equal "Scaler", Tracksperanto::Middleware::Scaler.const_name
|
data/test/test_keyframe.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
|
2
2
|
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
|
3
3
|
|
|
4
|
-
class
|
|
4
|
+
class TestKeyframe < Test::Unit::TestCase
|
|
5
5
|
def test_supports_block_init
|
|
6
6
|
keyframe = Tracksperanto::Keyframe.new do |k|
|
|
7
7
|
k.frame = 0
|
data/test/test_pipeline.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
|
2
2
|
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
|
3
3
|
|
|
4
|
-
class
|
|
4
|
+
class TestPipeline < Test::Unit::TestCase
|
|
5
5
|
|
|
6
6
|
def setup
|
|
7
7
|
@old_dir = Dir.pwd
|
|
@@ -57,6 +57,13 @@ class PipelineTest < Test::Unit::TestCase
|
|
|
57
57
|
assert processing_log.include?("Parsing channel \"tracker1/ref/y\"")
|
|
58
58
|
end
|
|
59
59
|
|
|
60
|
+
def test_run_returns_the_number_of_trackers_and_keyframes_processed
|
|
61
|
+
create_stabilizer_file
|
|
62
|
+
pipeline = Tracksperanto::Pipeline::Base.new
|
|
63
|
+
result = pipeline.run(@stabilizer)
|
|
64
|
+
assert_equal [3, 9], result
|
|
65
|
+
end
|
|
66
|
+
|
|
60
67
|
def test_run_crashes_with_empty_file
|
|
61
68
|
empty_file_path = "./input_empty.stabilizer"
|
|
62
69
|
f = File.open(empty_file_path, "w"){|f| f.write('') }
|
data/test/test_safety.rb
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
|
3
|
+
|
|
4
|
+
class TestSafety < Test::Unit::TestCase
|
|
5
|
+
class Testable
|
|
6
|
+
include Tracksperanto::Safety
|
|
7
|
+
attr_accessor :foo, :bar
|
|
8
|
+
safe_reader :foo, :bar
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def test_safe_reader_raises_with_no_ivar
|
|
12
|
+
t = Testable.new
|
|
13
|
+
assert_raise(RuntimeError) { t.foo }
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def test_safe_reader_does_not_raise_with_value_assigned
|
|
17
|
+
t = Testable.new
|
|
18
|
+
t.foo = 123
|
|
19
|
+
assert_nothing_raised { assert_equal 123, t.foo }
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
require File.expand_path(File.dirname(__FILE__)) + '/helper'
|
|
3
|
+
|
|
4
|
+
class TestZipTuples < Test::Unit::TestCase
|
|
5
|
+
include Tracksperanto::ZipTuples
|
|
6
|
+
|
|
7
|
+
def test_zip_with_empty
|
|
8
|
+
assert_equal [], zip_curve_tuples([])
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def test_zip_with_standard_dataset
|
|
12
|
+
assert_equal [[1, 123, 234]], zip_curve_tuples([[1, 123], [1,234]])
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def test_zip_with_missing_step
|
|
16
|
+
assert_equal [[1, 123, 345], [2, 234]], zip_curve_tuples([[1, 123], [1, 345], [2,234]])
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def test_zip_with_two_curves
|
|
20
|
+
curve_a = [[1, 123], [2, 345]]
|
|
21
|
+
curve_b = [[1, 23.4], [2, 14.5]]
|
|
22
|
+
result = [[1, 123, 23.4], [2, 345, 14.5]]
|
|
23
|
+
assert_equal result, zip_curve_tuples(curve_a, curve_b)
|
|
24
|
+
end
|
|
25
|
+
end
|
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.5"
|
|
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-02-
|
|
12
|
+
s.date = "2012-02-16"
|
|
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"]
|
|
@@ -94,7 +94,7 @@ Gem::Specification.new do |s|
|
|
|
94
94
|
"test/export/samples/ref_AfterEffects.jsx",
|
|
95
95
|
"test/export/samples/ref_FlameProperlyReorderedCornerpin.stabilizer",
|
|
96
96
|
"test/export/samples/ref_FlameSimpleReorderedCornerpin.stabilizer",
|
|
97
|
-
"test/export/samples/ref_MayaLocators.
|
|
97
|
+
"test/export/samples/ref_MayaLocators.ma",
|
|
98
98
|
"test/export/samples/ref_Mayalive.txt",
|
|
99
99
|
"test/export/samples/ref_Mayalive_CustomAspect.txt",
|
|
100
100
|
"test/export/samples/ref_NukeScript.nk",
|
|
@@ -159,15 +159,18 @@ Gem::Specification.new do |s|
|
|
|
159
159
|
"test/middleware/test_start_trim_middleware.rb",
|
|
160
160
|
"test/test_buffer_io.rb",
|
|
161
161
|
"test/test_bufferingreader.rb",
|
|
162
|
+
"test/test_casts.rb",
|
|
162
163
|
"test/test_cli.rb",
|
|
163
164
|
"test/test_const_name.rb",
|
|
164
165
|
"test/test_extio.rb",
|
|
165
166
|
"test/test_format_detector.rb",
|
|
166
167
|
"test/test_keyframe.rb",
|
|
167
168
|
"test/test_pipeline.rb",
|
|
169
|
+
"test/test_safety.rb",
|
|
168
170
|
"test/test_simple_export.rb",
|
|
169
171
|
"test/test_tracker.rb",
|
|
170
172
|
"test/test_tracksperanto.rb",
|
|
173
|
+
"test/test_zip_tuples.rb",
|
|
171
174
|
"tracksperanto.gemspec"
|
|
172
175
|
]
|
|
173
176
|
s.homepage = "http://guerilla-di.org/tracksperanto"
|
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.5
|
|
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-02-
|
|
12
|
+
date: 2012-02-16 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: obuf
|
|
16
|
-
requirement: &
|
|
16
|
+
requirement: &3071160 !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: *3071160
|
|
25
25
|
- !ruby/object:Gem::Dependency
|
|
26
26
|
name: progressive_io
|
|
27
|
-
requirement: &
|
|
27
|
+
requirement: &3069860 !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: *3069860
|
|
36
36
|
- !ruby/object:Gem::Dependency
|
|
37
37
|
name: flame_channel_parser
|
|
38
|
-
requirement: &
|
|
38
|
+
requirement: &3068120 !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: *3068120
|
|
47
47
|
- !ruby/object:Gem::Dependency
|
|
48
48
|
name: progressbar
|
|
49
|
-
requirement: &
|
|
49
|
+
requirement: &3066630 !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: *
|
|
57
|
+
version_requirements: *3066630
|
|
58
58
|
- !ruby/object:Gem::Dependency
|
|
59
59
|
name: update_hints
|
|
60
|
-
requirement: &
|
|
60
|
+
requirement: &3064500 !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: *3064500
|
|
69
69
|
- !ruby/object:Gem::Dependency
|
|
70
70
|
name: jeweler
|
|
71
|
-
requirement: &
|
|
71
|
+
requirement: &3062980 !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: *3062980
|
|
80
80
|
- !ruby/object:Gem::Dependency
|
|
81
81
|
name: rake
|
|
82
|
-
requirement: &
|
|
82
|
+
requirement: &3057310 !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: *3057310
|
|
91
91
|
- !ruby/object:Gem::Dependency
|
|
92
92
|
name: flexmock
|
|
93
|
-
requirement: &
|
|
93
|
+
requirement: &3055650 !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: *3055650
|
|
102
102
|
- !ruby/object:Gem::Dependency
|
|
103
103
|
name: cli_test
|
|
104
|
-
requirement: &
|
|
104
|
+
requirement: &3052420 !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: *3052420
|
|
113
113
|
description: Converts 2D track exports between different apps like Flame, MatchMover,
|
|
114
114
|
PFTrack...
|
|
115
115
|
email: me@julik.nl
|
|
@@ -196,7 +196,7 @@ files:
|
|
|
196
196
|
- test/export/samples/ref_AfterEffects.jsx
|
|
197
197
|
- test/export/samples/ref_FlameProperlyReorderedCornerpin.stabilizer
|
|
198
198
|
- test/export/samples/ref_FlameSimpleReorderedCornerpin.stabilizer
|
|
199
|
-
- test/export/samples/ref_MayaLocators.
|
|
199
|
+
- test/export/samples/ref_MayaLocators.ma
|
|
200
200
|
- test/export/samples/ref_Mayalive.txt
|
|
201
201
|
- test/export/samples/ref_Mayalive_CustomAspect.txt
|
|
202
202
|
- test/export/samples/ref_NukeScript.nk
|
|
@@ -261,15 +261,18 @@ files:
|
|
|
261
261
|
- test/middleware/test_start_trim_middleware.rb
|
|
262
262
|
- test/test_buffer_io.rb
|
|
263
263
|
- test/test_bufferingreader.rb
|
|
264
|
+
- test/test_casts.rb
|
|
264
265
|
- test/test_cli.rb
|
|
265
266
|
- test/test_const_name.rb
|
|
266
267
|
- test/test_extio.rb
|
|
267
268
|
- test/test_format_detector.rb
|
|
268
269
|
- test/test_keyframe.rb
|
|
269
270
|
- test/test_pipeline.rb
|
|
271
|
+
- test/test_safety.rb
|
|
270
272
|
- test/test_simple_export.rb
|
|
271
273
|
- test/test_tracker.rb
|
|
272
274
|
- test/test_tracksperanto.rb
|
|
275
|
+
- test/test_zip_tuples.rb
|
|
273
276
|
- tracksperanto.gemspec
|
|
274
277
|
homepage: http://guerilla-di.org/tracksperanto
|
|
275
278
|
licenses:
|