Is it possible to load an .obj file with the .mtl to get all textures to autoload?

Hi!

I have downloaded a model in .obj format, and with it came an .mtl file.
Also a folder containing all textures (It’s a building with lots of textures).

Is there a way to load all textures at once for the model in Blender?
So far the only way I know is to add each texture individually, for each surface, which takes allot of time =/ ^^

I haven’t been able to figure this out on my own, so I could use some help if anyone knows how this works, or if it’s possible?

I would appreciate the help (=
/Cheers!

Generally should work…
… but not every .obj is exported in such way.

Where from & how is it exported?
How are you importing it (settings, engine…)?
Have you looked into .mtl + .obj – sample would be more than welcome.

1 Like

As far as i know, textures must be defined inside .mtl file. Then importing .obj will automatically detect it. Example:
image

Check this for more info: MTL material format (Lightwave, OBJ)

I’m not sure but I’m afraid you’ll need to reapply textures one by one in Blender (or inside .mtl).

1 Like

I do this quite often. As long as the mtl file has the images defined (as fibilis said), and the images are in the correct place (folder structure), then when importing the obj, make sure that the Image Search text box is checked.
Blender will import all images and assign them to the correct places. Note that the automatic material generation is a bit shit (basic, but good enough), so you will have to modify the nodes.

1 Like

Hi!

Thanks for all the replies!! (=

And thanks @filibis and @burnin for the example (=
It helped me notice that the all the textures in this case were converted to .png files, but still were registered as .dds format in the .mtl file.
I renamed all .dds instances to .png and changed the path to the current path of the folder where I keep the model and textures.
Now when I create nodes, it finds the texture-files directly in the list! ^^

File names;
HP Tall Building 05.obj
HP Tall Building 05.mtl

My Blender OBJ Import Settings;
OBJ%20Import%20Settings

The original path for the textures in the .mtl file look like this:

map_Ka C:\Users\NexusIX\Documents\HPBuilding013D\Textures\rooftopbricks05.dds

This is an example of what folder path I keep for the model;

E:\Misc. 3D Buildings\OBJ-Formats\HPBuilding05
And the the textures
E:\Misc. 3D Buildings\OBJ-Formats\HPBuilding05\Textures

In the .mtl-file I changed the path to;

map_Ka E:\Misc. 3D Buildings\OBJ-Formats\HPBuilding05\Textures\rooftopbricks05.png

Is there a way to write the folder path so it takes the textures from the folder ‘\Textures’ regardless of where it’s base folder '\HPBuilding05' is?

(That is, if I can skip this part ‘E:\Misc. 3D Buildings\OBJ-Formats’.)

Blender finds the textures now anyway, so that’s an improvement, and I’ve assigned all of them to this model (about 30 images), though I have other models with allot more textures! ^^
But if I understand it right, I have to re-assign them individually using nodes?

Though I was hoping for a way to load an .mtl file so that blender creates the nodes automatically ^^

/Cheers!

Yes, just put texture name, so it searches current folder or subfolders:

map_Kd rooftopbricks05.png

Also note that you probably need “map_Kd” for diffuse map instead of “map_Ka”. Take a look at link i shared again.

1 Like

Thanks!

I haven’t read the linked text yet, but it looks like it really goes through everything ^^