missing texture for a obj

Feel free to ask any question here
Ehcchan
Posts: 1
Joined: Sun Nov 22, 2020 1:58 am

missing texture for a obj

Post by Ehcchan »

Hi there,

I've a .obj with texture and work properly using meshlab. However, all texture lose when open it using cloudcompare. I noted that there is following log in the console "Mesh has no normals". However, even I compute it manually using edit>normals>compute function, it doesn't work. Anybody can help what happened and how to fix it?
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: missing texture for a obj

Post by daniel »

The "mesh has no normal" warning is unrelated indeed.

There's no other error in the console? Which version of CC are you using by the way? Can you share the file with me? (admin [at] cloudcompare.org)
Daniel, CloudCompare admin
kimiichi
Posts: 2
Joined: Sun Jan 24, 2021 2:07 am

Re: missing texture for a obj

Post by kimiichi »

Hi, I have the exact same issue! The .obj file I'm opening has a .mtl file and several .jpg files right next to it in the same folder, but the textures don't show in CloudCompare so my mesh is invisible. I was wondering whether the mesh loaded at all until I toggled on visibility for "vertices" and saw the shape appear okay - it's just blanketed in white. The "Mesh has no normals" warning is the only error I had. I followed the instructions to compute them manually and that seemed to go well, but the textures still aren't showing.

My log:

Code: Select all

...
[20:57:44] [OBJ] /Users/---/Downloads/castle-ban-the-rhins-of-galloway/source/Castle Ban - The Rhins/scene_mesh_textured.obj
[20:57:44] [OBJ] Material file: scene_mesh_textured.mtl
[20:57:45] [OBJ] 20 materials loaded
[20:58:21] [OBJ] 1154059 points, 2305781 faces
[20:58:21] [OBJ] 1494383 tex. coords, 0 normals
[20:58:21] [OBJ] Mesh has no normals! You can manually compute them (select it then call "Edit > Normals > Compute")
[20:58:21] [OBJ] 1 mesh loaded - 0 group(s)
[20:58:21] [I/O] File '/Users/---/Downloads/castle-ban-the-rhins-of-galloway/source/Castle Ban - The Rhins/scene_mesh_textured.obj' loaded successfully
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: missing texture for a obj

Post by daniel »

Same question: can you share the file(s) with me? (admin [at] cloudcompare.org)
Daniel, CloudCompare admin
kimiichi
Posts: 2
Joined: Sun Jan 24, 2021 2:07 am

Re: missing texture for a obj

Post by kimiichi »

Sent! However I did find a solution/workaround (or maybe this is what everyone does and I just didn't know? it's my first time) — if you select the object in the DB Tree, then go to Edit > Mesh > Convert texture/material to RGB, it works perfectly. You can also use Edit > Colors > Set Unique or Edit > Colors > Colorize if you just hit OK without changing anything in the pop-up box.
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: missing texture for a obj

Post by daniel »

So for the records, the issue was with the MTL file that has 'Tr 1' statements (for each texture), while 'Tr = transparency', and according to the OBJ/MLT standard, 'Tr = 1' means fully transparent.

Snce recent versions of CC are now supporting transparency, these kind of strange MTL files produce a full transparent, hence invisible, mesh :D

(the solution is to replace all occurences of 'Tr = 1' by 'Tr = 0' in the mtl file).
Daniel, CloudCompare admin
sushiicab0829
Posts: 2
Joined: Fri Apr 08, 2022 3:09 pm

Re: missing texture for a obj

Post by sushiicab0829 »

daniel wrote: Wed Jan 27, 2021 10:00 pm
(the solution is to replace all occurences of 'Tr = 1' by 'Tr = 0' in the mtl file).
Hi Daniel,

May I get a more specific instruction about where to revise all occurences of 'Tr = 1' by 'Tr = 0' in the mtl file?
Do you mean in the section of the cloudcompare?
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: missing texture for a obj

Post by daniel »

Just open the '.mtl' file with a text editor. And look for 'Tr=1' lines (if any).
Daniel, CloudCompare admin
sushiicab0829
Posts: 2
Joined: Fri Apr 08, 2022 3:09 pm

Re: missing texture for a obj

Post by sushiicab0829 »

thanks for the advice Daniel!
somehow the .mtl file here contained no 'Tr = 1' lines.. the example text as below. Would you happen to have any idea on what to do next to get the texture properly in cc? Many thanks!
# Created with FME Version: FME(R) 2020.2.3.0 20210129 - Build 20820 - WIN64
newmtl shib0521
Ks 0.333333 0.333333 0.333333
map_Kd .\materials_textures\shib0521.jpg
newmtl shib4057
Ks 0.333333 0.333333 0.333333
map_Kd .\materials_textures\shib4057.jpg
newmtl shib1322
Ks 0.333333 0.333333 0.333333
map_Kd .\materials_textures\shib1322.jpg
newmtl shib4377
Ks 0.333333 0.333333 0.333333
map_Kd .\materials_textures\shib4377.jpg
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: missing texture for a obj

Post by daniel »

Maybe the paths to the texture images? Are they in a subfolder named 'materials_textures' next to the .mtl file?

If yes, you may want to remove the '.\' in front of the path each time... Not sure about that. Or even move the image files next to the .mtl file and remove the '.\materials_textures' part from the .mtl file?
Daniel, CloudCompare admin
Post Reply