tracksperanto 2.3.0 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ === 2.3.1 / 2011-08-05
2
+
3
+ * Fixed support for curly braces in Shake scripts
4
+ * Added checks to prevent exports with empty trackers or exports which contain no data at all
5
+
1
6
  === 2.3.0 / 2011-17-04
2
7
 
3
8
  * Fixed issue#1 (Last tracker in some Flame exports receives an empty shift channel)
data/Manifest.txt CHANGED
@@ -40,6 +40,7 @@ lib/middleware/flop.rb
40
40
  lib/middleware/golden.rb
41
41
  lib/middleware/length_cutoff.rb
42
42
  lib/middleware/lerp.rb
43
+ lib/middleware/lint.rb
43
44
  lib/middleware/prefix.rb
44
45
  lib/middleware/reformat.rb
45
46
  lib/middleware/scaler.rb
@@ -112,10 +113,12 @@ test/import/samples/pftrack4/sourcefile_pftrack.2dt
112
113
  test/import/samples/pftrack5/apft.2dt
113
114
  test/import/samples/pftrack5/empty_trackers.2dt
114
115
  test/import/samples/pftrack5/garage.2dt
116
+ test/import/samples/shake_script/REDACTED_shake_file.shk
115
117
  test/import/samples/shake_script/designated_global_range_starting_at_negative_frame.shk
116
118
  test/import/samples/shake_script/four_tracks_in_one_matchmove.shk
117
119
  test/import/samples/shake_script/four_tracks_in_one_stabilizer.shk
118
120
  test/import/samples/shake_script/from_matchmover.shk
121
+ test/import/samples/shake_script/ofx_vardefs.shk
119
122
  test/import/samples/shake_script/oldTrackerNode.shk
120
123
  test/import/samples/shake_script/shake_script_from_boujou.shk
121
124
  test/import/samples/shake_script/shake_tracker_nodes.shk
@@ -151,6 +154,7 @@ test/middleware/test_flop_middleware.rb
151
154
  test/middleware/test_golden_middleware.rb
152
155
  test/middleware/test_length_cutoff_middleware.rb
153
156
  test/middleware/test_lerp_middleware.rb
157
+ test/middleware/test_lint_middleware.rb
154
158
  test/middleware/test_prefix.rb
155
159
  test/middleware/test_reformat_middleware.rb
156
160
  test/middleware/test_scaler_middleware.rb
data/bin/tracksperanto CHANGED
@@ -38,7 +38,7 @@ end
38
38
 
39
39
  options = {}
40
40
  $middlewares = []
41
- writer_klass_name = nil
41
+ writer_class_name = nil
42
42
  readers = Tracksperanto.importer_names
43
43
  writers = Tracksperanto.exporter_names
44
44
 
@@ -63,7 +63,7 @@ end
63
63
  op.on(" -f", "--from TRANSLATOR", String, "Use the specific import translator") { |f| options[:importer] = f }
64
64
  op.on(" -w", "--width WIDTH_IN_PIXELS", Integer, "Absolute input comp width in pixels (will try to autodetect)") { |w| options[:width] = w }
65
65
  op.on(" -h", "--height HEIGHT_IN_PIXELS", Integer, "Absolute input comp height in pixels (will try to autodetect)") {|w| options[:height] = w }
66
- op.on(" -o", "--only EXPORTER_NAME", String, "Only export the selected format, format must be one of #{writers.join(", ")}") { |f| writer_klass_name = f }
66
+ op.on(" -o", "--only EXPORTER_NAME", String, "Only export the selected format, format must be one of #{writers.join(", ")}") { |f| writer_class_name = f }
67
67
 
68
68
  op.on(" -xs", "--xscale X_SCALING_FACTOR", Float, "Scale the result in X by this factor (1.0 is the default)", &mw("Scaler", :x_factor))
69
69
  op.on(" -ys", "--yscale Y_SCALING_FACTOR", Float, "Scale the result in Y by this factor (1.0 is the default)", &mw("Scaler", :y_factor))
@@ -107,7 +107,7 @@ end
107
107
 
108
108
  pbar = Tracksperanto::PBar.new("Converting", 100, $stderr)
109
109
  pipe = Tracksperanto::Pipeline::Base.new(:progress_block => lambda{|p,m| pbar.set_with_message(p, m) }, :middleware_tuples => $middlewares)
110
- pipe.exporters = [Tracksperanto.get_exporter(writer_klass_name)] if writer_klass_name
110
+ pipe.exporters = [Tracksperanto.get_exporter(writer_class_name)] if writer_class_name
111
111
  pipe.run(input_file, options)
112
112
  pbar.finish
113
113
 
@@ -34,7 +34,7 @@ module Tracksperanto::ShakeGrammar
34
34
  def consume_comment(c)
35
35
  if c == "\n" # Comment
36
36
  push [:comment, @buf.gsub(/(\s+?)\/\/{1}/, '')]
37
- @buf = ''
37
+ erase_buffer
38
38
  else
39
39
  @buf << c
40
40
  end
@@ -55,14 +55,23 @@ module Tracksperanto::ShakeGrammar
55
55
  return consume_comment(c) if in_comment?
56
56
 
57
57
  if !@buf.empty? && (c == "(") # Funcall
58
- push([:funcall, @buf.strip] + self.class.new(@io, @sentinel, false, @stack_depth + 1).stack)
59
- @buf = ''
58
+ push([:funcall, @buf.strip] + self.class.new(@io, @sentinel, limit_to_one_stmt = false, @stack_depth + 1).stack)
59
+ erase_buffer
60
+ elsif c == '{' # OFX curly braces or a subexpression in a node's knob
61
+ # Discard subexpr
62
+ substack = self.class.new(@io, @sentinel, limit_to_one_stmt = true, @stack_depth + 1).stack
63
+ push(:expr)
60
64
  elsif c == "[" # Array, booring
61
65
  push([:arr, self.class.new(@io).stack])
66
+ elsif c == "}"# && @limit_to_one_stmt
67
+ throw STOP_TOKEN
62
68
  elsif (c == "]" || c == ")" || c == ";" && @limit_to_one_stmt)
63
69
  # Bailing out of a subexpression
64
70
  consume_atom!
65
71
  throw STOP_TOKEN
72
+ elsif (c == "," && @limit_to_one_stmt)
73
+ consume_atom!
74
+ throw STOP_TOKEN
66
75
  elsif (c == ",")
67
76
  consume_atom!
68
77
  elsif (c == "@")
@@ -71,8 +80,10 @@ module Tracksperanto::ShakeGrammar
71
80
  elsif (c == ";" || c == "\n")
72
81
  # Skip these - the subexpression already is expanded anyway
73
82
  elsif (c == "=")
74
- push [:assign, vardef(@buf.strip), self.class.new(@io, @sentinel, to_semicolon = true, @stack_depth + 1).stack.shift]
75
- @buf = ''
83
+ vardef_atom = vardef(@buf.strip)
84
+ push [:assign, vardef_atom, self.class.new(@io, @sentinel, limit_to_one_stmt = true, @stack_depth + 1).stack.shift]
85
+
86
+ erase_buffer
76
87
  else
