Argentina
Joined: Apr 24, 2017
Post Count: 1
Status:
Offline
importing mtl file
I have obj and mtl files in the same folder. when I try to import both files, it seems sweethome only takes obj file. the couch appears in the library, but with no colors and texture its meant to be. it seems sweethome doesn´t recognize the mtl file.
France
Joined: Nov 7, 2005
Post Count: 9423
Status:
Offline
Re: importing mtl file
It's difficult to help without the OBJ and MTL files. Could you edit the OBJ file with a text editor and write here the line which starts by "mtllib"? Did you use some texture images?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Joined: May 24, 2017
Post Count: 3
Status:
Offline
Re: importing mtl file
I have the same issues with my files I downloaded from https://www.cgtrader.com. I am not able to find the exact link but here are some code-snippets (I hope they are helpful). Here are the first lines of my obj.file which has more than 19.000 lines and 13MB (it's a tree).
mtllib OC12_1.mtl # object OC12_1 g OC12_1 v -0.01253 -0.00193 0.00455 v -0.00879 -0.00551 0.01153 v -0.00093 -0.00652 0.01508 v 0.00737 -0.00449 0.01356 v 0.01224 -0.00036 0.00766 v 0.01139 0.00392 0.00015 v 0.00522 0.00636 -0.00546 v -0.00338 0.00581 -0.00654 v -0.01039 0.00254 -0.00259 v -0.01335 -0.00310 0.00381 v -0.00938 -0.00681 0.01131 v -0.00100 -0.00783 0.01514
Western Europa
Joined: Mar 29, 2014
Post Count: 2614
Status:
Offline
Re: importing mtl file
I have the same issues with my files I downloaded from https://www.cgtrader.com. I am not able to find the exact link but here are some code-snippets (I hope they are helpful). Here are the first lines of my obj.file which has more than 19.000 lines and 13MB (it's a tree). ... and here is my mtl-file:
I also have several tif-files. Both mtl- and obj-files are in the same zip-folder when importing, but colors are not imported. Please help me :) Thanks in advance.
Hi,
I think that tif format is the problem. Try to transform them in jpg and try again.
----------------------------------------
Evil progresses when good people do nothing! --- SH3D 7.1 and nothing else - W11 64b in 4K
Joined: May 24, 2017
Post Count: 3
Status:
Offline
Re: importing mtl file
Hi, thanks for your reply.
I transformed every tif to jpg but still the same problem that colors are not imported. I now tried several files and I am confused because for some the colors are imported and for some they are not. But I can not figure out what the difference between these files are.
Is there anything I should pay attention to when downloading files?
Joined: May 12, 2013
Post Count: 1545
Status:
Offline
Re: importing mtl file
No wavefront expert, but in the few lines of .obj file you quote, there is no usemtl (material name) which I believe is the link between the group in the .obj file and corresponding material in the .mtl file.
Western Europa
Joined: Mar 29, 2014
Post Count: 2614
Status:
Offline
Re: importing mtl file
Hi, thanks for your reply. I transformed every tif to jpg but still the same problem that colors are not imported. I now tried several files and I am confused because for some the colors are imported and for some they are not. But I can not figure out what the difference between these files are. Is there anything I should pay attention to when downloading files?
The beginning of the 'object.obj' is like this : # # Generated by Sweet Home 3D - ven. mai 19 15:08:29 CEST 2017 # http://www.sweethome3d.com/ # mtllib object.mtl g cylinder_1 usemtl cylinder v 0.0000004 240.00002 -15.000001 ...
The beginning of the 'object.mtl' is like this : # # Generated by Sweet Home 3D - ven. mai 19 15:08:29 CEST 2017 # http://www.sweethome3d.com/ #
newmtl cylinder illum 1 Ka 0.2 0.2 0.2 Kd 1.0 1.0 1.0 Ks 0.0 0.0 0.0 Ns 1.0 map_Kd object_cylinder.jpeg
The name of the used texture is : object_cylinder.jpeg (or jpg)
----------------------------------------
Evil progresses when good people do nothing! --- SH3D 7.1 and nothing else - W11 64b in 4K
Western Europa
Joined: Mar 29, 2014
Post Count: 2614
Status:
Offline
Re: importing mtl file
I checked the files again and the "usemtl ROOTS2" is included. I also changed the path to the new jpg-files in the mtl-file. Still not working. But anyway thank you so much for your help and tips
Hi,
Very Strange !
Can you put the file to us download it ?
----------------------------------------
Evil progresses when good people do nothing! --- SH3D 7.1 and nothing else - W11 64b in 4K