lib/export/maya_locators.rb in tracksperanto-2.9.4 vs lib/export/maya_locators.rb in tracksperanto-2.9.5

- old
+ new

@@ -1,25 +1,33 @@ # -*- encoding : utf-8 -*- # Export each tracker as a moving Maya locator class Tracksperanto::Export::MayaLocators < Tracksperanto::Export::Base + SCENE_PREAMBLE = [ + '//Maya ASCII 2011 scene', + '//Name: TracksperantoLocators.ma', + '//Codeset: UTF-8', + 'requires maya "1.0";' + ].join("\n") + PREAMBLE = 'polyPlane -name "TracksperantoImagePlane" -width %0.5f -height %0.5f;' LOCATOR_PREAMBLE = 'spaceLocator -name "%s" -p 0 0 0;' KEYFRAME_TEMPLATE = 'setKeyframe -time %d -value %0.5f "%s.%s";'; MULTIPLIER = 10.0 def self.desc_and_extension - "mayaLocators.mel" + "mayaLocators.ma" end def self.human_name - "Maya .mel script that generates locators" + "Maya ASCII scene with locators on an image plane" end def start_export(w, h) # Pixel sizes are HUGE for maya. What we do is we assume that the width is 1, # and scale the height to that @factor = (1 / w.to_f) * MULTIPLIER + @io.puts(SCENE_PREAMBLE) @io.puts(PREAMBLE % [MULTIPLIER, h * @factor]) @io.puts('rotate -r -os 90;') # Position it in the XY plane @io.puts('move -r %0.5f %0.5f 0;' % [MULTIPLIER / 2.0, h * @factor / 2.0]) @group_members = ["TracksperantoImagePlane"] end