77
88
  @buf << c
78
89
  end
@@ -85,7 +96,8 @@ module Tracksperanto::ShakeGrammar
85
96
 
86
97
  # Grab the minimum atomic value
87
98
  def consume_atom!
88
- at, @buf = @buf.strip, ''
99
+ at = @buf.strip
100
+ erase_buffer
89
101
  return if at.empty?
90
102
 
91
103
  the_atom = case at
@@ -120,7 +132,18 @@ module Tracksperanto::ShakeGrammar
120
132
  end
121
133
 
122
134
  def vardef(var_specifier)
123
- [:vardef] + var_specifier.split
135
+ # Since we can have two-word pointers as typedefs (char *) we only use the last
136
+ # part of the thing as varname. Nodes return the :image type implicitly.
137
+ varname_re = /\w+$/
138
+ varname = var_specifier.scan(varname_re).to_s
139
+ typedef = var_specifier.gsub(varname_re, '').strip
140
+ typedef = :image if typedef.empty?
141
+
142
+ [:vardef, typedef, varname]
143
+ end
144
+
145
+ def erase_buffer
146
+ @buf = ''
124
147
  end
125
148
  end
126
149
  end
@@ -53,8 +53,28 @@ class Tracksperanto::Import::ShakeScript < Tracksperanto::Import::Base
53
53
  end
54
54
  end
55
55
 
56
+ # Find whether the passed atom includes a [:trk] on any level
57
+ def deep_include?(array_or_element, atom_name)
58
+ return true if array_or_element == atom_name
59
+ if array_or_element.is_a?(Array)
60
+ array_or_element.each do | elem |
61
+ if elem == atom_name
62
+ return true
63
+ elsif elem.is_a?(Array)
64
+ return true if deep_include?(elem, atom_name)
65
+ end
66
+ end
67
+ end
68
+
69
+ false
70
+ end
71
+
72
+ # An atom that is a tracker node will look like this
73
+ # [:assign, [:vardef, "Stabilize2"], [:retval, [:trk, <T "track1" with 116 keyframes>, <T "track2" with 116 keyframes>, <T "track3" with 116 keyframes>, <T "track4" with 89 keyframes>]]]
74
+ # a Stabilize though will look like this
75
+ # [:assign, [:vardef, "Stabilize1"], [:retval, [:trk, <T "track1" with 116 keyframes>, <T "track2" with 116 keyframes>, <T "track3" with 116 keyframes>]]]
56
76
  def atom_is_tracker_assignment?(a)
57
- (a.is_a?(Array)) && (a[0] == :assign) && (a[2][0] == :retval) && (a[2][1][0] == :trk)
77
+ deep_include?(a, :trk)
58
78
  end
59
79
 
60
80
  # For Linear() curve calls. If someone selected JSpline or Hermite it's his problem.
@@ -0,0 +1,61 @@
1
+ # Prevents you from exporting invalid trackers
2
+ class Tracksperanto::Middleware::Lint < Tracksperanto::Middleware::Base
3
+ class NoTrackersExportedError < RuntimeError
4
+ def message
5
+ "There were no trackers exported"
6
+ end
7
+ end
8
+
9
+ class EmptyTrackerSentError < RuntimeError
10
+ def initialize(name)
11
+ @name = name
12
+ end
13
+
14
+ def message
15
+ "The tracker #{@name} contained no keyframes. Probably there were some filtering ops done and no keyframes have been exported"
16
+ end
17
+ end
18
+
19
+ class TrackerRestartedError < RuntimeError
20
+ def initialize(name)
21
+ @name = name
22
+ end
23
+
24
+ def message
25
+ "The tracker #{@name} has been sent before the last tracker finished"
26
+ end
27
+ end
28
+
29
+ def start_export(w, h)
30
+ @trackers = 0
31
+ @keyframes = 0
32
+ @last_tracker_name = nil
33
+ super
34
+ end
35
+
36
+ def start_tracker_segment(name)
37
+ raise TrackerRestartedError.new(name) if @in_tracker
38
+
39
+ @in_tracker = true
40
+ @last_tracker_name = name
41
+ @keyframes = 0
42
+ super
43
+ end
44
+
45
+ def export_point(*a)
46
+ @keyframes += 1
47
+ super
48
+ end
49
+
50
+ def end_tracker_segment
51
+ raise EmptyTrackerSentError.new(@last_tracker_name) if @keyframes.zero?
52
+ @trackers +=1
53
+ @in_tracker = false
54
+ super
55
+ end
56
+
57
+ def end_export
58
+ raise NoTrackersExportedError if @trackers.zero?
59
+ super
60
+ end
61
+ end
data/lib/pipeline/base.rb CHANGED
@@ -73,23 +73,26 @@ module Tracksperanto::Pipeline
73
73
  # * parser - The parser class, for the case that it can't be autodetected from the file name
74
74
  def run(from_input_file_path, passed_options = {}) #:yields: *all_middlewares
75
75
 
76
+ # Check for empty files
77
+ raise EmptySourceFileError if File.stat(from_input_file_path).size.zero?
78
+
76
79
  # Reset stats
77
80
  @converted_keyframes, @converted_points = 0, 0
78
81
 
79
82
  # Assign the parser
80
83
  importer = initialize_importer_with_path_and_options(from_input_file_path, passed_options)
81
84
 
82
- # Check for empty files
83
- raise EmptySourceFileError if File.stat(from_input_file_path).size.zero?
84
-
85
85
  # Open the file
86
86
  read_data = File.open(from_input_file_path, "rb")
87
87
 
88
88
  # Setup a multiplexer
89
89
  mux = setup_outputs_for(from_input_file_path)
90
90
 
91
+ # Wrap it into a module that will prevent us from exporting invalid trackers
92
+ lint = Tracksperanto::Middleware::Lint.new(mux)
93
+
91
94
  # Setup middlewares
92
- endpoint = wrap_output_with_middlewares(mux)
95
+ endpoint = wrap_output_with_middlewares(lint)
93
96
  @converted_points, @converted_keyframes = run_export(read_data, importer, endpoint)
94
97
  end
95
98
 
data/lib/tracksperanto.rb CHANGED
@@ -4,7 +4,7 @@ require 'tempfile'
4
4
 
5
5
  module Tracksperanto
6
6
  PATH = File.expand_path(File.dirname(__FILE__))
7
- VERSION = '2.3.0'
7
+ VERSION = '2.3.1'
8
8
 
9
9
  module Import; end
10
10
  module Export; end
@@ -5,15 +5,17 @@ module Tracksperanto::SimpleExport
5
5
  # Before calling this, initialize the exporter with the proper
6
6
  # IO handle
7
7
  def just_export(trackers_array, comp_width, comp_height)
8
- start_export(comp_width, comp_height)
8
+ lint = Tracksperanto::Middleware::Lint.new(self)
9
+
10
+ lint.start_export(comp_width, comp_height)
9
11
  trackers_array.each do | t |
