Class: Tracksperanto::Import::NukeScript::Tracker4
- Defined in:
- lib/import/nuke_script.rb
Instance Attribute Summary
Attributes inherited from Tracker3
Instance Method Summary collapse
-
#initialize(options) ⇒ Tracker4
constructor
A new instance of Tracker4.
Methods inherited from Tracker3
#extract_curves_from_channel, #package_tracker, #point_channels
Methods included from ZipTuples
Constructor Details
#initialize(options) ⇒ Tracker4
Returns a new instance of Tracker4.
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/import/nuke_script.rb', line 122 def initialize() @name = ["name"] @trackers = [] tracks = ["tracks"] return unless tracks # For linked Tracker nodes that have no tracks preamble = tracks[1] headers = tracks[2] values = tracks[3] # When this was written, this was the order of the columns in the table: # le("e", "name", "track_x", "track_y", "offset_x", "offset_y", "T", "R", "S", "error", # "error_min", "error_max", "pattern_x", "pattern_y", "pattern_r", "pattern_t", "search_x", # "search_y", "search_r", "search_t", "key_track", "key_search_x", "key_search_y", "key_search_r", # "key_search_t", "key_track_x", "key_track_y", "key_track_r", "key_track_t", "key_centre_offset_x", "key_centre_offset_y") tracker_rows = values[0] # The 0 element is the :c symbol tracker_rows[1..-1].each do | row | row_content = row[0] # For offsets see above point_name = row_content[2] begin x_curve = Tickly::Curve.new(row_content[3]) y_curve = Tickly::Curve.new(row_content[4]) full_name = [["name"], point_name].join('_') tracker = package_tracker(full_name, x_curve, y_curve) @trackers << tracker rescue Tickly::Curve::InvalidCurveError # $stderr.puts "Failed to recover a tracker, it probably contained expressions" end end end |