tracksperanto 1.5.1 → 1.5.2
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 +5 -0
- data/lib/export/base.rb +6 -4
- data/lib/export/equalizer3.rb +0 -1
- data/lib/export/equalizer4.rb +2 -3
- data/lib/export/nuke_script.rb +0 -1
- data/lib/export/pftrack_5.rb +1 -1
- data/lib/export/shake_text.rb +0 -1
- data/lib/export/syntheyes.rb +0 -1
- data/lib/import/base.rb +6 -4
- data/lib/import/equalizer3.rb +6 -1
- data/lib/import/equalizer4.rb +3 -0
- data/lib/tracksperanto.rb +1 -1
- data/tracksperanto.gemspec +1 -1
- metadata +2 -2
data/History.txt
CHANGED
data/lib/export/base.rb
CHANGED
@@ -13,18 +13,20 @@ class Tracksperanto::Export::Base
|
|
13
13
|
super
|
14
14
|
end
|
15
15
|
|
16
|
-
# Should return the suffix and extension of this export file (like "flame.stabilizer")
|
17
|
-
# method because it gets requested before the exporter is instantiated
|
16
|
+
# Should return the suffix and extension of this export file (like "flame.stabilizer"), without
|
17
|
+
# the leading underscore. It's a class method because it gets requested before the exporter is instantiated
|
18
18
|
def self.desc_and_extension
|
19
19
|
"data.txt"
|
20
20
|
end
|
21
21
|
|
22
|
-
# Should return the human-readable (read: with spaces) name of the export module
|
22
|
+
# Should return the human-readable (read: properly capitalized and with spaces) name of the export module
|
23
23
|
def self.human_name
|
24
24
|
"Abstract export format"
|
25
25
|
end
|
26
26
|
|
27
27
|
# The constructor for an exporter should accept a handle to the IO object that you can write to.
|
28
|
+
# This gets assigned to @io ivar by default, but you can do whatever ypu wish
|
29
|
+
# By convention, the caller will close the IO when you are done so don't do it here
|
28
30
|
def initialize(write_to_io)
|
29
31
|
@io = write_to_io
|
30
32
|
end
|
@@ -33,7 +35,7 @@ class Tracksperanto::Export::Base
|
|
33
35
|
def start_export( img_width, img_height)
|
34
36
|
end
|
35
37
|
|
36
|
-
# Called on export end.
|
38
|
+
# Called on export end. By convention, the caller will close the IO when you are done so don't do it here
|
37
39
|
def end_export
|
38
40
|
end
|
39
41
|
|
data/lib/export/equalizer3.rb
CHANGED
@@ -3,7 +3,6 @@ class Tracksperanto::Export::Equalizer3 < Tracksperanto::Export::Base
|
|
3
3
|
|
4
4
|
HEADER = '// 3DE Multiple Tracking Curves Export 2048 x 778 * 275 frames'
|
5
5
|
|
6
|
-
# Should return the suffix and extension of this export file (like "_flame.stabilizer")
|
7
6
|
def self.desc_and_extension
|
8
7
|
"3de_v3.txt"
|
9
8
|
end
|
data/lib/export/equalizer4.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# Export for 3DE v4 point files
|
2
2
|
class Tracksperanto::Export::Equalizer4 < Tracksperanto::Export::Base
|
3
3
|
|
4
|
-
# Should return the suffix and extension of this export file (like "_flame.stabilizer")
|
5
4
|
def self.desc_and_extension
|
6
5
|
"3de_v4.txt"
|
7
6
|
end
|
@@ -13,13 +12,13 @@ class Tracksperanto::Export::Equalizer4 < Tracksperanto::Export::Base
|
|
13
12
|
def start_export( img_width, img_height)
|
14
13
|
# 3DE needs to know the number of points in advance,
|
15
14
|
# so we will just buffer to a StringIO
|
16
|
-
@internal_io, @num_of_trackers = Tempfile.new(
|
15
|
+
@internal_io, @num_of_trackers = Tempfile.new("teq4x"), 0
|
17
16
|
end
|
18
17
|
|
19
18
|
def start_tracker_segment(tracker_name)
|
20
19
|
@internal_io.puts(tracker_name)
|
21
20
|
@num_of_trackers += 1
|
22
|
-
@tracker_buffer, @num_of_kfs = Tempfile.new(
|
21
|
+
@tracker_buffer, @num_of_kfs = Tempfile.new("teq4x_p"), 0
|
23
22
|
end
|
24
23
|
|
25
24
|
def export_point(frame, abs_float_x, abs_float_y, float_residual)
|
data/lib/export/nuke_script.rb
CHANGED
data/lib/export/pftrack_5.rb
CHANGED
@@ -12,7 +12,7 @@ class Tracksperanto::Export::PFTrack5 < Tracksperanto::Export::PFTrack4
|
|
12
12
|
def end_tracker_segment
|
13
13
|
block = [ "\n",
|
14
14
|
@tracker_name.inspect, # "autoquotes"
|
15
|
-
"Primary".inspect,
|
15
|
+
"Primary".inspect, # For primary/secondary cam in stereo pair
|
16
16
|
@prev_tracker.length,
|
17
17
|
@prev_tracker.join("\n") ]
|
18
18
|
@io.puts block.join("\n")
|
data/lib/export/shake_text.rb
CHANGED
@@ -3,7 +3,6 @@ class Tracksperanto::Export::ShakeText < Tracksperanto::Export::Base
|
|
3
3
|
PREAMBLE = "TrackName %s\n Frame X Y Correlation\n"
|
4
4
|
POSTAMBLE = "\n"
|
5
5
|
|
6
|
-
# Should return the suffix and extension of this export file (like "_flame.stabilizer")
|
7
6
|
def self.desc_and_extension
|
8
7
|
"shake_trackers.txt"
|
9
8
|
end
|
data/lib/export/syntheyes.rb
CHANGED
data/lib/import/base.rb
CHANGED
@@ -38,7 +38,7 @@ class Tracksperanto::Import::Base
|
|
38
38
|
end
|
39
39
|
|
40
40
|
# Return an extension WITH DOT if this format has a typical extension that
|
41
|
-
# you can detect
|
41
|
+
# you can detect (like ".nk" for Nuke)
|
42
42
|
def self.distinct_file_ext
|
43
43
|
nil
|
44
44
|
end
|
@@ -54,15 +54,17 @@ class Tracksperanto::Import::Base
|
|
54
54
|
false
|
55
55
|
end
|
56
56
|
|
57
|
-
# Call this method to tell what you are doing.
|
58
|
-
# gets ignored if the caller did not request any progress reports
|
57
|
+
# Call this method from the inside of your importer to tell what you are doing.
|
58
|
+
# This gets propagated to the caller automatically, or gets ignored if the caller did not request any progress reports
|
59
59
|
def report_progress(message)
|
60
60
|
@progress_block.call(message) if @progress_block
|
61
61
|
end
|
62
62
|
|
63
63
|
# The main method of the parser. Will receive an IO handle to the file being imported, and should
|
64
64
|
# return an array of Tracksperanto::Tracker objects containing keyframes. If you have a problem
|
65
|
-
# doing an import, raise from here.
|
65
|
+
# doing an import, raise from here. Note that in general it's a good idea to stream-parse a document
|
66
|
+
# instead of bulk-reading it into memory (since Tracksperanto tries to be mem-efficient when dealing
|
67
|
+
# with large files)
|
66
68
|
def parse(track_file_io)
|
67
69
|
[]
|
68
70
|
end
|
data/lib/import/equalizer3.rb
CHANGED
@@ -29,6 +29,7 @@ class Tracksperanto::Import::Equalizer3 < Tracksperanto::Import::Base
|
|
29
29
|
if line =~ /^(\w+)/ # Tracker name
|
30
30
|
discard_last_empty_tracker!(ts)
|
31
31
|
ts.push(Tracksperanto::Tracker.new(:name => line.strip))
|
32
|
+
report_progress("Capturing tracker #{line.strip}")
|
32
33
|
elsif line =~ /^\t/
|
33
34
|
ts[-1].push(make_keyframe(line))
|
34
35
|
end
|
@@ -39,11 +40,15 @@ class Tracksperanto::Import::Equalizer3 < Tracksperanto::Import::Base
|
|
39
40
|
end
|
40
41
|
|
41
42
|
def discard_last_empty_tracker!(in_array)
|
42
|
-
|
43
|
+
if (in_array.any? && in_array[-1].empty?)
|
44
|
+
in_array.delete_at(-1)
|
45
|
+
report_progress("Removing the last tracker since it had no keyframes")
|
46
|
+
end
|
43
47
|
end
|
44
48
|
|
45
49
|
def make_keyframe(from_line)
|
46
50
|
frame, x, y = from_line.split
|
51
|
+
report_progress("Capturing keyframe #{frame}")
|
47
52
|
Tracksperanto::Keyframe.new(:frame => (frame.to_i - 1), :abs_x => x, :abs_y => y)
|
48
53
|
end
|
49
54
|
end
|
data/lib/import/equalizer4.rb
CHANGED
@@ -26,6 +26,8 @@ class Tracksperanto::Import::Equalizer4 < Tracksperanto::Import::Base
|
|
26
26
|
def extract_tracker(io)
|
27
27
|
t = Tracksperanto::Tracker.new(:name => io.gets.strip)
|
28
28
|
|
29
|
+
report_progress("Capturing tracker #{t.name}")
|
30
|
+
|
29
31
|
io.gets # Tracker color, internal 3DE repr and 0 is Red
|
30
32
|
|
31
33
|
num_of_keyframes = io.gets.to_i
|
@@ -35,6 +37,7 @@ class Tracksperanto::Import::Equalizer4 < Tracksperanto::Import::Base
|
|
35
37
|
throw :__emp unless line
|
36
38
|
|
37
39
|
frame, x, y = line.scan(KF_PATTERN).flatten
|
40
|
+
report_progress("Capturing keyframe #{frame}")
|
38
41
|
t.keyframe!(:frame => (frame.to_i - 1), :abs_x => x, :abs_y => y)
|
39
42
|
end
|
40
43
|
end
|
data/lib/tracksperanto.rb
CHANGED
data/tracksperanto.gemspec
CHANGED
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.5.
|
4
|
+
version: 1.5.2
|
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-10-
|
12
|
+
date: 2009-10-11 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|