10
- start_tracker_segment(t.name)
12
+ lint.start_tracker_segment(t.name)
11
13
  t.each do | kf |
12
- export_point(kf.frame, kf.abs_x, kf.abs_y, kf.residual)
14
+ lint.export_point(kf.frame, kf.abs_x, kf.abs_y, kf.residual)
13
15
  end
14
- end_tracker_segment
16
+ lint.end_tracker_segment
15
17
  end
16
- end_export
18
+ lint.end_export
17
19
  end
18
20
  end
19
21
 
@@ -0,0 +1,317 @@
1
+ // REDACTED - (c) Apple Computer, Inc. 1998-2006. All Rights Reserved.
2
+ // Apple, the Apple logo and Shake are trademarks of Apple Computer, Inc., registered in the U.S. and other countries.
3
+
4
+
5
+ SetTimeRange("1");
6
+ SetFieldRendering(0);
7
+ SetFps(23.98);
8
+ SetMotionBlur(1, 1, 0, 0);
9
+ SetMindReader(0);
10
+ SetNewNodeFocusing(0);
11
+ SetQuality(1);
12
+ SetUseProxy("Base");
13
+ SetProxyFilter("box");
14
+ SetPixelScale(1, 1);
15
+ SetUseProxyOnMissing(1);
16
+ SetDefaultWidth(1920);
17
+ SetDefaultHeight(1080);
18
+ SetDefaultBytes(1);
19
+ SetDefaultAspect(1);
20
+ SetDefaultViewerAspect(1);
21
+ SetView(0);
22
+ SetMacroCheck(1);
23
+ SetTimecodeMode("23.98 FPS");
24
+
25
+ DefineProxyPath("../1920x1080/<base>.<format>", 1, 1, -1, "Auto", -1, 1, 0, "",1);
26
+ DefineProxyPath("../960x540/<base>.<format>", 0.5, 1, 4, "Auto", 0, 1, 1, "");
27
+ DefineProxyPath("../480x270/<base>.<format>", 0.25, 1, 4, "Auto", 0, 1, 2, "");
28
+ DefineProxyPath("../240x135/<base>.<format>", 0.125, 1, 4, "Auto", 0, 1, 3, "");
29
+ SetAudio("100W@E0000qFdsuHW962Dl9BOW0mWa06w7mCJ000000000008");
30
+ image Primatte_v2_(image ofx_Source = 0, image ofx_BG = 0, image ofx_Mask = 0, const char * Poly00dral = "0.0 0.0 0.0", const char * Poly01dral = "0.0 0.0 0.0", const char * Poly02dral = "0.0 0.0 0.0", const char * Poly03dral = "0.0 0.0 0.0", const char * Poly04dral = "0.0 0.0 0.0", const char * Poly05dral = "0.0 0.0 0.0", const char * Poly06dral = "0.0 0.0 0.0", const char * Poly07dral = "0.0 0.0 0.0", const char * Poly08dral = "0.0 0.0 0.0", const char * Poly09dral = "0.0 0.0 0.0", const char * Poly10dral = "0.0 0.0 0.0", const char * Poly11dral = "0.0 0.0 0.0", const char * Poly12dral = "0.0 0.0 0.0", const char * Poly13dral = "0.0 0.0 0.0", const char * Poly14dral = "0.0 0.0 0.0", const char * Poly15dral = "0.0 0.0 0.0", const char * Poly16dral = "0.0 0.0 0.0", const char * Poly17dral = "0.0 0.0 0.0", const char * Poly18dral = "0.0 0.0 0.0", const char * Poly19dral = "0.0 0.0 0.0", const char * Poly20dral = "0.0 0.0 0.0", const char * Poly21dral = "0.0 0.0 0.0", const char * Poly22dral = "0.0 0.0 0.0", const char * Poly23dral = "0.0 0.0 0.0", const char * Poly24dral = "0.0 0.0 0.0", const char * Poly25dral = "0.0 0.0 0.0", const char * Poly26dral = "0.0 0.0 0.0", const char * Poly27dral = "0.0 0.0 0.0", const char * Poly28dral = "0.0 0.0 0.0", const char * Poly29dral = "0.0 0.0 0.0", const char * Poly30dral = "0.0 0.0 0.0", const char * Poly31dral = "0.0 0.0 0.0", const char * Poly32dral = "0.0 0.0 0.0", const char * Poly33dral = "0.0 0.0 0.0", const char * Poly34dral = "0.0 0.0 0.0", const char * Poly35dral = "0.0 0.0 0.0", const char * Poly36dral = "0.0 0.0 0.0", const char * Poly37dral = "0.0 0.0 0.0", const char * Poly38dral = "0.0 0.0 0.0", const char * Poly39dral = "0.0 0.0 0.0", const char * Poly40dral = "0.0 0.0 0.0", const char * Poly41dral = "0.0 0.0 0.0", const char * Poly42dral = "0.0 0.0 0.0", const char * Poly43dral = "0.0 0.0 0.0", const char * Poly44dral = "0.0 0.0 0.0", const char * Poly45dral = "0.0 0.0 0.0", const char * Poly46dral = "0.0 0.0 0.0", const char * Poly47dral = "0.0 0.0 0.0", const char * Poly48dral = "0.0 0.0 0.0", const char * Poly49dral = "0.0 0.0 0.0", const char * Poly50dral = "0.0 0.0 0.0", const char * Poly51dral = "0.0 0.0 0.0", const char * Poly52dral = "0.0 0.0 0.0", const char * Poly53dral = "0.0 0.0 0.0", const char * Poly54dral = "0.0 0.0 0.0", const char * Poly55dral = "0.0 0.0 0.0", const char * Poly56dral = "0.0 0.0 0.0", const char * Poly57dral = "0.0 0.0 0.0", const char * Poly58dral = "0.0 0.0 0.0", const char * Poly59dral = "0.0 0.0 0.0", const char * Poly60dral = "0.0 0.0 0.0", const char * Poly61dral = "0.0 0.0 0.0", const char * Poly62dral = "0.0 0.0 0.0", const char * Poly63dral = "0.0 0.0 0.0", const char * Poly64dral = "0.0 0.0 0.0", const char * Poly65dral = "0.0 0.0 0.0", const char * setu66_ = "0.0 0.0 0.0", const char * setu67_ = "0.0 0.0 0.0", const char * setu68_ = "0.0 0.0 0.0", const char * setu69_ = "0.0 0.0 0.0", const char * setu70_ = "0.0 0.0 0.0", const char * setu71_ = "0.0 0.0 0.0", const char * setu72_ = "0.0 0.0 0.0", const char * setu73_ = "0.0 0.0 0.0", int AutoComputeEval = 0, int AutoComputeEvalBG = 0, int AutoComputeEvalFG = 0, const char * Operation = "Select BG Color", const char * View = "Composite", const char * Mode = "Primatte", float From_TuneR = 0.0000000000, float From_TuneG = 0.0000000000, float From_TuneB = 0.0000000000, float To_TuneR = 0.0000000000, float To_TuneG = 0.0000000000, float To_TuneB = 0.0000000000, int Tune_l = 0, int Tune_m = 0, int Tune_s = 0, const char * Spill = "Complement", float ReplaceR = 0.5000000000, float ReplaceG = 0.5000000000, float ReplaceB = 0.5000000000, float BackingR = 0.0000000000, float BackingG = 0.0000000000, float BackingB = 0.0000000000, int ExtMatte = 0, int Defocus = 0, const char * DefocusDir = "Outward", int Shrink = 0, const char * Pick_Mode = "Bounding Box", const char * Grain_Size = "None", int Grain_Tol = 0, float Crop_Left = "0.0000000000 * width", float Crop_Bottom = "0.0000000000 * height", float Crop_Right = "0.0000000000 * width", float Crop_Top = "0.0000000000 * height", int N3D_Viewer = 0)
31
+ {
32
+ fx1 = OfxPluginFactory(Primatte_v2_);return fx1;
33
+ }
34
+
35
+
36
+ // Processing nodes
37
+
38
+ Stabilize1 = Stabilize(0, 0, 0, "1 point", Linear(0,1366@1,1365.5@2,1365.02@3,1364.11@4,1363.3@5,1362.62@6,1361.88@7,1361.03@8,1360.37@9,1360@10,1359.41@11,1358.81@12,1358.34@13,1358.09@14,1357.27@15,1356.27@16,1355.21@17,1354.59@18,1354.19@19,1353.61@20,1353.1@21,1352.85@22,1352.71@23,1352.38@24,1352.07@25,1351.74@26,1351.5@27,1351.19@28,1351.01@29,1350.85@30,1350.34@31,1350.2@32,1350.14@33,1350@34,1349.7@35,1349.44@36,1349.36@37,1349.08@38,1348.63@39,1348.35@40,1348.22@41,1348.12@42,1348.11@43,1348.13@44,1347.91@45,1347.76@46,1347.73@47,1347.59@48,1347.3@49,1347.1@50,1347.05@51,1347.04@52,1346.9@53,1346.84@54,1346.72@55,1346.55@56,1346.39@57,1346.33@58,1346.06@59,1345.98@60,1346@61,1345.99@62,1345.79@63,1345.72@64,1345.8@65,1345.71@66,1345.61@67),
39
+ Linear(0,606@1,605.67@2,605.746@3,605.78@4,605.857@5,605.872@6,605.901@7,606.006@8,605.795@9,606.011@10,606.027@11,605.943@12,605.925@13,605.907@14,605.786@15,605.869@16,605.672@17,605.636@18,605.663@19,605.605@20,605.465@21,605.526@22,605.47@23,605.563@24,605.65@25,605.566@26,605.66@27,605.688@28,605.694@29,605.942@30,605.687@31,605.782@32,605.654@33,605.817@34,605.77@35,605.656@36,605.761@37,605.805@38,605.89@39,605.907@40,605.909@41,605.728@42,605.891@43,605.808@44,605.813@45,605.698@46,605.599@47,605.768@48,605.743@49,605.939@50,605.762@51,605.716@52,605.719@53,605.637@54,605.704@55,605.642@56,605.63@57,605.825@58,605.894@59,605.712@60,605.744@61,605.625@62,605.519@63,605.437@64,605.59@65,605.762@66,605.851@67),
40
+ 1, 1, Linear(0,890@1,889.413@2,888.704@3,887.597@4,886.667@5,885.852@6,885.007@7,883.963@8,883.279@9,882.873@10,882.263@11,881.57@12,880.975@13,880.664@14,879.953@15,878.899@16,877.836@17,877.309@18,876.896@19,876.353@20,875.782@21,875.601@22,875.431@23,875.077@24,874.794@25,874.588@26,874.293@27,873.926@28,873.789@29,873.587@30,873.21@31,872.998@32,872.925@33,872.715@34,872.422@35,872.265@36,872.12@37,871.746@38,871.4@39,871.022@40,870.889@41,870.802@42,870.818@43,870.759@44,870.563@45,870.414@46,870.32@47,870.177@48,869.892@49,869.646@50,869.631@51,869.589@52,869.454@53,869.383@54,869.312@55,869.179@56,869.083@57,868.87@58,868.698@59,868.618@60,868.591@61,868.576@62,868.486@63,868.419@64,868.356@65,868.303@66,868.116@67),
41
+ Linear(0,580@1,579.934@2,579.999@3,580.134@4,580.261@5,580.311@6,580.322@7,580.248@8,580.298@9,580.355@10,580.343@11,580.249@12,580.341@13,580.34@14,580.45@15,580.399@16,580.22@17,580.332@18,580.173@19,580.119@20,579.968@21,580.083@22,580.154@23,580.233@24,580.38@25,580.244@26,580.346@27,580.202@28,580.219@29,580.234@30,580.275@31,580.324@32,580.413@33,580.628@34,580.562@35,580.607@36,580.51@37,580.446@38,580.474@39,580.462@40,580.507@41,580.524@42,580.719@43,580.65@44,580.685@45,580.671@46,580.58@47,580.621@48,580.589@49,580.705@50,580.709@51,580.735@52,580.753@53,580.689@54,580.682@55,580.664@56,580.645@57,580.757@58,580.8@59,580.707@60,580.734@61,580.699@62,580.618@63,580.684@64,580.638@65,580.739@66,580.755@67),
42
+ 0, 0, 2*width/3, 2*height/3, width/3, 2*height/3, "box",
43
+ xFilter, "trsx", 0, 0.5, -(shutterTiming*script.shutterTiming)/2,
44
+ 1, 1, 0, 1, "v2.0", 36, "1/64", "luminance", 0.3, 0.59, 0.11,
45
+ 0.75, "use start frame", 0.5, "stop", 0, 0, 25, "track1",
46
+ 1349.44-height/25, 1349.44+height/25, 605.656-height/25,
47
+ 605.656+height/25, 1349.44-height/15, 1349.44+height/15,
48
+ 605.656-height/15, 605.656+height/15, "track2", 872.265-height/25,
49
+ 872.265+height/25, 580.607-height/25, 580.607+height/25,
50
+ 872.265-height/15, 872.265+height/15, 580.607-height/15,
51
+ 580.607+height/15, "track3", 2*width/3-height/30, 2*width/3+height/30,
52
+ 2*height/3-height/30, 2*height/3+height/30, 2*width/3-height/15,
53
+ 2*width/3+height/15, 2*height/3-height/15, 2*height/3+height/15,
54
+ "track4", width/3-height/30, width/3+height/30, 2*height/3-height/30,
55
+ 2*height/3+height/30, width/3-height/15, width/3+height/15,
56
+ 2*height/3-height/15, 2*height/3+height/15);
57
+
58
+
59
+ // User Interface settings
60
+
61
+ SetKey(
62
+ "colorPicker.hex", "0",
63
+ "colorPicker.range", "32",
64
+ "globals.bufferSelectToggling", "0",
65
+ "globals.cacheMode", "2",
66
+ "globals.consoleLineLength", "120",
67
+ "globals.displayThumbnails", "1",
68
+ "globals.enhancedNodeView", "0",
69
+ "globals.fileBrowserExactList", "0",
70
+ "globals.fileBrowserFilterList", "1",
71
+ "globals.fileBrowserFullList", "1",
72
+ "globals.fileBrowserHeight", "540",
73
+ "globals.fileBrowserImageList", "0",
74
+ "globals.fileBrowserLC1", "482",
75
+ "globals.fileBrowserLC2", "70",
76
+ "globals.fileBrowserLC3", "110",
77
+ "globals.fileBrowserLC4", "245",
78
+ "globals.fileBrowserLC5", "175",
79
+ "globals.fileBrowserLC6", "65",
80
+ "globals.fileBrowserLC7", "111",
81
+ "globals.fileBrowserRIntSet", "0",
82
+ "globals.fileBrowserSC1", "211",
83
+ "globals.fileBrowserSC2", "211",
84
+ "globals.fileBrowserSC3", "211",
85
+ "globals.fileBrowserSeqList", "0",
86
+ "globals.fileBrowserShortList", "0",
87
+ "globals.fileBrowserWIntSet", "1",
88
+ "globals.fileBrowserWidth", "1035",
89
+ "globals.fileBrowserfullPath", "0",
90
+ "globals.fontBlue", "1",
91
+ "globals.fontGreen", "1",
92
+ "globals.fontRed", "1",
93
+ "globals.gridBlue", "0.15",
94
+ "globals.gridEnabled", "0",
95
+ "globals.gridGreen", "0.15",
96
+ "globals.gridHeight", "40",
97
+ "globals.gridRed", "0.15",
98
+ "globals.gridVisible", "0",
99
+ "globals.gridWidth", "40",
100
+ "globals.layoutTightness", "40",
101
+ "globals.multiPlaneLocatorScale", "1",
102
+ "globals.noodleABlue", "1",
103
+ "globals.noodleAGreen", "1",
104
+ "globals.noodleARed", "1",
105
+ "globals.noodleAZBlue", "0.4",
106
+ "globals.noodleAZGreen", "0",
107
+ "globals.noodleAZRed", "0",
108
+ "globals.noodleBWABlue", "0.4",
109
+ "globals.noodleBWAGreen", "0.4",
110
+ "globals.noodleBWARed", "0.4",
111
+ "globals.noodleBWAZBlue", "0.4",
112
+ "globals.noodleBWAZGreen", "0",
113
+ "globals.noodleBWAZRed", "0",
114
+ "globals.noodleBWBlue", "0.15",
115
+ "globals.noodleBWGreen", "0.15",
116
+ "globals.noodleBWRed", "0.15",
117
+ "globals.noodleBWZBlue", "0.4",
118
+ "globals.noodleBWZGreen", "0",
119
+ "globals.noodleBWZRed", "0",
120
+ "globals.noodleBlue", "1",
121
+ "globals.noodleColorCoding", "2",
122
+ "globals.noodleGreen", "1",
123
+ "globals.noodleRGBABlue", "0.7",
124
+ "globals.noodleRGBAGreen", "0.7",
125
+ "globals.noodleRGBARed", "0.7",
126
+ "globals.noodleRGBAZBlue", "1",
127
+ "globals.noodleRGBAZGreen", "0.4",
128
+ "globals.noodleRGBAZRed", "0.4",
129
+ "globals.noodleRGBBlue", "0",
130
+ "globals.noodleRGBGreen", "0.7",
131
+ "globals.noodleRGBRed", "0.7",
132
+ "globals.noodleRGBZBlue", "0.8",
133
+ "globals.noodleRGBZGreen", "0.2",
134
+ "globals.noodleRGBZRed", "0.2",
135
+ "globals.noodleRed", "1",
136
+ "globals.noodleStipple16", "1061109567",
137
+ "globals.noodleStipple32", "-1",
138
+ "globals.noodleStipple8", "-1431655766",
139
+ "globals.noodleTension", "0.25",
140
+ "globals.noodleZBlue", "0.4",
141
+ "globals.noodleZGreen", "0",
142
+ "globals.noodleZRed", "0",
143
+ "globals.paintFrameMode", "1",
144
+ "globals.pdfBrowserPath", "",
145
+ "globals.proxyTog.cycle", "-1,0,0,0,0,-1",
146
+ "globals.renderModeTog.cycle", "2,0,0,2",
147
+ "globals.rotoAutoControlScale", "1",
148
+ "globals.rotoBuildColorBlue", "0.75",
149
+ "globals.rotoBuildColorGreen", "0.75",
150
+ "globals.rotoBuildColorRed", "0.375",
151
+ "globals.rotoControlScale", "1",
152
+ "globals.rotoFocusColorBlue", "0.9375",
153
+ "globals.rotoFocusColorGreen", "0.375",
154
+ "globals.rotoFocusColorRed", "0.5",
155
+ "globals.rotoFocusSelectColorBlue", "0.5",
156
+ "globals.rotoFocusSelectColorGreen", "1",
157
+ "globals.rotoFocusSelectColorRed", "0.5",
158
+ "globals.rotoKeyedColorBlue", "1",
159
+ "globals.rotoKeyedColorGreen", "0.65",
160
+ "globals.rotoKeyedColorRed", "0.45",
161
+ "globals.rotoNormalColorBlue", "0.125",
162
+ "globals.rotoNormalColorGreen", "0.75",
163
+ "globals.rotoNormalColorRed", "0.75",
164
+ "globals.rotoNormalSelectColorBlue", "0.0625",
165
+ "globals.rotoNormalSelectColorGreen", "1",
166
+ "globals.rotoNormalSelectColorRed", "0.0625",
167
+ "globals.rotoPickRadius", "15",
168
+ "globals.rotoTangentColorBlue", "0.125",
169
+ "globals.rotoTangentColorGreen", "0.5625",
170
+ "globals.rotoTangentColorRed", "0.5625",
171
+ "globals.rotoTangentCreationRadius", "10",
172
+ "globals.rotoTempKeyColorBlue", "0",
173
+ "globals.rotoTempKeyColorGreen", "0.5",
174
+ "globals.rotoTempKeyColorRed", "1",
175
+ "globals.rotoTransformIncrement", "5",
176
+ "globals.showActiveGlows", "2",
177
+ "globals.showConcatenationLinks", "2",
178
+ "globals.showExpressionLinks", "2",
179
+ "globals.showTimeDependency", "2",
180
+ "globals.textureProxy", "1",
181
+ "globals.thumbAlphaBlend", "1",
182
+ "globals.thumbSize", "15",
183
+ "globals.thumbSizeRelative", "0",
184
+ "globals.viewerAspectRatio", "script.defaultViewerAspectRatio",
185
+ "globals.viewerZoom", "1.0/proxyScale/proxyRatio",
186
+ "globals.virtualSliderMode", "0",
187
+ "globals.virtualSliderSpeed", "0.25",
188
+ "globals.warpBoundaryNormalColorBlue", "0",
189
+ "globals.warpBoundaryNormalColorGreen", "0.5",
190
+ "globals.warpBoundaryNormalColorRed", "1",
191
+ "globals.warpConnectionNormalColorBlue", "0.8",
192
+ "globals.warpConnectionNormalColorGreen", "0",
193
+ "globals.warpConnectionNormalColorRed", "0.4",
194
+ "globals.warpDisplacedNormalColorBlue", "1",
195
+ "globals.warpDisplacedNormalColorGreen", "0",
196
+ "globals.warpDisplacedNormalColorRed", "1",
197
+ "globals.warpLockedColorBlue", "0.6",
198
+ "globals.warpLockedColorGreen", "0.6",
199
+ "globals.warpLockedColorRed", "0.6",
200
+ "globals.warpSourceNormalColorBlue", "1",
201
+ "globals.warpSourceNormalColorGreen", "0.8",
202
+ "globals.warpSourceNormalColorRed", "0",
203
+ "globals.warpTargetNormalColorBlue", "0.7",
204
+ "globals.warpTargetNormalColorGreen", "0.2",
205
+ "globals.warpTargetNormalColorRed", "0.2",
206
+ "globals.webBrowserPath", "",
207
+ "mainQuad.bot", "0.6",
208
+ "mainQuad.left", "0.29",
209
+ "mainQuad.right", "0.39795202",
210
+ "mainQuad.top", "0.6",
211
+ "mainWin.height", "1080",
212
+ "mainWin.tabChild1", "0.Image",
213
+ "mainWin.tabChild10", "0.ThreeD",
214
+ "mainWin.tabChild11", "0.Flares",
215
+ "mainWin.tabChild12", "0.Reorders",
216
+ "mainWin.tabChild13", "0.Curve_Editor_2",
217
+ "mainWin.tabChild14", "0.Node_View_2",
218
+ "mainWin.tabChild15", "0.Time_View",
219
+ "mainWin.tabChild16", "1.Parameters1",
220
+ "mainWin.tabChild17", "1.Parameters2",
221
+ "mainWin.tabChild18", "1.Globals",
222
+ "mainWin.tabChild19", "2.Viewers",
223
+ "mainWin.tabChild2", "0.Color",
224
+ "mainWin.tabChild20", "3.Node_View",
225
+ "mainWin.tabChild21", "3.Curve_Editor",
226
+ "mainWin.tabChild22", "3.Color_Picker",
227
+ "mainWin.tabChild23", "3.Console",
228
+ "mainWin.tabChild24", "3.Audio_Panel",
229
+ "mainWin.tabChild25", "3.Pixel_Analyzer",
230
+ "mainWin.tabChild3", "0.Filter",
231
+ "mainWin.tabChild4", "0.Key",
232
+ "mainWin.tabChild5", "0.Layer",
233
+ "mainWin.tabChild6", "0.Transform",
234
+ "mainWin.tabChild7", "0.Warp",
235
+ "mainWin.tabChild8", "0.Other",
236
+ "mainWin.tabChild9", "0.Tinder",
237
+ "mainWin.width", "1912",
238
+ "mainWin.xPos", "4",
239
+ "mainWin.yPos", "99",
240
+ "nodeView.Stabilize1.t", "0",
241
+ "nodeView.Stabilize1.x", "526.2155",
242
+ "nodeView.Stabilize1.y", "458.8213",
243
+ "nodeView.xPan", "-367.4545",
244
+ "nodeView.yPan", "-267.3041",
245
+ "nodeView.zoom", "0.857309759",
246
+ "pixelAnalyzer1.aStatToggleState", "0",
247
+ "pixelAnalyzer1.accumulate", "0",
248
+ "pixelAnalyzer1.bStatToggleState", "0",
249
+ "pixelAnalyzer1.bit16ToggleState", "0",
250
+ "pixelAnalyzer1.bit32ToggleState", "1",
251
+ "pixelAnalyzer1.bit8ToggleState", "0",
252
+ "pixelAnalyzer1.gStatToggleState", "0",
253
+ "pixelAnalyzer1.hStatToggleState", "0",
254
+ "pixelAnalyzer1.hex", "0",
255
+ "pixelAnalyzer1.imgToggleState", "0",
256
+ "pixelAnalyzer1.lStatToggleState", "1",
257
+ "pixelAnalyzer1.offToggleState", "0",
258
+ "pixelAnalyzer1.pxlToggleState", "1",
259
+ "pixelAnalyzer1.rStatToggleState", "0",
260
+ "pixelAnalyzer1.sStatToggleState", "0",
261
+ "pixelAnalyzer1.vStatToggleState", "0",
262
+ "spawnedViewerCount", "0",
263
+ "timeBar.current", "36",
264
+ "timeBar.high", "67",
265
+ "timeBar.incr", "1",
266
+ "timeBar.low", "1",
267
+ "timeView.ctrls.selGroup", "0",
268
+ "timeView.wSpace.constDisp", "0",
269
+ "timeView.wSpace.dispInOut", "1",
270
+ "timeView.wSpace.endTime", "100",
271
+ "timeView.wSpace.startTime", "1",
272
+ "timeView.wSpace.trim", "0",
273
+ "updater.mode", "2",
274
+ "vDesk.0.activeBuffer", "0",
275
+ "vDesk.0.compareMode", "0",
276
+ "vDesk.0.compareTog.cycle", "-1,0,0,0,-1",
277
+ "vDesk.0.dodNodeSerial", "Bungle(Select1, 0, 1920, 0, 1080, 0, 0, 0);",
278
+ "vDesk.0.dodToggle", "0",
279
+ "vDesk.0.exp", "0",
280
+ "vDesk.0.g", "1",
281
+ "vDesk.0.gamma", "1",
282
+ "vDesk.0.gradeToggle", "0",
283
+ "vDesk.0.h", "705",
284
+ "vDesk.0.i", "0",
285
+ "vDesk.0.ih", "0",
286
+ "vDesk.0.isActive", "1",
287
+ "vDesk.0.iw", "0",
288
+ "vDesk.0.lookupTog.cycle", "1,0,0",
289
+ "vDesk.0.lookupToggle", "0",
290
+ "vDesk.0.numViewerLookups", "0",
291
+ "vDesk.0.numViewerScripts", "8",
292
+ "vDesk.0.oscAutoKeyOnOff", "0",
293
+ "vDesk.0.oscLockTog.cycle", "1,0,0,0",
294
+ "vDesk.0.oscOnOff", "1",
295
+ "vDesk.0.oscTog.cycle", "1,0,0,1",
296
+ "vDesk.0.primaryVNode", "0",
297
+ "vDesk.0.roiOnOff", "1",
298
+ "vDesk.0.scriptNodeSerial0", "ApertureMarking(riNode, \"Auto\", 0, 0, 1, 1, 1.0, 1.0, 1.0, 1.0, 3, 1, 0.2, academyDefaultRed, academyDefaultGreen, academyDefaultBlue, academyDefaultAlpha, academyDefaultLineWidth, 1, 0.4, academyDefaultRed, academyDefaultGreen, academyDefaultBlue, academyDefaultAlpha, academyDefaultLineWidth, 1, 0.6, academyDefaultRed, academyDefaultGreen, academyDefaultBlue, academyDefaultAlpha, academyDefaultLineWidth, 0, 0.8, academyDefaultRed, academyDefaultGreen, academyDefaultBlue, academyDefaultAlpha, academyDefaultLineWidth, 0, 0.5, academyDefaultRed, academyDefaultGreen, academyDefaultBlue, academyDefaultAlpha, academyDefaultLineWidth, 0, 0.25, academyDefaultRed, academyDefaultGreen, academyDefaultBlue, academyDefaultAlpha, academyDefaultLineWidth, 1.0, 1.0, 1.0, 1.0, 3, 0, 0.2, fullDefaultRed, fullDefaultGreen, fullDefaultBlue, fullDefaultAlpha, fullDefaultLineWidth, 1, 0.4, fullDefaultRed, fullDefaultGreen, fullDefaultBlue, fullDefaultAlpha, fullDefaultLineWidth, 1, 0.6, fullDefaultRed, fullDefaultGreen, fullDefaultBlue, fullDefaultAlpha, fullDefaultLineWidth, 1.0, 1.0, 1.0, 1.0, 1, 1, 20, 0.25, tvDefaultRed, tvDefaultGreen, tvDefaultBlue, tvDefaultAlpha, tvDefaultLineWidth, 1, 10, 0.5, tvDefaultRed, tvDefaultGreen, tvDefaultBlue, tvDefaultAlpha, tvDefaultLineWidth);",
299
+ "vDesk.0.scriptNodeSerial1", "ViewerScript_2_(riNode, 1, 1, 1, Input.width/2, Input.height/2);",
300
+ "vDesk.0.scriptNodeSerial2", "ViewerScript_3_(riNode, 3, 0, .5);",
301
+ "vDesk.0.scriptNodeSerial3", "ViewZ(riNode, 0, 0, 0, 5000000, 1, 100);",
302
+ "vDesk.0.scriptNodeSerial4", "FloatView_(riNode, 2, 0, 0, 1, 1-red1, 1-green1, 1-blue1);",
303
+ "vDesk.0.scriptNodeSerial5", "TimeCode_(riNode, \"Timecode\", 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, .5, 20, 20);",
304
+ "vDesk.0.scriptNodeSerial6", "ApertureMask(riNode, 4, 1, 1, 100, 100);",
305
+ "vDesk.0.scriptTog.cycle", "-1,0,0,0,0,0,0,0,0,-1",
306
+ "vDesk.0.scriptToggle", "0",
307
+ "vDesk.0.secondaryVNode", "1",
308
+ "vDesk.0.viewerGrade.cycle", "-2,-2,0",
309
+ "vDesk.0.w", "1141",
310
+ "vDesk.0.x", "0",
311
+ "vDesk.0.xPan", "5",
312
+ "vDesk.0.xliderValue", "0",
313
+ "vDesk.0.y", "0",
314
+ "vDesk.0.yPan", "-27",
315
+ "vDesk.0.zoom", "0.5845361",
316
+ "vDesk.viewers", "1"
317
+ );
@@ -0,0 +1,6 @@
1
+ image Primatte_v2_(image ofx_Source = 0, image ofx_BG = 0, image ofx_Mask = 0, const char * Poly00dral = "0.0 0.0 0.0", int N3D_Viewer = 0)
2
+ {
3
+ fx1 = OfxPluginFactory(Primatte_v2_);return fx1;
4
+ }
5
+
6
+ Foo(2);
@@ -2,6 +2,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../helper'
2
2
 
