# One .obj textures fine, the other will not accept a material

**URL:** <https://forum.babylonjs.com/t/one-obj-textures-fine-the-other-will-not-accept-a-material/13675>\
**Category:** Questions\
**Created:** [August 26, 2020, 1:40am UTC](https://forum.babylonjs.com/t/one-obj-textures-fine-the-other-will-not-accept-a-material/13675 "2020-08-26T01:40:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![saitogroup](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/saitogroup/32/10624_2.png) [@saitogroup](https://forum.babylonjs.com/u/saitogroup)\
**Post date:** [August 26, 2020, 1:40am UTC](https://forum.babylonjs.com/t/one-obj-textures-fine-the-other-will-not-accept-a-material/13675/1 "2020-08-26T01:40:08Z")

</div>

```
BABYLON.SceneLoader.Append(
  "",
  //"https://cdn.glitch.com/6887aae9-a0f6-4d7c-95b5-6736d1ee7c6a%2Fmap_d9ec16cc-067f-4d8a-b9fe-0fc9f3f0d2b1_densified_mesh_textured.obj?v=1594250333408",
  
  //simplified tree
  //"https://cdn.glitch.com/6887aae9-a0f6-4d7c-95b5-6736d1ee7c6a%2Fsimplified%20tree.obj?v=1595209538348",
  
  //room
  "https://cdn.glitch.com/6887aae9-a0f6-4d7c-95b5-6736d1ee7c6a%2F20200818_161923.obj?v=1598059231604",
  scene,
  function(scene) {

  //texture attempt
  var mat = new BABYLON.StandardMaterial("dog", scene);
  mat.emissiveTexture = mat.diffuseTexture = new BABYLON.Texture("https://cdn.glitch.com/6887aae9-a0f6-4d7c-95b5-6736d1ee7c6a%2F1597792716689_0.png?v=1598404907698", scene);
  
    
    
    var test = new BABYLON.StandardMaterial("texture", scene);
    test.diffuseColor = new BABYLON.Color3(1, 0, 0); //Red
    //test.alpha = 0.1; //0.3;
    //six for the complex model
    scene.meshes[7].material = mat; //test;
    //from tree to forest
    //(!)to use the new one you have to group them all together
    for (var i = 0; i < 1; i++) {
      const flips = [-1, 1];
      function randomFlip(flips) {
        return flips[Math.floor(Math.random() * flips.length)];
      }
      var randomX = Math.random() * 500 * randomFlip(flips);
      var randomZ = Math.random() * 500 * randomFlip(flips);
      var newTree = scene.meshes[7].clone();
      newTree.material = mat; //test;
      newTree.translate(BABYLON.Axis.X, randomX, BABYLON.Space.WORLD);
      newTree.translate(BABYLON.Axis.Z, randomZ, BABYLON.Space.WORLD);
      newTree.translate(BABYLON.Axis.Y, -10, BABYLON.Space.WORLD);
    }

```

When I uncomment my other .obj mesh and apply the texture to it, it works fine, but this mesh doesn’t seem to accept the texture. I look it up in the inspector and material = null. Why won’t it accept a material, and then a texture? Advice/thoughts/troubleshooting help?

---

<div class="post-metadata">

**Author:** ![saitogroup](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/saitogroup/32/10624_2.png) [@saitogroup](https://forum.babylonjs.com/u/saitogroup)\
**Post date:** [August 26, 2020, 1:40am UTC](https://forum.babylonjs.com/t/one-obj-textures-fine-the-other-will-not-accept-a-material/13675/2 "2020-08-26T01:40:55Z")

</div>

the .obj in question has many polygons and is very complex; it’s a 3D scan of a room, not sure if that makes a difference.

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [August 26, 2020, 8:50am UTC](https://forum.babylonjs.com/t/one-obj-textures-fine-the-other-will-not-accept-a-material/13675/3 "2020-08-26T08:50:02Z")

</div>

Could you provide a repro in the Playground?

---

<div class="post-metadata">

**Author:** ![saitogroup](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/saitogroup/32/10624_2.png) [@saitogroup](https://forum.babylonjs.com/u/saitogroup)\
**Post date:** [August 27, 2020, 1:13am UTC](https://forum.babylonjs.com/t/one-obj-textures-fine-the-other-will-not-accept-a-material/13675/4 "2020-08-27T01:13:49Z")

</div>

I fixed it! I used the assets loader (rather than the scene loader) and everything worked!
