Features

Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Help  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 9
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 3528 times and has 8 replies Next Thread
marianooshiro
Newbie



Argentina
Joined: Apr 24, 2017
Post Count: 1
Status: Offline
Reply to this Post  Reply with Quote 
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.

¿can anybody help me?
[May 9, 2017 12:21:54 PM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 5837
Status: Offline
Reply to this Post  Reply with Quote 
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 developer
[May 10, 2017 8:25:20 AM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest    http://www.eteks.com [Link] Report threatening or abusive post: please login first  Go to top 
dani191234
Newbie




Joined: May 24, 2017
Post Count: 3
Status: Offline
Reply to this Post  Reply with Quote 
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


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.
[May 24, 2017 7:09:06 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
bdfd
Advanced Member
Member's Avatar

FRANCE
Joined: Mar 29, 2014
Post Count: 1472
Status: Offline
Reply to this Post  Reply with Quote 
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:
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.
Hi,

I think that tif format is the problem.
Try to transform them in jpg and try again.

smile
----------------------------------------
with W10 64b 1709 (16.299.125) / Core i7-4790 - RAM 16 MB / GeForce GTX770 2 Go Full HD
sh3d 5.6 with java 1.8.0_144 & java3D 1.6.0
[May 25, 2017 6:10:58 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
dani191234
Newbie




Joined: May 24, 2017
Post Count: 3
Status: Offline
Reply to this Post  Reply with Quote 
confused 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?
[May 25, 2017 1:42:03 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
okh
Advanced Member




Joined: May 12, 2013
Post Count: 1287
Status: Offline
Reply to this Post  Reply with Quote 
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.

https://en.wikipedia.org/wiki/Wavefront_.obj_file#Referencing_materials

Could that be the reason?

ok
[May 25, 2017 1:55:30 PM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
bdfd
Advanced Member
Member's Avatar

FRANCE
Joined: Mar 29, 2014
Post Count: 1472
Status: Offline
Reply to this Post  Reply with Quote 
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?
Hi,

@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)

smile
----------------------------------------
with W10 64b 1709 (16.299.125) / Core i7-4790 - RAM 16 MB / GeForce GTX770 2 Go Full HD
sh3d 5.6 with java 1.8.0_144 & java3D 1.6.0
[May 25, 2017 3:45:03 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
dani191234
Newbie




Joined: May 24, 2017
Post Count: 3
Status: Offline
Reply to this Post  Reply with Quote 
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 biggrin
[May 26, 2017 8:23:31 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
bdfd
Advanced Member
Member's Avatar

FRANCE
Joined: Mar 29, 2014
Post Count: 1472
Status: Offline
Reply to this Post  Reply with Quote 
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 biggrin
Hi,

Very Strange ! sad

Can you put the file to us download it ?

smile
----------------------------------------
with W10 64b 1709 (16.299.125) / Core i7-4790 - RAM 16 MB / GeForce GTX770 2 Go Full HD
sh3d 5.6 with java 1.8.0_144 & java3D 1.6.0
[May 27, 2017 6:06:50 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2017 eTeks - All rights reserved