3
3
  class ShakeLexerTest < Test::Unit::TestCase
4
4
  P = File.dirname(__FILE__) + "/samples/shake_script/shake_tracker_nodes.shk"
5
+ OFX_CURLY_BRACES = File.dirname(__FILE__) + "/samples/shake_script/ofx_vardefs.shk"
5
6
  L = Tracksperanto::ShakeGrammar::Lexer
6
7
  WRONG = File.dirname(__FILE__) + "/samples/flame_stabilizer/hugeFlameSetup.stabilizer"
7
8
 
@@ -84,7 +85,38 @@ class ShakeLexerTest < Test::Unit::TestCase
84
85
  ]],
85
86
  s)
86
87
  end
87
-
88
+
89
+ def test_knob_expr
90
+ s = parse "Foobar(2, 4, {{ 4 * 16 }}, 4, 1)"
91
+ assert_equal(
92
+ [[
93
+ :funcall,
94
+ "Foobar",
95
+ 2,
96
+ 4,
97
+ :expr,
98
+ 4,
99
+ 1,
100
+ ]],
101
+ s)
102
+ end
103
+
104
+ def test_lexer_with_ofx_curly_braces
105
+ s = parse(File.read(OFX_CURLY_BRACES))
106
+ assert_equal(
107
+ [[
108
+ :funcall,
109
+ "image Primatte_v2_",
110
+ [:assign, [:vardef, "image", "ofx_Source"], 0],
111
+ [:assign, [:vardef, "image", "ofx_BG"], 0],
112
+ [:assign, [:vardef, "image", "ofx_Mask"], 0],
113
+ [:assign, [:vardef, "const char *", "Poly00dral"], "0.0 0.0 0.0"],
114
+ [:assign, [:vardef, "int", "N3D_Viewer"], 0],
115
+ :expr
116
+ ], [:funcall, "Foo", 2]],
117
+ s)
118
+ end
119
+
88
120
  def test_parse_funcall_with_valueats_at_negframes
