|
Sweet Home 3D Forum » List all forums » » Forum: 3D models and textures » » » Thread: Textures not importing » » » » Post: Re: Textures not importing |
Print at Dec 21, 2025, 6:37:24 AM |
| Posted by Keet at Jun 16, 2023, 8:38:44 AM |
|
Re: Textures not importing To understand the relation between obj, mtl, and texture images: Usually the obj and mtl file have the same filename with the extensions .obj and .mtl. Possible cause for not seeing material: the mtl file is missing. The obj file has a line close to the top "mtllib filename.mtl". This means that it has to use the file "filename.mtl" for material references. Possible cause for not seeing material: the reference to the mtl file is wrong. The mtl file has one or more sections "newmtl materialname" where each section has a unique material name. After the line "newmtl" the material and it's properties are described. Sections are separated by a empty line so it's easy to see the sections. Possible cause for not seeing material: the mtl file formatting is wrong. Very unlikely but still a possibility. In the obj file you will see lines "usemtl materialname". That means that from that point on the described surfaces (faces) will use that referenced material name. Possible cause for not seeing material: the material named in the obj file doesn't exist in the mtl file. Note that the material names between the obj and mtl file are case-sensitive which means that "MaterialName" and "materialname" are references to different materials. The section newmtl in the mtl file can contain a line starting with "map_Kd " followed by a path and file name to a texture image file. Usually there is no path and just a filename which indicate the texture images should be in the same folder as the obj and mtl file. Possible cause for not seeing a texture: the referenced texture image doesn't exist, is named differently, has an invalid image format, or has a wrong path. If Sweethome3D shows a single material "default" after import this means that it couldn't find the references to the material for one of the above mentioned reasons. If you imported an obj file not generated by Sweethome3D you can export it from Sweethome3D and then look at the obj and mtl files. Sweethome3D creates a very clean format where each group ("g ..." line in the obj file) is followed by the "usemtl ..." line. That way you can easily see which group uses what material. This doesn't always work because not every third party software creates clean obj files. Since both obj and mtl files are plain text files you can correct errors you find with a simple text editor. Don't use MSWord or LibreOffice Writer, just a simple text editor. ---------------------------------------- Dodecagon.nl 1300+ 3D models, manuals, and projects |
|
|
Current timezone is GMT Dec 21, 2025, 6:37:24 AM |