Reputation: 4531
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
.obj
.mtl
generated file.obj
file into Blender and change to Texture mode to make sure the texture loads just fine.obj
file inside an aframe pageOBSERVATIONS
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.
Upvotes: 0
Views: 1783
Reputation: 14655
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:
I had no trouble using those with Don McCurdy's loaders.
Upvotes: -1