89
121
  s = parse 'Linear(0,716.08@-1,715.846@2)'
90
122
  assert_equal(
@@ -121,12 +153,17 @@ class ShakeLexerTest < Test::Unit::TestCase
121
153
 
122
154
  def test_parse_varassign
123
155
  s = parse 'Foo = Blur(Foo, 1, 2, 3); 1'
124
- assert_equal [[:assign, [:vardef, "Foo"], [:funcall, "Blur", [:atom, "Foo"], 1, 2, 3]], 1], s
156
+ assert_equal [[:assign, [:vardef, :image, "Foo"], [:funcall, "Blur", [:atom, "Foo"], 1, 2, 3]], 1], s
125
157
  end
126
158
 
127
159
  def test_parse_varassign_with_typedef
128
160
  s = parse 'curve float focal = Linear(0,2257.552@1,2257.552@2)'
129
- assert_equal [[:assign, [:vardef, "curve", "float", "focal"], [:funcall, "Linear", 0, [:value_at, 1, 2257.552], [:value_at, 2, 2257.552]]]], s
161
+ assert_equal [[:assign, [:vardef, "curve float", "focal"], [:funcall, "Linear", 0, [:value_at, 1, 2257.552], [:value_at, 2, 2257.552]]]], s
162
+ end
163
+
164
+ def test_parse_varassign_with_typedef_charstar
165
+ s = parse 'char * information = "Ausgezeichnet!";'
166
+ assert_equal [[:assign, [:vardef, "char *", "information"], "Ausgezeichnet!" ]], s
130
167
  end
131
168
 
132
169
  def test_parse_whole_file_does_not_raise
@@ -116,6 +116,14 @@ class ShakeScriptImportTest < Test::Unit::TestCase
116
116
  trackers = Tracksperanto::Import::ShakeScript.new(:io => fixture, :width => 1920, :height => 1080).to_a
117
117
  assert_equal 8, trackers.length
118
118
  end
119
+
120
+ def test_REDACTED_shake_file
121
+ fixture = File.open(File.dirname(__FILE__) + "/samples/shake_script/REDACTED_shake_file.shk")
122
+ trackers = Tracksperanto::Import::ShakeScript.new(:io => fixture, :width => 1920, :height => 1080).to_a
123
+ assert_equal 2, trackers.length
124
+ assert_equal "Stabilize1_track1", trackers[0].name
125
+ assert_equal "Stabilize1_track2", trackers[1].name
126
+ end
119
127
 
120
128
  def test_tracker_node_from_stoneage_shake_version
121
129
  fixture = File.open(File.dirname(__FILE__) + "/samples/shake_script/oldTrackerNode.shk")
@@ -0,0 +1,45 @@
1
+ require File.expand_path(File.dirname(__FILE__)) + '/../helper'
2
+
3
+ class LintMiddlewareTest < Test::Unit::TestCase
4
+ def test_empty_export_raises
5
+ m = flexmock
6
+ m.should_receive(:start_export).once
7
+
8
+ ex = Tracksperanto::Middleware::Lint.new(m)
9
+ ex.start_export(100, 100)
10
+ assert_raise(Tracksperanto::Middleware::Lint::NoTrackersExportedError) do
11
+ ex.end_export
12
+ end
13
+
14
+ end
15
+
16
+ def test_exporting_empty_tracker_raises
17
+ m = flexmock
18
+ m.should_receive(:start_export).once
19
+ m.should_receive(:start_tracker_segment).once
20
+
21
+ ex = Tracksperanto::Middleware::Lint.new(m)
22
+ ex.start_export(100, 100)
23
+ ex.start_tracker_segment("Foo")
24
+
25
+ assert_raise(Tracksperanto::Middleware::Lint::EmptyTrackerSentError) do
26
+ ex.end_tracker_segment
27
+ end
28
+ end
29
+
30
+
31
+ def test_exporting_with_two_starts_raises
32
+ m = flexmock
33
+ m.should_receive(:start_export).once
34
+ m.should_receive(:start_tracker_segment).once
35
+
36
+ ex = Tracksperanto::Middleware::Lint.new(m)
37
+ ex.start_export(100, 100)
38
+ ex.start_tracker_segment("Foo")
39
+
40
+ assert_raise(Tracksperanto::Middleware::Lint::TrackerRestartedError) do
41
+ ex.start_tracker_segment("Bar")
42
+ end
43
+ end
44
+
45
+ end
@@ -59,12 +59,15 @@ class PipelineTest < Test::Unit::TestCase
59
59
  ]
