Help Importing .obj's

I'm very confused about how to import .obj files.  Many people talk about all of the great assets you can get on these third-party websites by importing .obj's.  I am running up against brick walls here.

I've spent some time on the internet looking for instructions on how to do this.  Some responses say you just import the .obj file and voila, it's ready to go.  I have yet to see an .obj file imported with the textures attached.  Everything imports gray.

I saw one response that said you have to open up the textures folder that will come with the .obj and assign each texture to its corresponding surface in Daz.  After I read that, the next few .obj's I imported only had a single surface, despite having multiple texture files.

Then I imported one that had multiple surfaces, but the texture folder only had one file.

Then there have been a couple of .obj's I've imported that simply imported a white shape with no surfaces.

I've read that somehow an .mtl file, if the download has one, will tell the textures where to go when it gets imported.  I've downloaded some .mtl files and there's no magic happening.

I don't have a million dollars to give you, but if anybody can explain this to me like I'm five-years-old, you'll have my thanks.

Comments

  • GordigGordig Posts: 10,049

    Some work will need to be done with an imported OBJ, even in other programs. You're definitely at the mercy of whoever made the OBJ in terms of the UV mapping, surfaces and texture types included. You can often get diffuse texture maps to import, but any bump, normal, specular etc. will have to be added manually. The OBJ you imported that had multiple surfaces but only one texture file was probably UV mapped in such a way that different UV islands just drew from different parts of the texture, rather than giving each surface its own texture, which is more common than you might think. I'd advise getting Map Master Pro if you intend to do a lot of this, as it really speeds up the process of loading all your maps.

  • FSMCDesignsFSMCDesigns Posts: 12,754

    To add to what Gordig said, the way an OBJ comes to you is entirely dependent on how it was exported and from what app.This can determine if the material zones and UV mapping get screwed up which will cause any texture maps to not display correctly As you have found, the importing part is the easy part, setting up the materials and textures is not in most cases.

    Another thing to keep in mind, depending where the OBJ came from, the 3d assets at DAZ are setup in a way to work with DS and 3D assets from games or other apps are setup to work there, so many times the way things are designed and setup will be different from how they are at DAZ. For instance, a game model needs to be optimized to use as few resources as possible and as such will have less textures and usually not as detailed as a DAZ model

    Also be wary of where you get these free 3D OBJs from. there are a lot of free 3d sites, but many are not legit and host plenty of stolen or ripped items from places like DAZ and games

  • SpaciousSpacious Posts: 481
    edited March 2022

    When I download random stuff from random 3D sites I usually try to download as many different file types (obj, fbx, dae, etc...) as I can.  The reason for this is because I've found that usually one of them will have all the maps I need, one of them will import geometry into Daz correctly,  one of them might even have rigging that works in Daz, one of them will be a waste of time and space, etc...  It seems there's no way to know which one will work best for what, other than OBJ will import well with limited maps and have no rigging.  Often I import them into Blender first and then export from there as Obj.  Sometimes you just need to edit the MTL file that's attached to an OBJ to reflect where the textures are actually located, and if there's a lot of surface zones then this is totally worth it.  Also depending on what it's a model of, and where it came from, it may not even have UV mapping.  Sometimes you can just texture stuff with the shaders built into Daz or whatever other shaders you have installed.

    Post edited by Spacious on
  • FSMCDesignsFSMCDesigns Posts: 12,754

    Spacious said:

    When I download random stuff from random 3D sites I usually try to download as many different file types (obj, fbx, dae, etc...) as I can.  The reason for this is because I've found that usually one of them will have all the maps I need, one of them will import geometry into Daz correctly,  one of them might even have rigging that works in Daz, one of them will be a waste of time and space, etc...  It seems there's no way to know which one will work best for what, other than OBJ will import well with limited maps and have no rigging.  Often I import them into Blender first and then export from there as Obj.  Sometimes you just need to edit the MTL file that's attached to an OBJ to reflect where the textures are actually located, and if there's a lot of surface zones then this is totally worth it.  Also depending on what it's a model of, and where it came from, it may not even have UV mapping.  Sometimes you can just texture stuff with the shaders built into Daz or whatever other shaders you have installed.

    My experience also. the other day, I downloaded an Oshkosh M-ATV from this car site http://www.dmi-3d.net/ It looked detailed and had 3 format options, OBJ, 3DS, ad LWO. So I tried the OBJ option first and found no textures for the body and the readme said they were in the LWO zip, so tried the other options and still no textures for the body. So I loaded it up in ultimate unwrap 3D and found only the OBJ and 3DS formats had UV mapping. It's an amazingly detailed model at almost 300K of polys, but without maps, it's useless for me.

  • BejaymacBejaymac Posts: 1,886

    The DS WaveFront Importer has always been touchy when dealing with OBJ/MTL from other programs.

    It's never been "Plug & Play", as a result you need to have a pretty good idea what sort of mess the exporting program has made of the OBJ/MTL, before you'll ever get it into DS.
    You also need to know all of the issues DS has as well.

    Lets look at the issues DS has
    A very,very old issue is that DS hates spaces in names, so spaces in file names, surface name and pathways, can all cause major issues during import, DS sees spaces as the end of the line, so surfaces called Material 01, Material 02, Material 03 are all seen as Material by DS.

    Using File > Import to load an OBJ means that the texture pathways in the MTL need to be the full pathway including drive letter, otherwise DS will never find them.

    Creating an "Other Formats" content directory is usually the best way to import, as you can do it from inside the Content Library tab, but this also has "pathway" issues. Where ever the MTL is located is where DS starts looking for the textures, so an MTL that doesn't have pathways in it means you want the textures in the same folder as the MTL.

    Now for the issues from other programs.

    Main one is that DS uses the computer world 2D system to calculate where the mesh goes on screen, yes I said 2D, the dimensions of the pixels on your monitor, side to side is X axis, top to bottom is Y axis, there is no Z axis on a pixel. Many of the modeling programs are designed to make stuff for the real world, so they change things so that top to bottom on your monitor is now Z axis in the program.

    This causes issues during import, the import presets can load it face down, face up, back to front, upside down or mirrored, those last three also usually means the mesh is inside out and you got a mesh full of flipped normals.
    A simple example of this is a car model, steering wheel is on the left in all of the promo images, but in DS it's on the right and the license plate is backwards, in this case the mesh and UVs have been mirrored.

    Lets take this Oshkosh M-ATV that Michael is having issues with, a space in both file names, and if you open the OBJ in a text editor you will find the mtllib line also has a space in the name of the MTL, replace those spaces with underscores "_" to fix that issue. Next is the pathways in the MTL, or rather lack of pathways, this means File > Import is never going to find them. Most of the Import presets load it in with the headlights pointing straight down, Max, C4D and Blender all load it with the headlights pointing out the back of the scene. But they also load in jet black for me as I have backface lighting turned off, which means the mesh is inside out/mirrored, which in this case just required setting Z scale (parameters tab) to -100%.

    Wouldn't use it like that though, best to Export it with the DS preset to lock the changes.

    Oh and BTW, it only has a couple of textures, light clusters and the instrument panel, the rest is flat diffuse colors, it is UV mapped so shaders should help.

  • Richard HaseltineRichard Haseltine Posts: 100,765
    edited March 2022

    Bejaymac said:

    The DS WaveFront Importer has always been touchy when dealing with OBJ/MTL from other programs.

    It's never been "Plug & Play", as a result you need to have a pretty good idea what sort of mess the exporting program has made of the OBJ/MTL, before you'll ever get it into DS.
    You also need to know all of the issues DS has as well.

    Lets look at the issues DS has
    A very,very old issue is that DS hates spaces in names, so spaces in file names, surface name and pathways, can all cause major issues during import, DS sees spaces as the end of the line, so surfaces called Material 01, Material 02, Material 03 are all seen as Material by DS.

    This is formally correct, as far as I am aware - it's just that other applciations don't always respect it.

    Using File > Import to load an OBJ means that the texture pathways in the MTL need to be the full pathway including drive letter, otherwise DS will never find them.

    Not entirely true, as I recall

    Creating an "Other Formats" content directory is usually the best way to import, as you can do it from inside the Content Library tab, but this also has "pathway" issues. Where ever the MTL is located is where DS starts looking for the textures, so an MTL that doesn't have pathways in it means you want the textures in the same folder as the MTL.

    Now for the issues from other programs.

    Main one is that DS uses the computer world 2D system to calculate where the mesh goes on screen, yes I said 2D, the dimensions of the pixels on your monitor, side to side is X axis, top to bottom is Y axis, there is no Z axis on a pixel. Many of the modeling programs are designed to make stuff for the real world, so they change things so that top to bottom on your monitor is now Z axis in the program.

    There are two 3D axis systems - left-handed and right handed (Z up and Z forward). A lot of applications, like DS, use Z forward (Zbrush, 3D Coat, Lightwave, hexagon, Modo) but others (Blender, 3D Studio Max) use Z up.

    This causes issues during import, the import presets can load it face down, face up, back to front, upside down or mirrored, those last three also usually means the mesh is inside out and you got a mesh full of flipped normals.
    A simple example of this is a car model, steering wheel is on the left in all of the promo images, but in DS it's on the right and the license plate is backwards, in this case the mesh and UVs have been mirrored.

    Lets take this Oshkosh M-ATV that Michael is having issues with, a space in both file names, and if you open the OBJ in a text editor you will find the mtllib line also has a space in the name of the MTL, replace those spaces with underscores "_" to fix that issue. Next is the pathways in the MTL, or rather lack of pathways, this means File > Import is never going to find them. Most of the Import presets load it in with the headlights pointing straight down, Max, C4D and Blender all load it with the headlights pointing out the back of the scene. But they also load in jet black for me as I have backface lighting turned off, which means the mesh is inside out/mirrored, which in this case just required setting Z scale (parameters tab) to -100%.

    Wouldn't use it like that though, best to Export it with the DS preset to lock the changes.

    Oh and BTW, it only has a couple of textures, light clusters and the instrument panel, the rest is flat diffuse colors, it is UV mapped so shaders should help.

    Post edited by Richard Haseltine on
  • Thank you for all of these responses.  These are very helpful.

Sign In or Register to comment.