Class: Tracksperanto::Export::MatchMover
- Inherits:
-
Base
- Object
- Base
- Tracksperanto::Export::MatchMover
show all
- Defined in:
- lib/export/match_mover.rb
Overview
Export for Autodesk MatchMover/Image Modeler
Constant Summary
collapse
- PREAMBLE =
%[imageSequence "Sequence 01"\n{\n\t%d\t%d\tf( "D:/temp/sequence.%%04d.dpx" )\tb( 1 211 1 )\t\n}\n]
- TRACKER_PREAMBLE =
"pointTrack %s rgb( 255 0 0 ) \n{\n"
- TRACKER_POSTAMBLE =
"}\n"
- FIRST_KEYFRAME_TEMPLATE =
"\t%d\t %.3f %.3f ki( 0.8 )\t s( 66 66 64 64 ) p( 24 24 25 25 )"
- KEYFRAME_TEMPLATE =
"\t%d\t %.3f %.3f p+( %.6f )\t"
Instance Attribute Summary
Attributes inherited from Base
#io
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#end_export, inherited, #initialize
Methods included from ConstName
#const_name, included
#just_export
Class Method Details
.desc_and_extension ⇒ Object
5
6
7
|
# File 'lib/export/match_mover.rb', line 5
def self.desc_and_extension
"matchmover.rz2"
end
|
.human_name ⇒ Object
9
10
11
|
# File 'lib/export/match_mover.rb', line 9
def self.human_name
"MatchMover REALVIZ Ascii Point Tracks .rz2 file"
end
|
Instance Method Details
#end_tracker_segment ⇒ Object
30
31
32
|
# File 'lib/export/match_mover.rb', line 30
def end_tracker_segment
@io.write(TRACKER_POSTAMBLE)
end
|
#export_point(frame, abs_float_x, abs_float_y, float_residual) ⇒ Object
34
35
36
37
38
39
|
# File 'lib/export/match_mover.rb', line 34
def export_point(frame, abs_float_x, abs_float_y, float_residual)
template = @at_first_point ? FIRST_KEYFRAME_TEMPLATE : KEYFRAME_TEMPLATE
values = [frame + 1, abs_float_x, @height - abs_float_y, (1 - float_residual)]
@io.puts(template % values)
@at_first_point = false
end
|
#start_export(img_width, img_height) ⇒ Object
19
20
21
22
|
# File 'lib/export/match_mover.rb', line 19
def start_export( img_width, img_height)
@height = img_height
@io.puts(PREAMBLE % [img_width, img_height])
end
|
#start_tracker_segment(tracker_name) ⇒ Object
24
25
26
27
28
|
# File 'lib/export/match_mover.rb', line 24
def start_tracker_segment(tracker_name)
@tracker_name = tracker_name
@at_first_point = true
@io.write(TRACKER_PREAMBLE % tracker_name.inspect)
end
|