60
60
 
61
61
  mock_mux = flexmock("MUX")
62
+ mock_lint = flexmock("LINT")
62
63
  flexmock(Tracksperanto::Export::Mux).should_receive(:new).and_return(mock_mux)
64
+ flexmock(Tracksperanto::Middleware::Lint).should_receive(:new).with(mock_mux).and_return(mock_lint)
65
+
63
66
  m = flexmock("middleware object")
64
67
  mock_middleware_class = flexmock("middleware class")
65
68
 
66
69
  flexmock(Tracksperanto).should_receive(:get_middleware).with("Bla").once.and_return(mock_middleware_class)
67
- mock_middleware_class.should_receive(:new).with(mock_mux, {:foo => 234}).once
70
+ mock_middleware_class.should_receive(:new).with(mock_lint, {:foo => 234}).once
68
71
 
69
72
  assert_raise(NoMethodError) { pipeline.run(@stabilizer) }
70
73
  end
@@ -95,7 +98,8 @@ class PipelineTest < Test::Unit::TestCase
95
98
  end
96
99
 
97
100
  def test_run_with_unknown_format_raises
98
- FileUtils.touch("./input.txt")
101
+ File.open("./input.txt", "w"){|f| f.write("foo") }
102
+
99
103
  pipeline = Tracksperanto::Pipeline::Base.new
