Sha256: 62274ece79e92c456fbb4866dccf23d315cf23b5a5df01711e3558b5530aa529
Contents?: true
Size: 745 Bytes
Versions: 18
Compression:
Stored size: 745 Bytes
Contents
module Mittsu class OBJMTLLoader include EventDispatcher def initialize(manager = DefaultLoadingManager) @manager = manager end def load(url, mtlurl = nil) object = OBJLoader.new(@manager).load(url) if !mtlurl.nil? mtl_loader = MTLLoader.new(File.dirname(url)) materials_creator = mtl_loader.load(mtlurl) materials_creator.preload object.traverse do |child_object| if child_object.is_a?(Mesh) && child_object.material.name && !child_object.material.name.empty? material = materials_creator.create(child_object.material.name) child_object.material = material if material end end end object end end end
Version data entries
18 entries across 18 versions & 1 rubygems