0

I've created a model in Maya and then exported it as a .obj file. Maya created both the .obj and .mtl files, but it doesn't make a reference to the texture image inside the .mtl file so I added it manually at the end of the file like this:

map_Kd paht/to/texture_image/texture_image.png

When I import the .obj model into blender for testing it looks like this:

How the .obj looks when I open it in Blender

Apparenly it looks like that because Blender opens it in Solid mode, so when I change to Texture mode I can actually see my texture:

How the .obj looks when I change to Texture mode

When I load the .obj inside an aframe project it looks exactly as it does in Solid mode (which is not what I want).

(I can't post a third image link but trust me, inside aframe it looks exactly as it does in blender solid mode, which is completely black)

WHAT I'VE TRIED

I'm loading the .obj model in aframe exactly as I do with other models that are loading correctly, just like this:

<a-entity position = '0 0 -5' obj-model = "obj: url(path/to/file/model.obj); mtl: url(path/to/file/model.mtl)"></a-entity>

I even make sure my .mtl file is correclty referencing the .png image I use as texture.

STEPS TO REPRODUCE

  1. Create a 3d model in Maya
  2. Export the model as .obj
  3. Manually add the texture_image reference to the .mtl generated file
  4. Import the .obj file into Blender and change to Texture mode to make sure the texture loads just fine
  5. Load the .obj file inside an aframe page

OBSERVATIONS

I'm using a Windows 10 PC and here I use Maya 2017 and Blender 2.78. And for the aframe project I'm using macOS Sierra.

2
  • The troubleshooting section in A-Frame's documentation is the best we can offer as general advice. If that doesn't help, I think you would need to provide an example model here. The steps you describe are correct. Sep 7, 2017 at 19:10
  • thanks man, your article was really helpful Sep 13, 2017 at 0:02

1 Answer 1

-1

I've stumbled upon two issues:
1) incorrect paths in the .mtl file
2) The material with the textures had the diffuse (kd) color set to black, which I had to manually change 0 0 0 -> 1 1 1 (in the .mtl file)

You can see a .obj + .mtl glitch here.


Nonetheless I had some bad experience using aframe with 'standard' formats, as .obj, with their .mtl's. I can only say models work with a-frame almost flawlessly, when converted to:

  • .glTF ( khronos group has a really simple exporter for blender ),
  • and three.js .JSON ( using clara.io, ).

I had no trouble using those with Don McCurdy's loaders.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.