lib/import/maya_live.rb in tracksperanto-1.4.0 vs lib/import/maya_live.rb in tracksperanto-1.5.0
- old
+ new
@@ -1,6 +1,12 @@
class Tracksperanto::Import::MayaLive < Tracksperanto::Import::Base
+
+ # Maya Live exports and imports tracks in "aspect units", so a point at 0,0
+ # will be at -1.78,-1 in MayaLive coordinates with aspect of 1.78. Therefore
+ # we offer an override for the aspect being imported (if the pixels are not square)
+ attr_accessor :aspect
+
def self.human_name
"Maya Live track export file"
end
def self.autodetects_size?
@@ -38,10 +44,10 @@
]
end
def extract_width_height_and_aspect(from_str)
self.width, self.height = from_str.scan(/\d+/)
- @aspect = width.to_f / height.to_f
+ @aspect ||= width.to_f / height.to_f
@x_unit = width / (@aspect * 2)
@y_unit = height / (1 * 2)
end
def set_residual(residual)
\ No newline at end of file