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.
¿can anybody help me?
importing mtl file
This topic has been viewed 11028 times and has 8 replies
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
-
dani191234
- Posts: 3
- Joined: Wed May 24, 2017 6:17 pm
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.
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
and here is my mtl-file:
newmtl ROOTS2
Ka 0.1 0.1 0.1
Kd 1 1 1
Ks 0 0 0
illum 2
Ns 2
map_Kd OC12brk2.tif
map_bump
bump
map_opacity
map_d
refl
map_kS
map_kA
map_Ns
newmtl TRUNK2
Ka 0.1 0.1 0.1
Kd 1 1 1
Ks 0 0 0
illum 2
Ns 2
map_Kd OC12brk2.tif
map_bump
bump
map_opacity
map_d
refl
map_kS
map_kA
map_Ns
newmtl BARK2
Ka 0.1 0.1 0.1
Kd 1 1 1
Ks 0 0 0
illum 2
Ns 2
map_Kd OC12brk2.tif
map_bump
bump
map_opacity
map_d
refl
map_kS
map_kA
map_Ns
newmtl TWIG2
Ka 0.1 0.1 0.1
Kd 1 1 1
Ks 0 0 0
illum 2
Ns 2
map_Kd OC12brk2.tif
map_bump
bump
map_opacity
map_d
refl
map_kS
map_kA
map_Ns
newmtl LEAF2
Ka 0.1 0.1 0.1
Kd 1 1 1
Ks 0 0 0
illum 2
Ns 2
map_Kd OC12lef2.tif
map_bump
bump
map_opacity
map_d
refl
map_kS
map_kA
map_Ns
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.
- bdfd
- Posts: 2614
- Joined: Sat Mar 29, 2014 7:17 am
- Country: LILLE, Les Hauts de France, Western Europa
Re: importing mtl file
Hi,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:newmtl ROOTS2
Ka 0.1 0.1 0.1
Kd 1 1 1
Ks 0 0 0
illum 2
Ns 2
map_Kd OC12brk2.tif
map_bump
...
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.
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
---
SH3D 7.1 and nothing else - W11 64b in 4K
-
dani191234
- Posts: 3
- Joined: Wed May 24, 2017 6:17 pm
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?
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?
Re: importing mtl file
No wavefront expert, but in the few lines of .obj file you quote, there is no [font=courier new]usemtl (material name)[/font] which I believe is the link between the group in the .obj file and corresponding material in the .mtl file.
https://en.wikipedia.org/wiki/Wavefront ... _materials
Could that be the reason?
ok
https://en.wikipedia.org/wiki/Wavefront ... _materials
Could that be the reason?
ok
- bdfd
- Posts: 2614
- Joined: Sat Mar 29, 2014 7:17 am
- Country: LILLE, Les Hauts de France, Western Europa
Re: importing mtl file
Hi,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?
@okh, well seen !
Here is an example :
Name of the object = object
The zipped package contains 3 objects (made recently) :
object.mtl
object.obj
object_cylinder.jpeg
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
---
SH3D 7.1 and nothing else - W11 64b in 4K
-
dani191234
- Posts: 3
- Joined: Wed May 24, 2017 6:17 pm
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 [:D]
Still not working.
But anyway thank you so much for your help and tips [:D]
- bdfd
- Posts: 2614
- Joined: Sat Mar 29, 2014 7:17 am
- Country: LILLE, Les Hauts de France, Western Europa
Re: importing mtl file
Hi,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 [:D]
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
---
SH3D 7.1 and nothing else - W11 64b in 4K
Who is online
Users browsing this forum: No registered users and 2 guests