Class: Tracksperanto::Import::Base
- Inherits:
-
Object
- Object
- Tracksperanto::Import::Base
- Defined in:
- lib/import/base.rb
Overview
The base class for all the import modules. By default, when you inherit from this class the inherited class will be included in the list of supported Tracksperanto importers. The API that an importer should present is very basic, and consists only of a few methods. The main method is ‘each`.
Direct Known Subclasses
Boujou, Equalizer3, Equalizer4, FlameStabilizer, MatchMover, MatchMoverRZML, MayaLive, NukeScript, PFTrack, ShakeScript, ShakeText, Syntheyes, SyntheyesAllTrackerPaths
Instance Attribute Summary collapse
-
#height ⇒ Object
The original width and height of the tracked image.
-
#io ⇒ Object
Handle to the IO with data being parsed.
-
#progress_block ⇒ Object
Tracksperanto will assign a proc that reports the status of the import to the caller.
-
#width ⇒ Object
The original width and height of the tracked image.
Class Method Summary collapse
-
.autodetects_size? ⇒ Boolean
Return true from this method if your importer can deduce the comp size from the passed file.
-
.distinct_file_ext ⇒ Object
Return an extension WITH DOT if this format has a typical extension that you can detect (like “.nk” for Nuke).
-
.human_name ⇒ Object
Should return a human-readable (read: properly capitalized and with spaces) name of the import format.
-
.inherited(by) ⇒ Object
Used to register your importer in the list of supported formats.
-
.known_snags ⇒ Object
Returns a textual description of things to check when the user wants to import from this specific format.
Instance Method Summary collapse
-
#each ⇒ Object
The main method of the parser.
-
#report_progress(message) ⇒ Object
Call this method from the inside of your importer to tell what you are doing.
Methods included from BlockInit
Methods included from ZipTuples
Methods included from ConstName
Methods included from Safety
Methods included from Casts
#cast_to_bool, #cast_to_float, #cast_to_int, #cast_to_string
Instance Attribute Details
#height ⇒ Object
The original width and height of the tracked image. If you need to know the width for your specific format and cannot autodetect it, Trakcksperanto will assign the passed width and height to the importer object before running the import. If not, you can replace the assigned values with your own. At the end of the import procedure, Tracksperanto will read the values from you again and will use the read values for determining the original comp size. width
and height
MUST return unsigned integer values after the import completes
26 27 28 |
# File 'lib/import/base.rb', line 26 def height @height end |
#io ⇒ Object
Handle to the IO with data being parsed
11 12 13 |
# File 'lib/import/base.rb', line 11 def io @io end |
#progress_block ⇒ Object
Tracksperanto will assign a proc that reports the status of the import to the caller. This block is automatically used by report_progress IF the proc is assigned. Should the proc be nil, the report_progress method will just pass (so you don’t need to check for nil yourself)
17 18 19 |
# File 'lib/import/base.rb', line 17 def progress_block @progress_block end |
#width ⇒ Object
The original width and height of the tracked image. If you need to know the width for your specific format and cannot autodetect it, Trakcksperanto will assign the passed width and height to the importer object before running the import. If not, you can replace the assigned values with your own. At the end of the import procedure, Tracksperanto will read the values from you again and will use the read values for determining the original comp size. width
and height
MUST return unsigned integer values after the import completes
26 27 28 |
# File 'lib/import/base.rb', line 26 def width @width end |
Class Method Details
.autodetects_size? ⇒ Boolean
Return true from this method if your importer can deduce the comp size from the passed file
55 56 57 |
# File 'lib/import/base.rb', line 55 def self.autodetects_size? false end |
.distinct_file_ext ⇒ Object
Return an extension WITH DOT if this format has a typical extension that you can detect (like “.nk” for Nuke)
41 42 |
# File 'lib/import/base.rb', line 41 def self.distinct_file_ext end |
.human_name ⇒ Object
Should return a human-readable (read: properly capitalized and with spaces) name of the import format
46 47 48 |
# File 'lib/import/base.rb', line 46 def self.human_name "Abstract import format" end |
.inherited(by) ⇒ Object
Used to register your importer in the list of supported formats. Normally you would not need to override this
34 35 36 37 |
# File 'lib/import/base.rb', line 34 def self.inherited(by) Tracksperanto.importers << by super end |
.known_snags ⇒ Object
Returns a textual description of things to check when the user wants to import from this specific format
51 52 |
# File 'lib/import/base.rb', line 51 def self.known_snags end |
Instance Method Details
#each ⇒ Object
The main method of the parser. Should yield each Tracker that has been fully parsed. After calling this method the caller can ask for width and height as well.
68 69 |
# File 'lib/import/base.rb', line 68 def each end |
#report_progress(message) ⇒ Object
Call this method from the inside of your importer to tell what you are doing. This gets propagated to the caller automatically, or gets ignored if the caller did not request any progress reports
61 62 63 |
# File 'lib/import/base.rb', line 61 def report_progress() @progress_block.call() if @progress_block end |