100
104
  assert_raise(Tracksperanto::Pipeline::UnknownFormatError) { pipeline.run("./input.txt") }
101
105
  assert_raise(Tracksperanto::Pipeline::UnknownFormatError) { pipeline.run("./input.txt", :width => 100, :height => 100) }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tracksperanto
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 3
9
- - 0
10
- version: 2.3.0
9
+ - 1
10
+ version: 2.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Julik Tarkhanov
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-17 00:00:00 +02:00
18
+ date: 2011-05-08 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -118,6 +118,7 @@ files:
118
118
  - lib/middleware/golden.rb
119
119
  - lib/middleware/length_cutoff.rb
120
120
  - lib/middleware/lerp.rb
121
+ - lib/middleware/lint.rb
121
122
  - lib/middleware/prefix.rb
122
123
  - lib/middleware/reformat.rb
123
124
  - lib/middleware/scaler.rb
@@ -190,10 +191,12 @@ files:
190
191
  - test/import/samples/pftrack5/apft.2dt
191
192
  - test/import/samples/pftrack5/empty_trackers.2dt
192
193
  - test/import/samples/pftrack5/garage.2dt
194
+ - test/import/samples/shake_script/REDACTED_shake_file.shk
193
195
  - test/import/samples/shake_script/designated_global_range_starting_at_negative_frame.shk
