Class: Tracksperanto::Export::Base
- Inherits:
-
Object
- Object
- Tracksperanto::Export::Base
- Includes:
- ConstName, SimpleExport
- Defined in:
- lib/export/base.rb
Overview
Base exporter. Inherit from this class to automatically register another export format. The exporters in Tracksperanto are event-driven and follow the same conventions - your exporter will be notified when a tracker will be exported and when a tracker has been passed (the last keyframe has been sent)
Direct Known Subclasses
Equalizer3, Equalizer4, MatchMover, MayaLive, NukeScript, PFTrack4, ShakeText, SynthEyes
Instance Attribute Summary collapse
-
#io ⇒ Object
readonly
Returns the value of attribute io.
Class Method Summary collapse
-
.desc_and_extension ⇒ Object
Should return the suffix and extension of this export file (like “flame.stabilizer”), without the leading underscore.
-
.human_name ⇒ Object
Should return the human-readable (read: properly capitalized and with spaces) name of the export module.
- .inherited(by) ⇒ Object
Instance Method Summary collapse
-
#end_export ⇒ Object
Called on export end.
-
#end_tracker_segment ⇒ Object
Called on tracker end.
-
#export_point(at_frame_i, abs_float_x, abs_float_y, float_residual) ⇒ Object
Called for each tracker keyframe, with the Tracksperanto internal coordinates and frame numbers.
-
#initialize(write_to_io) ⇒ Base
constructor
The constructor for an exporter should accept a handle to the IO object that you can write to.
-
#start_export(img_width, img_height) ⇒ Object
Called on export start.
-
#start_tracker_segment(tracker_name) ⇒ Object
Called on tracker start, once for each tracker.
Methods included from SimpleExport
Methods included from ConstName
Constructor Details
#initialize(write_to_io) ⇒ Base
The constructor for an exporter should accept a handle to the IO object that you can write to. This gets assigned to @io ivar by default, but you can do whatever ypu wish By convention, the caller will close the IO when you are done so don’t do it here
30 31 32 |
# File 'lib/export/base.rb', line 30 def initialize(write_to_io) @io = write_to_io end |
Instance Attribute Details
#io ⇒ Object (readonly)
Returns the value of attribute io.
9 10 11 |
# File 'lib/export/base.rb', line 9 def io @io end |
Class Method Details
.desc_and_extension ⇒ Object
Should return the suffix and extension of this export file (like “flame.stabilizer”), without the leading underscore. It’s a class method because it gets requested before the exporter is instantiated
18 19 20 |
# File 'lib/export/base.rb', line 18 def self.desc_and_extension "data.txt" end |
.human_name ⇒ Object
Should return the human-readable (read: properly capitalized and with spaces) name of the export module
23 24 25 |
# File 'lib/export/base.rb', line 23 def self.human_name "Abstract export format" end |
.inherited(by) ⇒ Object
11 12 13 14 |
# File 'lib/export/base.rb', line 11 def self.inherited(by) Tracksperanto.exporters << by super end |
Instance Method Details
#end_export ⇒ Object
Called on export end. By convention, the caller will close the IO when you are done so don’t do it here
39 40 |
# File 'lib/export/base.rb', line 39 def end_export end |
#end_tracker_segment ⇒ Object
Called on tracker end
47 48 |
# File 'lib/export/base.rb', line 47 def end_tracker_segment end |
#export_point(at_frame_i, abs_float_x, abs_float_y, float_residual) ⇒ Object
Called for each tracker keyframe, with the Tracksperanto internal coordinates and frame numbers
51 52 |
# File 'lib/export/base.rb', line 51 def export_point(at_frame_i, abs_float_x, abs_float_y, float_residual) end |
#start_export(img_width, img_height) ⇒ Object
Called on export start. Will receive the width and height of the comp being exported
35 36 |
# File 'lib/export/base.rb', line 35 def start_export( img_width, img_height) end |
#start_tracker_segment(tracker_name) ⇒ Object
Called on tracker start, once for each tracker. Receives the name of the tracker.
43 44 |
# File 'lib/export/base.rb', line 43 def start_tracker_segment(tracker_name) end |