tracksperanto 3.0.1 → 3.1.0
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 +4 -0
- data/lib/export/maxscript.rb +62 -0
- data/lib/tracksperanto.rb +1 -1
- data/test/export/samples/ref_Maxscript.ms +93 -0
- data/test/export/test_maxscript.rb +17 -0
- data/test/test_cli.rb +1 -1
- data/tracksperanto.gemspec +5 -2
- metadata +6 -3
data/History.txt
CHANGED
@@ -0,0 +1,62 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
# Export each tracker as a moving 3dsmax null
|
3
|
+
class Tracksperanto::Export::Maxscript < Tracksperanto::Export::Base
|
4
|
+
|
5
|
+
MULTIPLIER = 10.0
|
6
|
+
IMAGE_PLANE = 'new_plane = convertToPoly (plane width:%0.5f length:%0.5f lengthsegs:1 widthsegs:1 name:"TracksperantoPlane" backFaceCull:True)'
|
7
|
+
|
8
|
+
def self.desc_and_extension
|
9
|
+
"3dsmax_nulls.ms"
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.human_name
|
13
|
+
"Autodesk 3dsmax script for nulls on an image plane"
|
14
|
+
end
|
15
|
+
|
16
|
+
def start_export(w, h)
|
17
|
+
# Pixel sizes are HUGE. Hence we downscale
|
18
|
+
@factor = (1 / w.to_f) * MULTIPLIER
|
19
|
+
@true_width, @true_height = w * @factor, h * @factor
|
20
|
+
|
21
|
+
# Generate a Plane primitive
|
22
|
+
@io.puts(IMAGE_PLANE % [@true_width, @true_height])
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
def start_tracker_segment(tracker_name)
|
27
|
+
@t = tracker_name
|
28
|
+
@initalized = false
|
29
|
+
@io.puts("-- Data for tracker %s" % @t)
|
30
|
+
@io.puts('animate on (')
|
31
|
+
end
|
32
|
+
|
33
|
+
def end_tracker_segment
|
34
|
+
# Parent the null to the image plane
|
35
|
+
#@tracker_names.push(@t)
|
36
|
+
@io.puts(')')
|
37
|
+
end
|
38
|
+
|
39
|
+
def export_point(frame, abs_float_x, abs_float_y, float_residual)
|
40
|
+
coords = get_coordinates(abs_float_x, abs_float_y)
|
41
|
+
coords.unshift @t
|
42
|
+
if !@initalized
|
43
|
+
@io.puts('pt = Point name:"%s" pos:[%0.5f,%0.5f,0.000] size:1.000000 axistripod:off centermarker:on isSelected:on' % coords)
|
44
|
+
@initalized = true
|
45
|
+
end
|
46
|
+
@io.puts('at time %d pt.pos.x = %.5f' % [frame, coords[1]])
|
47
|
+
@io.puts('at time %d pt.pos.y = %.5f' % [frame, coords[2]])
|
48
|
+
end
|
49
|
+
|
50
|
+
def end_export
|
51
|
+
# Create a Model group and parent all the trackers and the image plane to it
|
52
|
+
@io.puts('animate off')
|
53
|
+
@io.puts('EnableSceneRedraw()')
|
54
|
+
end
|
55
|
+
|
56
|
+
private
|
57
|
+
|
58
|
+
def get_coordinates(x, y)
|
59
|
+
# Get the coords multiplied by factor, and let the scene origin be the center of the composition
|
60
|
+
[(x * @factor) - (@true_width / 2), y * @factor - (@true_height / 2)]
|
61
|
+
end
|
62
|
+
end
|
data/lib/tracksperanto.rb
CHANGED
@@ -0,0 +1,93 @@
|
|
1
|
+
new_plane = convertToPoly (plane width:10.00000 length:5.62500 lengthsegs:1 widthsegs:1 name:"TracksperantoPlane" backFaceCull:True)
|
2
|
+
-- Data for tracker Parabolic_1_from_top_left
|
3
|
+
animate on (
|
4
|
+
pt = Point name:"Parabolic_1_from_top_left" pos:[-5.00000,2.81250,0.000] size:1.000000 axistripod:off centermarker:on isSelected:on
|
5
|
+
at time 0 pt.pos.x = -5.00000
|
6
|
+
at time 0 pt.pos.y = 2.81250
|
7
|
+
at time 1 pt.pos.x = -4.50000
|
8
|
+
at time 1 pt.pos.y = 1.74375
|
9
|
+
at time 2 pt.pos.x = -4.00000
|
10
|
+
at time 2 pt.pos.y = 0.78750
|
11
|
+
at time 3 pt.pos.x = -3.50000
|
12
|
+
at time 3 pt.pos.y = -0.05625
|
13
|
+
at time 4 pt.pos.x = -3.00000
|
14
|
+
at time 4 pt.pos.y = -0.78750
|
15
|
+
at time 5 pt.pos.x = -2.50000
|
16
|
+
at time 5 pt.pos.y = -1.40625
|
17
|
+
at time 6 pt.pos.x = -2.00000
|
18
|
+
at time 6 pt.pos.y = -1.91250
|
19
|
+
at time 7 pt.pos.x = -1.50000
|
20
|
+
at time 7 pt.pos.y = -2.30625
|
21
|
+
at time 8 pt.pos.x = -1.00000
|
22
|
+
at time 8 pt.pos.y = -2.58750
|
23
|
+
at time 9 pt.pos.x = -0.50000
|
24
|
+
at time 9 pt.pos.y = -2.75625
|
25
|
+
at time 12 pt.pos.x = 1.00000
|
26
|
+
at time 12 pt.pos.y = -2.58750
|
27
|
+
at time 13 pt.pos.x = 1.50000
|
28
|
+
at time 13 pt.pos.y = -2.30625
|
29
|
+
at time 14 pt.pos.x = 2.00000
|
30
|
+
at time 14 pt.pos.y = -1.91250
|
31
|
+
at time 15 pt.pos.x = 2.50000
|
32
|
+
at time 15 pt.pos.y = -1.40625
|
33
|
+
at time 16 pt.pos.x = 3.00000
|
34
|
+
at time 16 pt.pos.y = -0.78750
|
35
|
+
at time 17 pt.pos.x = 3.50000
|
36
|
+
at time 17 pt.pos.y = -0.05625
|
37
|
+
at time 18 pt.pos.x = 4.00000
|
38
|
+
at time 18 pt.pos.y = 0.78750
|
39
|
+
at time 19 pt.pos.x = 4.50000
|
40
|
+
at time 19 pt.pos.y = 1.74375
|
41
|
+
at time 20 pt.pos.x = 5.00000
|
42
|
+
at time 20 pt.pos.y = 2.81250
|
43
|
+
)
|
44
|
+
-- Data for tracker Parabolic_2_from_bottom_right
|
45
|
+
animate on (
|
46
|
+
pt = Point name:"Parabolic_2_from_bottom_right" pos:[5.00000,-2.81250,0.000] size:1.000000 axistripod:off centermarker:on isSelected:on
|
47
|
+
at time 0 pt.pos.x = 5.00000
|
48
|
+
at time 0 pt.pos.y = -2.81250
|
49
|
+
at time 1 pt.pos.x = 4.50000
|
50
|
+
at time 1 pt.pos.y = -1.74375
|
51
|
+
at time 2 pt.pos.x = 4.00000
|
52
|
+
at time 2 pt.pos.y = -0.78750
|
53
|
+
at time 3 pt.pos.x = 3.50000
|
54
|
+
at time 3 pt.pos.y = 0.05625
|
55
|
+
at time 4 pt.pos.x = 3.00000
|
56
|
+
at time 4 pt.pos.y = 0.78750
|
57
|
+
at time 5 pt.pos.x = 2.50000
|
58
|
+
at time 5 pt.pos.y = 1.40625
|
59
|
+
at time 6 pt.pos.x = 2.00000
|
60
|
+
at time 6 pt.pos.y = 1.91250
|
61
|
+
at time 7 pt.pos.x = 1.50000
|
62
|
+
at time 7 pt.pos.y = 2.30625
|
63
|
+
at time 8 pt.pos.x = 1.00000
|
64
|
+
at time 8 pt.pos.y = 2.58750
|
65
|
+
at time 9 pt.pos.x = 0.50000
|
66
|
+
at time 9 pt.pos.y = 2.75625
|
67
|
+
at time 12 pt.pos.x = -1.00000
|
68
|
+
at time 12 pt.pos.y = 2.58750
|
69
|
+
at time 13 pt.pos.x = -1.50000
|
70
|
+
at time 13 pt.pos.y = 2.30625
|
71
|
+
at time 14 pt.pos.x = -2.00000
|
72
|
+
at time 14 pt.pos.y = 1.91250
|
73
|
+
at time 15 pt.pos.x = -2.50000
|
74
|
+
at time 15 pt.pos.y = 1.40625
|
75
|
+
at time 16 pt.pos.x = -3.00000
|
76
|
+
at time 16 pt.pos.y = 0.78750
|
77
|
+
at time 17 pt.pos.x = -3.50000
|
78
|
+
at time 17 pt.pos.y = 0.05625
|
79
|
+
at time 18 pt.pos.x = -4.00000
|
80
|
+
at time 18 pt.pos.y = -0.78750
|
81
|
+
at time 19 pt.pos.x = -4.50000
|
82
|
+
at time 19 pt.pos.y = -1.74375
|
83
|
+
at time 20 pt.pos.x = -5.00000
|
84
|
+
at time 20 pt.pos.y = -2.81250
|
85
|
+
)
|
86
|
+
-- Data for tracker SingleFrame_InTheMiddle
|
87
|
+
animate on (
|
88
|
+
pt = Point name:"SingleFrame_InTheMiddle" pos:[0.05208,0.05208,0.000] size:1.000000 axistripod:off centermarker:on isSelected:on
|
89
|
+
at time 0 pt.pos.x = 0.05208
|
90
|
+
at time 0 pt.pos.y = 0.05208
|
91
|
+
)
|
92
|
+
animate off
|
93
|
+
EnableSceneRedraw()
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
require File.expand_path(File.dirname(__FILE__)) + '/../helper'
|
3
|
+
|
4
|
+
class MaxscriptExportTest < Test::Unit::TestCase
|
5
|
+
include ParabolicTracks
|
6
|
+
|
7
|
+
P_MAX = File.dirname(__FILE__) + "/samples/ref_Maxscript.ms"
|
8
|
+
|
9
|
+
def test_export_output_written
|
10
|
+
ensure_same_output Tracksperanto::Export::Maxscript, P_MAX
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_exporter_meta
|
14
|
+
assert_equal "3dsmax_nulls.ms", Tracksperanto::Export::Maxscript.desc_and_extension
|
15
|
+
assert_equal "Autodesk 3dsmax script for nulls on an image plane", Tracksperanto::Export::Maxscript.human_name
|
16
|
+
end
|
17
|
+
end
|
data/test/test_cli.rb
CHANGED
@@ -40,7 +40,7 @@ class TestCli < 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.ma flm_createNulls.jsx flm_xsi_nulls.py flm_nuke_cam_trk_autotracks.txt
|
43
|
+
flm_tracksperanto_ruby.rb flm_mayaLocators.ma flm_createNulls.jsx flm_xsi_nulls.py flm_nuke_cam_trk_autotracks.txt flm_3dsmax_nulls.ms
|
44
44
|
)
|
45
45
|
assert_match /Found and converted 1 trackers with 232 keyframes\./, o, "Should have output coversion statistics"
|
46
46
|
assert_same_set fs, Dir.entries(TEMP_DIR)
|
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 = "3.0
|
8
|
+
s.version = "3.1.0"
|
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 = "
|
12
|
+
s.date = "2013-01-14"
|
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"]
|
@@ -33,6 +33,7 @@ Gem::Specification.new do |s|
|
|
33
33
|
"lib/export/flame_stabilizer.rb",
|
34
34
|
"lib/export/flame_stabilizer_cornerpin.rb",
|
35
35
|
"lib/export/match_mover.rb",
|
36
|
+
"lib/export/maxscript.rb",
|
36
37
|
"lib/export/maya_live.rb",
|
37
38
|
"lib/export/maya_locators.rb",
|
38
39
|
"lib/export/mux.rb",
|
@@ -102,6 +103,7 @@ Gem::Specification.new do |s|
|
|
102
103
|
"test/export/samples/ref_AfterEffects.jsx",
|
103
104
|
"test/export/samples/ref_FlameProperlyReorderedCornerpin.stabilizer",
|
104
105
|
"test/export/samples/ref_FlameSimpleReorderedCornerpin.stabilizer",
|
106
|
+
"test/export/samples/ref_Maxscript.ms",
|
105
107
|
"test/export/samples/ref_MayaLocators.ma",
|
106
108
|
"test/export/samples/ref_Mayalive.txt",
|
107
109
|
"test/export/samples/ref_Mayalive_CustomAspect.txt",
|
@@ -127,6 +129,7 @@ Gem::Specification.new do |s|
|
|
127
129
|
"test/export/test_flame_stabilizer_cornerpin_export.rb",
|
128
130
|
"test/export/test_flame_stabilizer_export.rb",
|
129
131
|
"test/export/test_match_mover_export.rb",
|
132
|
+
"test/export/test_maxscript.rb",
|
130
133
|
"test/export/test_maya_live_export.rb",
|
131
134
|
"test/export/test_maya_locators_export.rb",
|
132
135
|
"test/export/test_mux.rb",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tracksperanto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: obuf
|
@@ -196,6 +196,7 @@ files:
|
|
196
196
|
- lib/export/flame_stabilizer.rb
|
197
197
|
- lib/export/flame_stabilizer_cornerpin.rb
|
198
198
|
- lib/export/match_mover.rb
|
199
|
+
- lib/export/maxscript.rb
|
199
200
|
- lib/export/maya_live.rb
|
200
201
|
- lib/export/maya_locators.rb
|
201
202
|
- lib/export/mux.rb
|
@@ -265,6 +266,7 @@ files:
|
|
265
266
|
- test/export/samples/ref_AfterEffects.jsx
|
266
267
|
- test/export/samples/ref_FlameProperlyReorderedCornerpin.stabilizer
|
267
268
|
- test/export/samples/ref_FlameSimpleReorderedCornerpin.stabilizer
|
269
|
+
- test/export/samples/ref_Maxscript.ms
|
268
270
|
- test/export/samples/ref_MayaLocators.ma
|
269
271
|
- test/export/samples/ref_Mayalive.txt
|
270
272
|
- test/export/samples/ref_Mayalive_CustomAspect.txt
|
@@ -290,6 +292,7 @@ files:
|
|
290
292
|
- test/export/test_flame_stabilizer_cornerpin_export.rb
|
291
293
|
- test/export/test_flame_stabilizer_export.rb
|
292
294
|
- test/export/test_match_mover_export.rb
|
295
|
+
- test/export/test_maxscript.rb
|
293
296
|
- test/export/test_maya_live_export.rb
|
294
297
|
- test/export/test_maya_locators_export.rb
|
295
298
|
- test/export/test_mux.rb
|
@@ -376,7 +379,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
376
379
|
version: '0'
|
377
380
|
segments:
|
378
381
|
- 0
|
379
|
-
hash: -
|
382
|
+
hash: -3821362273456769612
|
380
383
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
381
384
|
none: false
|
382
385
|
requirements:
|