[name]

A loader for loading an .mtl resource, used internaly by [page:OBJMTLLoader] and [page:UTF8Loader].

Constructor

[name]( [page:LoadingManager loadingManager] )

[page:LoadingManager loadingManager] — LoadingManager to use. Defaults to [page:DefaultLoadingManager DefaultLoadingManager]
Creates a new [name].

Methods

[method:null load]( [page:String url], [page:Function onLoad], [page:Function onProgress], [page:Function onError] )

[page:String url] — required
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:MTLLoaderMaterialCreator MTLLoader.MaterialCreator] instance.
[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.
[page:Function onError] — Will be called when load errors.
Begin loading from url and return the loaded material.

[method:null setPath]( [page:String path] )

[page:String path] — required
Set base path for resolving references. If set this path will be prepended to each loaded and found reference.

[method:null setTexturePath]( [page:String path] )

[page:String path] — required
Set base path for resolving texture references. If set this path will be prepended found texture reference. If not set and setPath is, it will be used as texture base path.

[method:null setCrossOrigin]( [page:boolean useCrossOrigin] )

[page:boolean useCrossOrigin] — required
Set to true if you need to load textures from a different origin.

[method:null setMaterialOptions]( [page:Object options] )

[page:Object options] — required
Set of options on how to construct the materials

[method:MTLLoaderMaterialCreator parse]( [page:String text] )

[page:String text] — The textual mtl structure to parse.
Parse a mtl text structure and return a [page:MTLLoaderMaterialCreator] instance.

Source

[link:https://github.com/mrdoob/three.js/blob/master/examples/js/loaders/[name].js examples/js/loaders/[name].js]