Importing .obj models

I've been learning Daz Studio for about a month now. I've had some previous experience with Blender, so I know some of the basics about models.

I've downloaded a model of a room interior. The download folder includes an .obj file, which I imported into Daz Studio with no problem. But there are no textures on the surfaces.

The download folder also includes a .mtl, and a "maps" folder full of .tga files. 

So finally, my question: How do I apply the textures to the sufaces in Daz Studio?

Comments

  • The maps should be assigned by the .mtl file, at least the ones that go to basic properties, but the format is a bit variable and not every .mtl file will work. You can apply maps through the Surfaces pane - select the prop, go to the Editor tab of Surfaces, and you can select each surface (or more than one, or the whole model) and either click the little button to the left of the property you wish to map and select Browse or drag the image from a file window onto the slider. The model will need to be UV mapped, projection methods don't work (without a custom shader).

  • lilweeplilweep Posts: 2,550

    Basically

    1. go to surface tab

    2. drag .tga maps into relevant property (it should be obvious which maps go where, except for maybe Height maps and roughness maps.  Height i would put into bump, roughness maps i would put into glossy roughness)

     

     

  • BejaymacBejaymac Posts: 1,897

    There are a few things to be aware of when importing OBJ into DS.

    First up is the texture pathways listed in the MTL, if it's something like "map_Kd maps/orange.jpg" then they wont load if you are using "File > Import", the problem is DS needs a "point of reference" before it can find things from pathways, as a result "File > Import" requires an absolute pathway including the drive letter before DS will find it.
    However you can use a relative pathway like "map_Kd maps/orange.jpg" if you create an "Other Formats" content directory, move the OBJ, MTL and maps folder into it, then you can load the OBJ from the Content Library pane in DS. Doing it this way means DS takes it's "point of reference" from the MTL's location, so a relative pathway "should" work.

    Second is the Surface group names in both OBJ and MTL, basically DS has never liked spaces in names/pathways, they are seen as separators or end of the name/pathway. So any surfaces with names like "Material 01, Material 02, Material 03" etc, are going to be seen by DS as one surface called "Material", which will stop any textures from being loaded.
    Remedy for this is to edit the OBJ and MTL in a half decent text editor, and either remove the spaces in the names or replace them with an underscore "_".

    Next, vertical Y axis against vertical Z axis, swapping axis is a good way to mirror a mesh, it's UV's and flip it's normals, with backface lighting on by default and no obvious "handing" on the mesh it's not a surprise most get caught out by this.

  • AscaniaAscania Posts: 1,855
    Bejaymac said:
    First up is the texture pathways listed in the MTL, if it's something like "map_Kd maps/orange.jpg" then they wont load if you are using "File > Import", the problem is DS needs a "point of reference" before it can find things from pathways, as a result "File > Import" requires an absolute pathway including the drive letter before DS will find it.

    If the texture resides in the same directory as the obj I've got mo problem with it automatically applying.

  • SpottedKittySpottedKitty Posts: 7,232
    edited October 2020

    Another gotcha is that the .obj file has a pointer to the .mtl file in the first non-comment line. Some programs that can export an .obj will create this line as an absolute folder path to the .mtl file, even if both .obj and .mtl are created in the same folder. So if you copy all the .obj and related files into a location in your D|S content folder, that breaks the link and the .mtl file becomes unfindable. One more thing that needs to be checked for and fixed if necessary.

    And of course, the .mtl file path/name have the same "no spaces allowed" restriction noted upthread.

    Edit: and don't forget that the .obj file format is ancient in computer terms; I think it's even older than Poser 4, which is the ultimate basic bog-standard of materials settings. Iray is very not-ancient; it includes a lot of parameters and setting options that just plain don't exist in .obj — so even when the .mtl read and texture load works perfectly, you might still have a fair amount of manual poking and prodding to do in the D|S Surfaces pane.

    Post edited by SpottedKitty on
Sign In or Register to comment.