Unity3D ObjectTracking - OBJ/MTL error with no further hints to resolve this issue

0 votes
asked Sep 11 by enozone (170 points)
edited Sep 11 by enozone

Hi, we're trying to get the object tracking to work, currently without luck. We consistently get errors

Error: Error in opening material file: file:///cube/cube.mtl

Error: Error in opening OBJ file: file:///cube/cube.obj

Error: invalid trackable 42: cube

All the while the example hexagone works.

We saw several topics on the subject, but with no real answer other than a link to the documentation, which we carefully went through already.

By modifying the generated mtl with the texture and material name of the hexagone example, the hexagon example still is loaded. So the real issue seems to be the obj file. I've tried to have the same content structure... but still the import fails.

folder structure

StreamingAssets/cube/

> cube.mtl

> cube.obj

> cube.png

cube.mtl

newmtl cube:marqueur

Ns 10.0000

Ni 1.5000

d 1.0000

Tr 0.0000

Tf 1.0000 1.0000 1.0000 

illum 4

Ka 0.5882 0.5882 0.5882

Kd 0.5882 0.5882 0.5882

Ks 0.0000 0.0000 0.0000

Ke 0.0000 0.0000 0.0000

map_Ka cube.png

map_Kd cube.png

cube.obj

# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
# File Created: 11.09.2020 14:05:21

mtllib cube.mtl

#
# object cube
#

v  -0.0300 -0.0000 0.0300
v  -0.0300 0.0000 -0.0300
v  0.0300 0.0000 -0.0300
v  0.0300 -0.0000 0.0300
v  -0.0300 0.0600 0.0300
v  0.0300 0.0600 0.0300
v  0.0300 0.0600 -0.0300
v  -0.0300 0.0600 -0.0300
# 8 vertices

vn 0.0000 0.0000 -1.0000
vn 0.0000 -0.0000 1.0000
vn 0.0000 -1.0000 -0.0000
vn 1.0000 0.0000 -0.0000
vn 0.0000 1.0000 0.0000
vn -1.0000 0.0000 -0.0000
# 6 vertex normals

vt 0.3667 0.2914
vt 0.3667 0.0893
vt 0.6523 0.0893
vt 0.6523 0.2914
vt 0.3667 0.4934
vt 0.6523 0.4934
vt 0.6523 0.6955
vt 0.3667 0.6955
vt 0.9382 0.2914
vt 0.9382 0.4934
vt 0.6523 0.8976
vt 0.3667 0.8976
vt 0.0808 0.2914
vt 0.0808 0.4934
# 14 texture coords
s off
g cube
usemtl cube:marqueur
f 1/1/1 2/2/1 3/3/1 
f 3/3/1 4/4/1 1/1/1 
f 5/5/2 6/6/2 7/7/2 
f 7/7/2 8/8/2 5/5/2 
f 1/1/3 4/4/3 6/6/3 
f 6/6/3 5/5/3 1/1/3 
f 4/4/4 3/9/4 7/10/4 
f 7/10/4 6/6/4 4/4/4 
f 3/11/5 2/12/5 8/8/5 
f 8/8/5 7/7/5 3/11/5 
f 2/13/6 1/1/6 5/5/6 
f 5/5/6 8/14/6 2/13/6 
# 12 faces

Exports were done from 3DS Max. Any specific exporter version we need to use for it to work?

Any tool that can help us validate obj files. (They are correctly imported by Unity when in the assets)

FYI, yes I saw the documentation and all files are in UTF-8; so no need to simply repost the link.

Link to the files: https://enozone.box.com/s/yxcjcdpozosyc5hrbovh8ri4fc29zbxk

1 Answer

0 votes
answered Sep 15 by kenn (7,570 points)
selected Sep 15 by enozone
 
Best answer

What is your EasyAR Sense and Unity Plugin version? If it is not 4 or later, upgrade first.

And, to avoid paste the documents, I would say you need to see just a few lines here about Extra File Paths: .mtl and .jpg file path relative to StreamingAssets in this sample.

Because I do not see those values from your post and this link do not mention anything about utf-8, so you may have missed it.

commented Sep 15 by enozone (170 points)
Hi, thank you for your help :)

It was the latest plugin and EasyAR Sense version. But there was an issue with the Extra file paths indeed, which I missed. Nice catch !

Thanks again!
Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...