OBJ/MTL import to Daz Studio - revisted question

nowefgnowefg Posts: 557
edited December 1969 in The Commons

I've been looking at forum entries on obj/mtl import to Daz Studio (4.5.1.56) and have an entry level confusion about it.

ShareCG has lots of interesting looking obj/mtl models, and I've tried importing a few of them, but the only option I see on Import is

Wavefront OBJ. Loading that, I get that, a Wavefront obj, no textures, just the gray model.

These obj's have mtl files in the same folder, and sometimes, but not always, texture jpgs or pngs.

How do these textures get moved in on import?

If I can't get the textures to auto-apply on obj's, is there any way to add my own textures to an obj? Tried Khory's Design Flooring and Wall

textures, which I use a lot. Surfaces Selection Tool does select and highlight a given area on the obj, but nothing applies.

Not having modeling software, obj's seemed like a good next recourse. But how does one texture them? These obj's have nice textures in

the ShareCG images, and I'd just as soon be able to use them, but whatever's gonna work.

Comments

  • BejaymacBejaymac Posts: 1,911
    edited December 1969

    As long as the MTL is the same name as the OBJ and is in the same folder, then DS will import the MTL at the same time it's importing the OBJ. The problem of textures not importing from the MTL is usually a path issue, DS needs the full pathway (including the drive letter) to be in the MTL before it will find them.

  • McGyverMcGyver Posts: 7,075
    edited December 1969

    When you say "but not always, texture jpgs or pngs." You mean "not always in the same folder"... The "texture jpgs or pngs" is confusing me... if the texture images are not in the same folder, it probably won't work... The .mtl file carries the pathway to the texture...
    An example of one of my MTLs:

    # Blender MTL File: ''
    # Material Count: 2
    newmtl ID3
    Ns 96.078431
    Ka 0.000000 0.000000 0.000000
    Kd 0.640000 0.640000 0.640000
    Ks 0.500000 0.500000 0.500000
    Ni 1.000000
    d 1.000000
    illum 2
    map_Kd Users/vic/Desktop/Catwalk-CenterRods_Hanger/M1813M_Galvanized_VT.jpg


    The part at the bottom: "Users/vic/Desktop/Catwalk-CenterRods_Hanger/M1813M_Galvanized_VT.jpg" shows the program where to find "M1813M_Galvanized_VT.jpg" in the model...

    Usually I open OBJs only in Poser, turn the model into a PP2 and then use it in DS... But as far as I remember, DAZ never really balked at opening an OBJ as long as the OBJ, The MTL AND The Texture are all in the same folder.... Same as Poser.
    If something is screwed up in the OBJ code or in the MTL, you get blank gray models.

    Could you send a link to a model you had a problem with? I'm curious.

  • TotteTotte Posts: 14,257
    edited May 2013

    nowefg said:
    I've been looking at forum entries on obj/mtl import to Daz Studio (4.5.1.56) and have an entry level confusion about it.

    ShareCG has lots of interesting looking obj/mtl models, and I've tried importing a few of them, but the only option I see on Import is

    Wavefront OBJ. Loading that, I get that, a Wavefront obj, no textures, just the gray model.

    These obj's have mtl files in the same folder, and sometimes, but not always, texture jpgs or pngs.

    How do these textures get moved in on import?

    If I can't get the textures to auto-apply on obj's, is there any way to add my own textures to an obj? Tried Khory's Design Flooring and Wall

    textures, which I use a lot. Surfaces Selection Tool does select and highlight a given area on the obj, but nothing applies.

    Not having modeling software, obj's seemed like a good next recourse. But how does one texture them? These obj's have nice textures in

    the ShareCG images, and I'd just as soon be able to use them, but whatever's gonna work.

    A couple of things to consider:

    (a) the .mtl file will give a path to the textures, sometimes the obj should be in the same directory as the textures, sometimes the textures are in a sub directory. You can open the .mtl file and check not the filename is given, plain, or with a path.

    (b) Sometimes it's faster to set the materials on the grey .obj using the surface tab, as you might need to tweak bumps and sometimes bumps are not even set in the .mtl files so you need to add those yourself, setting up the params.

    While I was typing and answering the phone, you got two other similar answers.

    Post edited by Totte on
  • KatteyKattey Posts: 2,899
    edited December 1969

    And sometimes those objs aren't UV mapped, so you can only use procedural materials (from within DS, Bryce, Poser, Maya etc) with them. Promotional pictures might have that sort of shader applied but the model itself would be devoid of it. Is there a specific model you are interested in? I can check for you.

  • nowefgnowefg Posts: 557
    edited May 2013

    Okay. Thanks, everyone.

    Now that I know the mtl info should load with the obj, no explicit action required on my part,
    I can guess that if no texture loads, maybe that's because no texture got downloaded with the obj/mtl.

    That's what I meant by "sometimes but not always." I have several models that show as textured on the download page at ShareCG, but
    they download with only obj/mtl, no additional texture files. I'll have a look at these mtl's.

    There are some that do contain additional texture files, same folder, which don't load either; that's where my confusion arose from. A look into those mtl's will help, I'm sure.

    On Surfaces tab adjustments, I did find that some obj's just won't take a texture at all; more confusion. Does that mean the model isn't UV mapped? Is there a way in Studio for me to create a UV map?

    I am getting into this OBJ business; a lot of great, detailed models out there. Lots to learn, too. I appreciate all your help.

    Also, thanks, Kattey; you anticipated my question while i was composing a reply.

    Also, also... I don't have access to those files just now, but I'll post a couple tomorrow, for your review.

    Post edited by nowefg on
  • KatteyKattey Posts: 2,899
    edited May 2013

    In DS there is no way to create UV maps (but you can create procedural shaders with Shader Mixer). What you can try to do is to download UV Layout demo
    http://www.uvlayout.com/index.php?option=com_wrapper&Itemid=72
    and run it in Demo mode (it should allow saving, while other two trial modes won't allow it).
    Try to see if you can UV map it. UV Layout has tutorial videos on site, and it is pretty easy to use once you understand the main idea.
    http://www.uvlayout.com/index.php?option=com_wrapper&Itemid=67

    And if files are on ShareCG, I can download them myself and check, just tell me the name.

    Post edited by Kattey on
  • DavidGBDavidGB Posts: 565
    edited December 1969

    Just a quick note on the two issues I normally find when importing objs with mtls:

    1 As mentioned above, the mtl should contain paths to the textures, which often don't match where the textures are on my machine. In this case, I do some search/replace functions in a text editor to correct the references.

    2 Even when the texture paths are correct (already, or after my search/replace), they may contain spaces, E.g. there may be a path like F:\POSER STUFF\Car meshes\.... or a filename like 'floor panel.jpg'. If there are spaces in the path or filenames in the .mtl, DS won't load them UNLESS you put double quotes round the whole file reference (and I haven't used any obj producing software that does put the quotes in). So if a texture reference in the .mtl is otherwise correct but is just F:\POSER STUFF\Car meshes\floor panel.jpg it won't be loaded, but if it's "F:\POSER STUFF\Car meshes\floor panel.jpg" then it will load. (With a decent text editor, even with a .mtl file referencing a lot of textures without quotes, it's quick to e.g. do a search and replace all on F:\ to "F:\ and .jpg to .jpg".)

    Oh, and 3 - sometimes objs with mtls and texture files created by other software produced with other target software than DS or Poser in mind may have the texture files in formats other than those DS or Poser supports. For instance, if you use NifScope to load Bridge Commander Star Trek ships and Bridges and export as objs, you have nice objs with mtl files for use in DS or Poser except that the textures are mostly .tga files which neither DS nor Poser support. So importing the obj into DS or Poser comes in untextured. In that case doing a batch convert of the tgas to jpg in something like (free) Irfanview, followed by loading the .mtl file into a text editor and doing two search-and-replace-alls, one to add the preceding quote mark for each texture reference, the other to replace .tga with .jpg" is called for, but very quick to do.

  • Miss BMiss B Posts: 3,071
    edited May 2013

    Kattey said:
    And sometimes those objs aren't UV mapped, so you can only use procedural materials (from within DS, Bryce, Poser, Maya etc) with them.

    This is exactly the issue I've just come across with a purchase I made at Renderosity last year, but hadn't gotten around to playing with until this week. I believe it was originally set up for Vue (there are .vob and .vue scene files), but there's also an .obj and a .3ds file for use in other 3D apps.

    I opened the OBJ in Carrara and created the UV map (mostly because Blender kept freezing up). I then opened the UV map in UV Mapper Pro and separated out each of the material zones into separate maps so I could texture them. Unfortunately, that's not coming out quite the way I want, because there's nothing in the ReadMe file that indicates which of the included textures were used where, so now I play trial and error until I find the textures that look like the main promo on the product page. ~sigh~

    I may have to site mail the vendor to see if she can help by at least giving me an idea which textures she used where, because the MTL file has no paths to the textures, just the material zone names and coords. I can understand a freebie OBJ you get at shareCG or some other similar site not being UV mapped, but a product sold at one of the big 3 sites? I find that unusual. That said, of course, I use Blender most of the time for modeling, and I can just "project" textures onto a model without actually UV mapping it, but that only works if I do the final rendering in Blender, not if I want to use the object in Poser, DS, Bryce or elsewhere. ~shakes head~

    Post edited by Miss B on
  • McGyverMcGyver Posts: 7,075
    edited May 2013

    I got you now nowefg... Now I think I know what the problem is... If I remember correctly, sometimes in the past I have come across models at SCG, where there was ONLY a OBJ and MTL file.
    Most likely (since you say that the material zones are still preserved-as evidenced by relevant surfaces highlighting in DS), what probably happened was model was textured in shaders that only exist or make sense for the particular modeling program where they were created... although it is odd that at least the diffuse color was not preserved... usually for example if say in Maya the model had a really cool procedural rust shader, it might export out as just brown or orange... Even more likely these models were assigned tiling Jpegs or Pngs (seamless image based textures), in which case if the person did not check the correct export option, the image files would be excluded. It is also entirely possible (depends on the model, so this is just a guess, but it is a common occurrence) the model may have been created in one program, exported as say a .3ds or .lwo and the imported into another program like Blender, and then exported out as an .obj file... Sometimes people convert someone else's models, but don't really know what they are doing, so they screw it up.
    Quite often people take models from 3D Warehouse which are SketchUp files and export them out as OBJs... problem is if they are doing this in SketchUp and are not using the newer OBJ exporter plugins, they don't export any materials... the model just comes out grey, sometime with the mat zones preserved, but not even a diffuse color... just plain default preview grey. This is especially prevalent when the model is textured ONLY using seamless image based textures... if the jpeg texture is not exported then there is no diffuse data provided and the default gray is shown.

    Post edited by McGyver on
  • nowefgnowefg Posts: 557
    edited May 2013

    Thank you.

    Kattey, I download obj's at least several at a time, and spend a confusing hour or so trying them; there are dozens, so I don't have a name till I get home and check the unzipped downloads. I'll post some tomorrow. Thank you for offering to check them out.

    DavidGB, very helpful. I have and use Irfanview all the time, but hadn't thought to use it to convert formats for textures.

    Miss B, yeah, this is part of the whole question for me, too. I got some great trees on Rendo, because they're obj's, but also come with vob format, and load as obj files with a MAT surface; leaves, stems, branches, trunk, MAT.

    I don't know what that last is, or does, but it looks like a big rectangle hidden in the branches. I just opacity-zeroed it out, called the specific other part textures, converted a displacement map from the diffuse jpg, got info here about using alpha maps, and bingo! Great trees. A lot of hassle, but it works.

    I've been looking at another model lately, a building, prop, and scene that comes with lots of textures for the various parts, but only a single obj. I'm hesitating because I don't know enough to know if I'll be able to hide parts, or save or export parts... it's a great model that I like as much for the props as for the building.

    I've been figuring that if it has separate textures for parts, like beams, walls, windows, then there must be those parts, at least as surfaces. If I can select them as surfaces, and opacity-zero them to use what's left in a scene, I assume the whole obj will still be resident in memory; a lot of resource use for one small part, like a barrel.

    Ignorance is not bliss. (Thank you LordVicore)

    Post edited by nowefg on
  • nowefgnowefg Posts: 557
    edited December 1969

    Kattey said:
    In DS there is no way to create UV maps (but you can create procedural shaders with Shader Mixer). What you can try to do is to download UV Layout demo
    http://www.uvlayout.com/index.php?option=com_wrapper&Itemid=72
    and run it in Demo mode (it should allow saving, while other two trial modes won't allow it).
    Try to see if you can UV map it. UV Layout has tutorial videos on site, and it is pretty easy to use once you understand the main idea.
    http://www.uvlayout.com/index.php?option=com_wrapper&Itemid=67

    And if files are on ShareCG, I can download them myself and check, just tell me the name.

    One good example of the files that tripped me up is "3 poteries (2)".

    (I couldn't figure how to attach the folder to this post)

    There are quite a few interesting models with the same unzipped file list.

    Armed with the info I'm gathering, here, I can see that it doesn't have texture files for the obj, unless they're buried in the other formats.

    That was my first, (ignorance is not bliss,) premise; that the texture was somehow "hidden" in the specific formats. I don't know how one could access that info, if so. For the straight obj, there's no provision for texturing, regardless of what the mtl may call for. Yes?

    In any event, if possible, can you confirm?

  • KatteyKattey Posts: 2,899
    edited December 1969

    I have 3 poteries (2), I think, and they aren't UV mapped from what I can see.

    For the straight obj, there’s no provision for texturing, regardless of what the mtl may call for. Yes?

    Yes, obj only holds geometry information, surface information (aka material zones, for example if you have pants with belt, it might have a separate material zone for belt and separate for fabric of pants), and UV mapping information if any. In connection with obj all 2D texture information should be supplied in 2D graphic formats (jpg, png, tiffs etc) or be a part of procedural material, made for specific application (Maya, C4D, Poser, DS, Vue, Bryce, etc).
  • jestmartjestmart Posts: 4,449
    edited December 1969

    Some modeling programs may create an .mtl file when exporting simply because of an export option being checked. For instance with Blender3d if the 'Write Materials' isn't checked the model will export with only a single default material zone for the entire model. With it checked you get the material zones but you also create a completely useless and unnecessary .mtl file.

  • DavidGBDavidGB Posts: 565
    edited December 1969

    nowefg said:
    One good example of the files that tripped me up is "3 poteries (2)".

    (I couldn't figure how to attach the folder to this post)

    There are quite a few interesting models with the same unzipped file list.

    Armed with the info I'm gathering, here, I can see that it doesn't have texture files for the obj, unless they're buried in the other formats.

    That was my first, (ignorance is not bliss,) premise; that the texture was somehow "hidden" in the specific formats. I don't know how one could access that info, if so. For the straight obj, there's no provision for texturing, regardless of what the mtl may call for. Yes?

    In any event, if possible, can you confirm?

    Looking at one of that set, no it's not UV mapped for a texture.

    obj and 3DS format files can't 'contain' textures within the file - textures have to be supplied as separate .jpg, .png or whatever files alongside an .obj or .3DS. An .obj file will contain the UV mapping, if any, defining material groups; and the .mtl file will then contain the calls to separate texture files, if any. But the textures themselves are separate, not in the obj or mtl.

    .max format files do actually contain the textures (if any) inside the .max file. And unfortunately nothing but 3DS Max can read .max files, so unless you have 3DS Max, or you can get a trial version (works for one month, then can't have another trial until next new version) or you know someone with 3DS Max who will load the .max file then export as obj or .3DS along with the textures for you, .max files are useless. .3DS, as a format, is like the .obj and .mtl rolled into one - it contains the mesh, grouping, UV mapping (if any) and material settings including calls to separate texture files (if any), but the textures have to be separate, they can't be 'in' the .3DS file.

  • McGyverMcGyver Posts: 7,075
    edited May 2013

    I Googled the "3 poteries" model and found it at ShareCG...

    I then opened up the MTL files in TextEdit(because I'm on a Mac- you can use NotePad on a PC... or any other similar text editing program)
    This is what I see for "dinos":

    # Exported from Wings 3D 1.4.1
    newmtl default
    Ns 100.0
    d 1.0
    illum 2
    Kd 0.7898538076923077 0.8133333333333334 0.6940444444444445
    Ka 0.7898538076923077 0.8133333333333334 0.6940444444444445
    Ks 1.0 1.0 1.0
    Ke 0.0 0.0 0.0

    I highlighted two things.... First in orange you can see where the model was made, in this case "Wings 3D", which in case you are interested happen to be a free modeling program which you can pick up here:
    http://www.wings3d.com/
    The second thing I highlighted is in pink which is "newmtl default". This indicates that the model was never textured as a OBJ... Being that the promo image shows the model rendered in a Bryce environment (and it also comes as a Bryce file), I'm guessing that the person who made the model: Modeled the vase in Wings 3D, exported it out as an OBJ (and 3DS file) imported it into Bryce and applied a terra cotta shader and rendered it in Bryce for the promo.... as is, the OBJ never had a texture applied or was UV mapped.

    None of the other models from that set carry any textures or UV info.

    So just to review

    • OBJ (Wavefront Object File) aka: .obj - This type file carries the vertex coordinate date for the model... the basic geometry that is the model as you see it.

    • MTL (Material Template Library) aka: .mtl - This is the master list of materials for the model, as well as their lighting properties.

    • OBP (Bryce Object Preset) aka .obp - This is a Bryce file that people often confuse for OBJ, it is a native Bryce format, and is used to import models into the Bryce library presets... sort of like Bryce's runtime... sort of. Personally I think it should have been tagged a .bop or BOP (Bryce Object Preset), but that probably was already taken... or not confusing enough... whatever. I thought I'd add this since when I first came across it, I was confused by it... and the model you mentioned includes OBPs.

    • OBZ... Just a compressed obj file. You can decompress it with any of the popular file compression utilities, like 7-Zip, WinZip, WinRAR, etc. 7-Zip is free, and there are several other free alternatives.

    If you want to know if the model is supposed to have textures but they seem to be missing, open the MTL file in notepad and one that should have textures, will look like this:

    # Blender MTL File: ''
    # Material Count: 21
    newmtl ABS_Plastic
    Ns 96.078431
    Ka 0.000000 0.000000 0.000000
    Kd 0.181961 0.181961 0.181961
    Ks 0.500000 0.500000 0.500000
    Ni 1.000000
    d 1.000000
    illum 2


    newmtl SpeakerGrill
    Ns 96.078431
    Ka 0.000000 0.000000 0.000000
    Kd 0.558431 0.564706 0.555294
    Ks 0.500000 0.500000 0.500000
    Ni 1.000000
    d 1.000000
    illum 2


    newmtl X2611L_MiniCam_VT
    Ns 96.078431
    Ka 0.000000 0.000000 0.000000
    Kd 0.640000 0.640000 0.640000
    Ks 0.500000 0.500000 0.500000
    Ni 1.000000
    d 1.000000
    illum 2
    map_Kd /Users/vic/Desktop/!DAE/HD1000_MainHousing/X2611L_MiniCam_VT.jpg

    newmtl X2613L_MiniCam_VT
    Ns 96.078431
    Ka 0.000000 0.000000 0.000000
    Kd 0.640000 0.640000 0.640000
    Ks 0.500000 0.500000 0.500000
    Ni 1.000000
    d 1.000000
    illum 2
    map_Kd /Users/vic/Desktop/!DAE/HD1000_MainHousing/X2613L_MiniCam_VT.jpg


    The first two lines show it was made in Blender and there are 21 materials assigned to this model

    The "newmtl" materials highlighted in green are just diffuse color materials , no jpegs.

    The "newmtl" materials highlighted in purple are image based textures.

    The data highlighted in red is the pathway for the image files.

    RATS... I gotta run now, but I hope this helps clear stuff up somewhat.

    I'll check back later.

    Post edited by McGyver on
  • rol3drol3d Posts: 40
    edited December 1969

    I'm running into the same issue as some others with materials not loading.

    Environment: Windows 7; Daz 4.6.0.18

    I DL'd this gas station on sharecg: http://www.sharecg.com/v/34828/gallery/5/3D-Model/gasstation
    I converted it to an OBJ via http://www.greentoken.de/onlineconv/ which gave me an OBJ and an MTL.

    The OBJ loads no problem as a gray model. I've tried a couple of things, but I can't get the materials to load.

    Thanks for your help!


    I have placed the OBJ and MTL + all the supporting image files into a folder called D:\TEST; here's what's in that folder:

    -texaco-fire-chief.jpg
    arroway.de_pavement+01_b030.jpg
    arroway.de_pavement+01_d100.jpg
    arroway.de_pavement+01_s100.jpg
    garb.txt
    gas1.jpg
    gasposters.png
    gas_red.png
    gstation.lwo
    gstation.mtl
    gstation.obj
    poster1.jpg
    red.jpg
    s1texaco.jpg
    testataan.lws
    untitled.bmp
    untitled2.bmp
    untitled3.bmp
    untitled4.bmp
    wallpaperi.jpg
    wallpaperi1_bumb.jpg

    Here's the top of the gstation.obj file:

    # File produced by Open Asset Import Library (<a href="http://www.assimp.sf.net/">http://www.assimp.sf.net</a>;)# (assimp v3.0.1270)mtllib gstation.mtl# 123344 vertex positionsv  0.0849995 0.12 2.605v  1.63 0.255 2.605v  1.63 0.12 2.605v  1.63 0.255 2.605v  1.65121 0.12 2.61379v  1.63 0.12 2.605v  0.0849995 0.0987868 2.61379......

    Here's the complete gstation.mtl file: (note: not all the JPGs/PNGs were included in the original download)

    # File produced by Open Asset Import Library (<a href="http://www.assimp.sf.net/">http://www.assimp.sf.net</a>;)# (assimp v3.0.1270)newmtl gas_betonikd 0.442353 0.458039 0.44549ks 1 1 1d 1Ns 7.0225illum 2newmtl gas_glasskd 0.0666667 0.105882 0.141176ks 1 1 1d 1Ns 36illum 2newmtl gas_grasskd 0.290196 0.368627 0.301961ks 1 1 1d 1illum 1newmtl gas_ground1kd 0.144706 0.151765 0.146471ks 1 1 1d 1illum 1newmtl gas_house1kd 0.169569 0.224863 0.169569ks 1 1 1d 1Ns 67.24illum 2newmtl gas_house2kd 0.619608 0.529412 0.360784ks 1 1 1d 1Ns 20.25illum 2map_kd D:\test\wallpaperi.jpgbump D:\test\wallpaperi1_bumb.jpgmap_bump D:\test\wallpaperi1_bumb.jpgnewmtl gas_house3kd 0.661647 0.661647 0.661647ks 1 1 1d 1illum 1newmtl JoinedMaterial_#47kd 0.278431 0.301961 0.313726ks 0.873706 0.887118 0.893824d 1illum 1newmtl gas_letkukd 0.176471 0.176471 0.176471ks 1 1 1d 1Ns 36illum 2newmtl gas_letku2kd 0.627451 0.466667 0.0862745ks 1 1 1d 1Ns 36illum 2newmtl JoinedMaterial_#27kd 0.784314 0.784314 0.784314ks 1 1 1d 1Ns 36illum 2map_kd D:\test\gas_red.pngnewmtl gas_nozzle1kd 0.643137 0.643137 0.643137ks 1 1 1d 1Ns 36illum 2newmtl gas_nozzle2kd 0.38 0.38 0.38ks 1 1 1d 1Ns 36illum 2newmtl gas_nozzle3kd 0.243333 0.200392 0.11451ks 1 1 1d 1Ns 36illum 2newmtl gas_nozzle4kd 0.176471 0.176471 0.176471ks 1 1 1d 1Ns 36illum 2newmtl JoinedMaterial_#43kd 0.784314 0.784314 0.784314ks 1 1 1d 1illum 1map_kd gasposters.pngnewmtl gas_regular1kd 0.392157 0.392157 0.392157ks 1 1 1d 1Ns 36illum 2map_kd D:\test\gas_red.pngnewmtl gas_roof3kd 0.784314 0.784314 0.784314ks 1 1 1d 1illum 1newmtl JoinedMaterial_#31kd 0.45098 0.454902 0.454902ks 1 1 1d 1Ns 43.56illum 2newmtl gas_rooflight2kd 0.996078 0.972549 0.0627451ks 1 1 1d 1illum 1newmtl gas_starkd 0.329412 0.0627451 0.0705882ks 1 1 1d 1illum 1newmtl gas_tree1kd 0.784314 0.784314 0.784314ks 1 1 1d 1illum 1map_kd D:\test\Tree-Texture-19.jpgnewmtl gas1_chiefkd 0.784314 0.784314 0.784314ks 1 1 1d 1Ns 36illum 2map_kd D:\test\gas_red.pngnewmtl gas1_ironkd 0.161961 0.163333 0.164706ks 0.505725 0.509333 0.512941d 1Ns 12.96illum 2newmtl gas1_logo1kd 0.595843 0.595843 0.595843ks 1 1 1d 1Ns 36illum 2map_kd D:\test\gas_red.pngnewmtl gas1_logo2kd 0.839216 0.839216 0.839216ks 1 1 1d 1Ns 36illum 2map_kd D:\test\gas_red.pngnewmtl gas1_number1kd 0.917647 0.917647 0.917647ks 1 1 1d 1Ns 36illum 2map_kd D:\test\gas_red.pngnewmtl gas1_number2kd 0.578118 0.578118 0.578118ks 1 1 1d 1Ns 36illum 2map_kd D:\test\gas_red.pngnewmtl gas1_redkd 0.509804 0 0.0117647ks 1 1 1d 1Ns 36illum 2map_kd D:\test\red.jpgnewmtl gas1_silverkd 0.564706 0.564706 0.621177ks 0.784314 0.784314 0.862745d 1Ns 36illum 2newmtl klamppu01kd 0.702353 0.568235 0.381176ks 1 1 1d 1illum 1newmtl klamppu03kd 0.996078 0.913725 0.580392ks 1 1 1d 1illum 1newmtl JoinedMaterial_#53kd 0.17251 0.169255 0.175765ks 0.374196 0.371098 0.377294d 1Ns 9.61illum 2newmtl JoinedMaterial_#52kd 0.498824 0.467451 0.0533333ks 0.623529 0.584314 0.0666667d 1illum 1
  • SpottedKittySpottedKitty Posts: 7,232
    edited December 1969

    I was never able to get .mtl files to work on .obj import... except sometimes it would work, and I was never able to figure out how, or why. I have since discovered a couple of things that can stop the maps noted in the .mtl file from being picked up properly.

    * texture file paths — if the texture files are collected together in the same folder as the obj/mtl files, then the .mtl file doesn't need to include the folder path in each file reference. The file name is all you need. Also, if you have folder paths, the textures will always be looked for on that path — if you move the folder, the textures will never load automatically on import. Finally, leaving the folder paths out means you can move and rename the whole thing somewhere else (preferably into your working Runtime Textures folder), so you don't end up with dozens of test folders that must be named "test". Just remember where you put it and what you rename it as, so you can find it to import "for real" when you're done testing.

    * .mtl file name — I sometimes come across obj/mtl file pairs with ridiculously long names, or with foreign characters. If you change the file names to something easier to handle, also change the .mtl file reference in the top few lines of the .obj file.

  • rol3drol3d Posts: 40
    edited December 1969

    Thanks for your quick response SpottedKitty!

    I had tried with and without full path names; I had fixed all the ‘goofy’ names. I tried to include the path name in double quotes. Then I moved it all to its own folder, ‘\test’ just to make everything simple (I thought the folder depth may be too long). I even tried good old ‘.\’ as the path - Also nada. Guess I’ll just have to do it by hand.

    The one thing I have not yet tried is to eliminate any errors, like the ones where a file is specified in the MTL but is missing. I’ll give that a shot and post results.Maybe once there's an error, DS quits interpreting the MTL file. Ya never know!


    Cheers.

  • McGyverMcGyver Posts: 7,075
    edited October 2013

    rol3d said:
    I'm running into the same issue as some others with materials not loading.

    Environment: Windows 7; Daz 4.6.0.18

    I DL'd this gas station on sharecg: http://www.sharecg.com/v/34828/gallery/5/3D-Model/gasstation
    I converted it to an OBJ via http://www.greentoken.de/onlineconv/ which gave me an OBJ and an MTL.

    The OBJ loads no problem as a gray model. I've tried a couple of things, but I can't get the materials to load.

    Thanks for your help!


    I'm gonna go out on a limb here and say it is probably the online exporter you are using, I read a thread a while back where someone found a site like that and people basically told them to use other methods, the results were never really that good.
    I used to have trouble converting LWO files... they seem to be hit or miss with the textures, especially with the newer versions (7+)... I don't really think a lot of the conversion methods do the lightwave models justice. I used to use (I forget which) either PoseRay or POV to convert older LWO files... (it was probably PoseRay, because I'm a Mac user and PoseRay is Windows only and I used to have to use my old Sony laptop to convert the files)... you might want to try that, especially if the model is fairly simple.

    Edited to add... Did you check the actual OBJ files to see the texture names match?

    For example, here is a bit of the OBJ file from one of my models:

    vt -11.615625 3.498863
    vt -11.634375 3.906096
    vt 13.170851 3.179774
    vt 13.016398 4.005964
    vt 13.016398 3.164523
    vt 13.170851 3.990712
    vt -6.862940 -7.526053
    vt -6.776430 -7.680658
    vt -6.756874 -7.526053
    vt -6.903709 -7.680658
    usemtl M1818L_Galvanized_VT.jpg
    s off
    f 27445/17409 27446/17410 27447/17411
    f 27446/17410 27445/17409 27448/17412
    f 27449/17413 27450/17414 27451/17415
    f 27450/17414 27449/17413 27452/17416
    f 27453/17417 27454/17418 27455/17419
    f 27454/17418 27453/17417 27456/17420
    f 27457/17421 27458/17422 27459/17423
    f 27458/17422 27457/17421 27460/17424
    f 27461/17425 27462/17426 27463/17427

    The program reading the OBJ file will use the MTL file to locate the texture called "M1818L_Galvanized_VT.jpg"


    newmtl M1818L_Galvanized_VT.jpg
    Ns 96.078431
    Ka 0.000000 0.000000 0.000000
    Kd 0.423530 0.420392 0.417255
    Ks 0.000000 0.000000 0.000000
    Ni 1.000000
    d 1.000000
    illum 2
    map_Kd /Users/vic/Desktop/DynamicFieldGenerator/DynamicFieldGenerator-Type36_Textures/M1818L_Galvanized_VT.jpg


    If it is even slightly misspelled like say "M1818LGalvanized_VT.jpg" or "M1818L_Galvanized_VT", the program reading the OBJ will not be able to find it. I frequently hack my OBJs to fix messed up material names that don't come out right in Poser... I make many of my models in SketchUp and tweak them in Blender, but since I have to export in Collada first, I lose all my Material names ( Image based texture names get messed up too sometimes) because the Collada exporter changes them all from normal names like "SteelSupport_Blued" to useless ones like "ID38383".
    Sometimes convertors like to change material names... like say from "OakBark dark" to Oak_Bark_Dark" or something like that, or they cut off a character or two.

    Post edited by McGyver on
  • rol3drol3d Posts: 40
    edited December 1969

    Geez, you guys are fast, thanks lordvicore.

    You're probably right, I'll see if I can convert it another way. By now, I could have done it by hand a few times over, but I was curious in case I end up with more of the LWO models.

  • McGyverMcGyver Posts: 7,075
    edited December 1969

    Sorry I type slow, but I updated my previous post while you were replying... you might try checking the OBJ using a text editing program... I use a Mac so for me it is TextEdit... I use the "Find" feature to find all instances of a certain word (or code) , use "Replace with" to add the new text or code and then "Replace All" to change all instances of that text or code... I'm sure it is the same for notePad or what ever other windows text editors there are.

  • SpottedKittySpottedKitty Posts: 7,232
    edited December 1969

    Another maybe-helpful works-for-me tip: have you tried the freeware PoseRay to convert your LW files? That's the one I've had most success with, although .3ds files are iffy, they sometimes blow up in the viewport if they've been exported from 3DSMAX without doing a few important things first.

    FWIW, since I discovered the trick a few months ago, totally removing the folder path has always worked for me. No "/test/", no "./", no nothing, just the parameter name and the bare filename.

  • rol3drol3d Posts: 40
    edited December 1969

    Sorry I type slow, but I updated my previous post while you were replying... you might try checking the OBJ using a text editing program... I use a Mac so for me it is TextEdit... I use the "Find" feature to find all instances of a certain word (or code) , use "Replace with" to add the new text or code and then "Replace All" to change all instances of that text or code... I'm sure it is the same for notePad or what ever other windows text editors there are.

    I hadn't checked them all, just the gas_red.png material and it matches 100%; perhaps I need to go back and check them all.

    Here's part of the OBJ:

    # Mesh 'Layer_0' with 12 faces
    g Layer_0
    usemtl JoinedMaterial_#27
    f 43635/1198/43635 43636/1199/43636 43637/1200/43637
    f 43638/1201/43638 43639/1202/43639 43640/1203/43640
    f 43641/1204/43641 43642/1205/43642 43643/1206/43643
    f 43644/1207/43644 43645/1208/43645 43646/1209/43646
    f 43647/1210/43647 43648/1211/43648 43649/1212/43649
    f 43650/1213/43650 43651/1214/43651 43652/1215/43652
    f 43653/1216/43653 43654/1217/43654 43655/1218/43655
    f 43656/1219/43656 43657/1220/43657 43658/1221/43658
    f 43659/1222/43659 43660/1223/43660 43661/1224/43661
    f 43662/1225/43662 43663/1226/43663 43664/1227/43664
    f 43665/1228/43665 43666/1229/43666 43667/1230/43667
    f 43668/1231/43668 43669/1232/43669 43670/1233/43670

    ... and here's the MTL :


    newmtl JoinedMaterial_#27
    kd 0.784314 0.784314 0.784314
    ks 1 1 1
    d 1
    Ns 36
    illum 2
    map_kd D:\test\gas_red.png

  • rol3drol3d Posts: 40
    edited October 2013

    I just downloaded AccuTrans 3D from http://www.micromouse.ca/ which I found after Google'ing for converters.

    It indicates any errors during the conversion and even shows a preview of the textured model. Gave me OBJ and MTL files that worked flawlessly in DS!!! Immediately PayPal'ed them the measly $20 they are asking. This software converts all kinds of formats (but I only tried the LOW -> OBJ conversion).

    Cheers.

    Post edited by rol3d on
  • McGyverMcGyver Posts: 7,075
    edited December 1969

    Thanks for that link, even though I don't really ever convert LWO files anymore, or currently use Windows, it is good to know about that converter... and it seems very reasonably priced too... I'll pass that along next time someone asks.
    Maybe when you have used this for a while, if you have a moment, come back here and let us know any further thoughts and opinions on this software.
    Thanks.

  • I'm having similiar issues. (Textures not being imported into DAZ). I'm trying to import OBJ files exported from SketchUp 2016.

    Some tests I performed yeilded promising results. For example I exported an OBJ file from DAZ, imported into SU using a plugin called Fluidimporter, then re-exported it from SU and re-imported it into DAZ again. The file imported with the textures (albeit, the clothing on my test figure was darker).

    Also, files exported from DAZ then reimported all import textures as expected.

    It's the OBJ files exported from SU native files (skp) that won't behave. Structuraly all is fine .... but no textures.

    Ideas anyone?

  • TotteTotte Posts: 14,257

    Do you get an mtl file and is it correct?

  • SpottedKittySpottedKitty Posts: 7,232

    There are a few weird things that can happen in the .mtl file which cause DAZ|Studio to ignore applied textures. See my first post about half-way down this page — there's more than one way the parameters in the .mtl can define the location of a texture file, and D|S is very, very fussy about the way it parses this data.

  • WendyLuvsCatzWendyLuvsCatz Posts: 38,955
    edited January 2016

    sketchup exports often have opacity at zero too.

    what frustrates me is I can usually import obj textured from most apps but cannot export and reimport from DS itself without altering mtl files

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