Sha256: 4d296ce3cf6d5454b353ba6ba7dcbd5d0b1620e8cdb4856a37aa1b03295e8478

Contents?: true

Size: 1.98 KB

Versions: 3

Compression:

Stored size: 1.98 KB

Contents

#!/usr/bin/env ruby

# Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
# 
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# 
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

require 'collada/parser/library'

require 'collada/conversion/mesh'
require 'collada/conversion/skeleton'
require 'collada/conversion/tagged_format'

require 'rainbow'
require 'benchmark'
require 'trollop'

module Application
	TaggedFormat = Collada::Conversion::TaggedFormat
	
	def self.tagged_format
		options = Trollop::options do
			opt :vertex_format, "Vertices format, one of #{TaggedFormat::VERTEX_FORMATS.keys.join(', ')}.", :default => "p3n3"
			
			opt :nodes, "Dump scene graph data structure", :default => false
		end
		
		doc = REXML::Document.new(ARGF)
		library = Collada::Parser::Library.parse(doc)
		
		TaggedFormat.new(options, library).dump
	end
end

time = Benchmark.measure do
	action = ARGV.shift.gsub(/-/, '_').to_sym
	Application.send(action) if Application.methods.include?(action)
end

$stderr.puts time.format("Elapsed Time: %r").color(:magenta)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
collada-0.2.2 bin/collada-convert
collada-0.2.1 bin/collada-convert
collada-0.2.0 bin/collada-convert