Page 1 of 2

missing texture for a obj

Posted: Sun Nov 22, 2020 2:03 am
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?

Re: missing texture for a obj

Posted: Mon Nov 23, 2020 9:53 pm
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)

Re: missing texture for a obj

Posted: Sun Jan 24, 2021 2:16 am
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

Re: missing texture for a obj

Posted: Mon Jan 25, 2021 5:57 pm
by daniel
Same question: can you share the file(s) with me? (admin [at] cloudcompare.org)

Re: missing texture for a obj

Posted: Wed Jan 27, 2021 7:33 pm
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.

Re: missing texture for a obj

Posted: Wed Jan 27, 2021 10:00 pm
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).

Re: missing texture for a obj

Posted: Fri Apr 08, 2022 3:44 pm
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?

Re: missing texture for a obj

Posted: Sat Apr 09, 2022 2:24 pm
by daniel
Just open the '.mtl' file with a text editor. And look for 'Tr=1' lines (if any).

Re: missing texture for a obj

Posted: Mon Apr 11, 2022 4:14 am
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

Re: missing texture for a obj

Posted: Wed Apr 13, 2022 7:36 pm
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?