194
196
  - test/import/samples/shake_script/four_tracks_in_one_matchmove.shk
195
197
  - test/import/samples/shake_script/four_tracks_in_one_stabilizer.shk
196
198
  - test/import/samples/shake_script/from_matchmover.shk
199
+ - test/import/samples/shake_script/ofx_vardefs.shk
197
200
  - test/import/samples/shake_script/oldTrackerNode.shk
198
201
  - test/import/samples/shake_script/shake_script_from_boujou.shk
199
202
  - test/import/samples/shake_script/shake_tracker_nodes.shk
@@ -229,6 +232,7 @@ files:
229
232
  - test/middleware/test_golden_middleware.rb
230
233
  - test/middleware/test_length_cutoff_middleware.rb
231
234
  - test/middleware/test_lerp_middleware.rb
235
+ - test/middleware/test_lint_middleware.rb
232
236
  - test/middleware/test_prefix.rb
233
237
  - test/middleware/test_reformat_middleware.rb
234
238
  - test/middleware/test_scaler_middleware.rb
@@ -315,6 +319,7 @@ test_files:
315
319
  - test/middleware/test_golden_middleware.rb
316
320
  - test/middleware/test_length_cutoff_middleware.rb
317
321
  - test/middleware/test_lerp_middleware.rb
322
+ - test/middleware/test_lint_middleware.rb
318
323
  - test/middleware/test_prefix.rb
319
324
  - test/middleware/test_reformat_middleware.rb
320
325
  - test/middleware/test_scaler_middleware.rb