# Object not loading when using MTLLoader

**URL:** <https://discourse.threejs.org/t/object-not-loading-when-using-mtlloader/4575>\
**Category:** Questions\
**Tags:** mtl-loader\
**Created:** [October 20, 2018, 9:55am UTC](https://discourse.threejs.org/t/object-not-loading-when-using-mtlloader/4575 "2018-10-20T09:55:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mithradantor](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mithradantor/32/2979_2.png) [@mithradantor](https://discourse.threejs.org/u/mithradantor)\
**Post date:** [October 20, 2018, 9:55am UTC](https://discourse.threejs.org/t/object-not-loading-when-using-mtlloader/4575/1 "2018-10-20T09:55:34Z")

</div>

Hi guys, I am starting to learn this awesome library and I am totally in love. I followed a couple of tutorials and managed to import my 3d model (obj extension) just fine.

But when I want to import the .mtl file as well, nothing happens just a black screen.

Could anyone please explain me what I am doing wrong?

working code (without materials):

```
loader.load(
	'scene.obj',
	function ( object ) {
		scene.add( object );
	},
	function ( xhr ) {
		console.log( ( xhr.loaded / xhr.total * 100 ) + '% loaded' );
	},
	function ( error ) {
		console.log( 'An error happened' );
	}
);

```

Code that is not working:

```
let materialLoader = new THREE.MTLLoader();
materialLoader.load('scene.mtl', function(materials){

	materials.preload();

	let objectLoader = new THREE.OBJLoader();
	objectLoader.setMaterials(materials);

	objectLoader.load('scene.obj', function(mesh){
		scene.add(mesh);
	});

});

```

Unfortunately, I do not receive any errors or warnings in my developers console, and thus I have no clue where to look.

I hope someone can help me out with this matter.

Best regards

P.S. Link to my code: [http://159.69.213.164/3d/](http://159.69.213.164/3d/)

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [October 20, 2018, 10:09am UTC](https://discourse.threejs.org/t/object-not-loading-when-using-mtlloader/4575/2 "2018-10-20T10:09:54Z")

</div>

Your material has just a black color, that’s all. You can easily see this if you set a white background like so:

```auto
scene.background = new THREE.Color( 0xffffff );

```

![image](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/threejs/original/2X/8/819c35b5f4df13315226f973e00d1165e9a422d3.jpeg)  
This happens because the following line in your MTL file results in a black color. It represents the diffuse reflectivity and is mapped to [MeshPhongMaterial.color](https://threejs.org/docs/index.html#api/en/materials/MeshPhongMaterial.color).

```auto
Kd 0.0000 0.0000 0.0000

```

---

<div class="post-metadata">

**Author:** ![mithradantor](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mithradantor/32/2979_2.png) [@mithradantor](https://discourse.threejs.org/u/mithradantor)\
**Post date:** [October 20, 2018, 10:13am UTC](https://discourse.threejs.org/t/object-not-loading-when-using-mtlloader/4575/3 "2018-10-20T10:13:54Z")

</div>

I dont understand a word of what your saying hahaha… I will investigate, at least now I know something in the material is wrong 🙂

It should be Red and green, exported with 3ds Max 2018. Ill try to figure out where it went wrong.

Fixed it by using scanline (instead of vray) now it is working but extremely fake, no shadows nothing haha but I guess that has to do with the lighting 😃

Thanks so much for your reply!
