tracksperanto 1.6.7 → 1.6.8
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Manifest.txt +1 -0
- data/lib/import/nuke_script.rb +8 -2
- data/lib/tracksperanto.rb +1 -1
- data/test/import/samples/nuke/tracker_with_repeating_gaps.nk +79 -0
- data/test/import/test_nuke_import.rb +13 -0
- metadata +2 -1
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
@@ -86,6 +86,7 @@ test/import/samples/nuke/018.nk
|
|
86
86
|
test/import/samples/nuke/one_tracker_with_break.nk
|
87
87
|
test/import/samples/nuke/one_tracker_with_break_in_grp.nk
|
88
88
|
test/import/samples/nuke/tracker_with_differing_gaps.nk
|
89
|
+
test/import/samples/nuke/tracker_with_repeating_gaps.nk
|
89
90
|
test/import/samples/pftrack4/sourcefile_pftrack.2dt
|
90
91
|
test/import/samples/pftrack5/garage.2dt
|
91
92
|
test/import/samples/shake_script/four_tracks_in_one_matchmove.shk
|
data/lib/import/nuke_script.rb
CHANGED
@@ -60,16 +60,22 @@ class Tracksperanto::Import::NukeScript < Tracksperanto::Import::Base
|
|
60
60
|
atoms, tuples = curve_text.gsub(/\}/m, ' }').split, []
|
61
61
|
# Nuke saves curves very efficiently. x(keyframe_number) means that an uninterrupted sequence of values will start,
|
62
62
|
# after which values follow. When the curve is interrupted in some way a new x(keyframe_number) will signifu that we
|
63
|
-
# skip to that specified keyframe and the curve continues from there
|
63
|
+
# skip to that specified keyframe and the curve continues from there, in gap size defined by the last fragment.
|
64
|
+
# That is, x1 1 x3 2 3 4 will place 2, 3 and 4 at 2-frame increments
|
64
65
|
|
65
66
|
last_processed_keyframe = 1
|
67
|
+
intraframe_gap_size = 1
|
66
68
|
while atom = atoms.shift
|
67
69
|
if atom =~ SECTION_START
|
68
70
|
last_processed_keyframe = $1.to_i
|
71
|
+
if tuples.any?
|
72
|
+
last_captured_frame = tuples[-1][0]
|
73
|
+
intraframe_gap_size = last_processed_keyframe - last_captured_frame
|
74
|
+
end
|
69
75
|
elsif atom =~ KEYFRAME
|
70
76
|
report_progress("Reading curve at frame #{last_processed_keyframe}")
|
71
77
|
tuples << [last_processed_keyframe, $1.to_f]
|
72
|
-
last_processed_keyframe +=
|
78
|
+
last_processed_keyframe += intraframe_gap_size
|
73
79
|
elsif atom == '}'
|
74
80
|
return tuples
|
75
81
|
end
|
data/lib/tracksperanto.rb
CHANGED
@@ -0,0 +1,79 @@
|
|
1
|
+
#! /Applications/Nuke5.2v3/Nuke5.2v3.app/Contents/MacOS/Nuke5.2v3 -nx
|
2
|
+
version 5.2300
|
3
|
+
define_window_layout_xml {<?xml version="1.0" encoding="UTF-8"?>
|
4
|
+
<layout version="1.0">
|
5
|
+
<window x="0" y="22" w="1680" h="1024" screen="0">
|
6
|
+
<splitter orientation="1">
|
7
|
+
<split size="1062"></split>
|
8
|
+
<splitter orientation="1">
|
9
|
+
<split size="40"></split>
|
10
|
+
<dock id="" hideTitles="1" activePageId="Toolbar.1">
|
11
|
+
<page id="Toolbar.1"></page>
|
12
|
+
</dock>
|
13
|
+
<split size="1018"></split>
|
14
|
+
<splitter orientation="2">
|
15
|
+
<split size="499"></split>
|
16
|
+
<dock id="" activePageId="Viewer.1">
|
17
|
+
<page id="Viewer.1"></page>
|
18
|
+
</dock>
|
19
|
+
<split size="499"></split>
|
20
|
+
<dock id="" activePageId="DAG.1">
|
21
|
+
<page id="DAG.1"></page>
|
22
|
+
<page id="Curve Editor.1"></page>
|
23
|
+
</dock>
|
24
|
+
</splitter>
|
25
|
+
</splitter>
|
26
|
+
<split size="614"></split>
|
27
|
+
<dock id="" activePageId="Properties.1">
|
28
|
+
<page id="Properties.1"></page>
|
29
|
+
<page id="Script Editor.1"></page>
|
30
|
+
</dock>
|
31
|
+
</splitter>
|
32
|
+
</window>
|
33
|
+
</layout>
|
34
|
+
}
|
35
|
+
Root {
|
36
|
+
inputs 0
|
37
|
+
name /Code/apps/tracksperanto/test/import/samples/nuke/tracker_with_repeating_gaps.nk
|
38
|
+
frame 12
|
39
|
+
format "2048 1556 0 0 2048 1556 1 2K_Super_35(full-ap)"
|
40
|
+
proxy_type scale
|
41
|
+
proxy_format "1024 778 0 0 1024 778 1 1K_Super_35(full-ap)"
|
42
|
+
}
|
43
|
+
Viewer {
|
44
|
+
inputs 0
|
45
|
+
frame 12
|
46
|
+
name Viewer1
|
47
|
+
xpos -40
|
48
|
+
ypos -10
|
49
|
+
}
|
50
|
+
Constant {
|
51
|
+
inputs 0
|
52
|
+
channels rgb
|
53
|
+
name Constant1
|
54
|
+
xpos -265
|
55
|
+
ypos -191
|
56
|
+
}
|
57
|
+
Tracker3 {
|
58
|
+
track1 {{curve x1 196 326 440 x6 554 658 752} {curve x1 574 556 534 x6 512 492 476}}
|
59
|
+
offset1 {0 0}
|
60
|
+
pattern1 {-32 -32 32 32}
|
61
|
+
search1 {-22 -22 22 22}
|
62
|
+
track2 {1126 676}
|
63
|
+
offset2 {0 0}
|
64
|
+
pattern2 {-32 -32 32 32}
|
65
|
+
search2 {-22 -22 22 22}
|
66
|
+
track3 {1126 880}
|
67
|
+
offset3 {0 0}
|
68
|
+
pattern3 {-32 -32 32 32}
|
69
|
+
search3 {-22 -22 22 22}
|
70
|
+
track4 {922 880}
|
71
|
+
offset4 {0 0}
|
72
|
+
pattern4 {-32 -32 32 32}
|
73
|
+
search4 {-22 -22 22 22}
|
74
|
+
translate {{curve x1 0 130 244 x6 358 462 556} {curve x1 0 -18 -40 x6 -62 -82 -98}}
|
75
|
+
center {{curve x1 196 196 196 x6 196 196 196} {curve x1 574 574 574 x6 574 574 574}}
|
76
|
+
name Tracker1
|
77
|
+
xpos -265
|
78
|
+
ypos -119
|
79
|
+
}
|
@@ -51,6 +51,19 @@ class NukeImportTest < Test::Unit::TestCase
|
|
51
51
|
assert_equal 109, t[-1].frame
|
52
52
|
end
|
53
53
|
|
54
|
+
def test_parsing_node_with_succesive_gaps_larger_than_one_frame
|
55
|
+
fixture = File.open(File.dirname(__FILE__) + '/samples/nuke/tracker_with_repeating_gaps.nk')
|
56
|
+
parser = Tracksperanto::Import::NukeScript.new
|
57
|
+
parser.width = 2048
|
58
|
+
parser.height = 1556
|
59
|
+
trackers = parser.parse(fixture)
|
60
|
+
assert_equal 1, trackers.length
|
61
|
+
t = trackers[0]
|
62
|
+
assert_equal 5, t[3].frame
|
63
|
+
assert_equal 8, t[4].frame
|
64
|
+
assert_equal 11, t[5].frame
|
65
|
+
end
|
66
|
+
|
54
67
|
def test_parsing_from_nuke_group
|
55
68
|
fixture = File.open(File.dirname(__FILE__) + '/samples/nuke/one_tracker_with_break_in_grp.nk')
|
56
69
|
|
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.6.
|
4
|
+
version: 1.6.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julik Tarkhanov
|
@@ -133,6 +133,7 @@ files:
|
|
133
133
|
- test/import/samples/nuke/one_tracker_with_break.nk
|
134
134
|
- test/import/samples/nuke/one_tracker_with_break_in_grp.nk
|
135
135
|
- test/import/samples/nuke/tracker_with_differing_gaps.nk
|
136
|
+
- test/import/samples/nuke/tracker_with_repeating_gaps.nk
|
136
137
|
- test/import/samples/pftrack4/sourcefile_pftrack.2dt
|
137
138
|
- test/import/samples/pftrack5/garage.2dt
|
138
139
|
- test/import/samples/shake_script/four_tracks_in_one_matchmove.shk
|