Importing props with a texture from Blender to Daz?

Can someoen explain as dunbproof as possible how to export a prop from blender to Daz please? Just an example - I want to export just a pillow. Besides just giving it a color I can load as diffuse map some image but I want to be able to use more refined texture. I can UV unwrap the object in blender and then? Exporting the UV layout? So I will have the exported UV layout as PNG image and the texture. How to apply this to the imported in Daz mesh?

Comments

  • andya_b341b7c5f5andya_b341b7c5f5 Posts: 694
    edited October 2018

    Assuming Blender 2.79, make sure you have assigned material(s) to your UV-mapped object using whatever image you like.  I called my material 'MonkeyMat' and used the generated UV guide for the image.

    Select just your object and select File->Export->Wavefromt (.obj).  Check the Export Options - the ones in the attached work for me.  Note the scale is 1.

    In DS, choose File->Import, select your exported .obj, and set the import options - see attached.  Note the scale.  One 'metre' in Daz is 100 'metres' in Blender, I have scaled up by 10 only here - you may want to use 10000%.

    You should have a surface for each material now.  Convert them to Iray materials if you want.  You will need to select the image map(s) in the Surfaces tab - I don't know of a way to get DS to load the correct maps into the correct slots, except perhaps for scripting it.  Blender will have created a .mtl file along with the .obj, but DS seems to ignore these even with the 'Read Material Library' option checked on import.

    To export a UV layout as PNG, in Blender's UV/Image editor, select all the verts then choose UVs->Export UV Layout from the menus; set the size and opacity to suit and export.

    Hope that helps.

    obj-export.JPG
    247 x 613 - 29K
    ds-import.JPG
    715 x 603 - 51K
    monkey.JPG
    650 x 660 - 33K
    monkey-uv.png
    1024 x 1024 - 433K
    Post edited by andya_b341b7c5f5 on
  • andya_b341b7c5f5andya_b341b7c5f5 Posts: 694
    edited October 2018

    All right, worked out how to get the image map to appear without having to select it manually in DS. 

    Basically, set up your material in Blender using Blender Internal, not Cycles.  The image needs to be assigned to a texture, which in turn belongs to the material.  This will cause the .mtl file to contain a reference to the image file.  Now, when you import in DS, the image will appear in the relevant slot.  Or at least, it will for diffuse, that's all I've tried but I'd assume it will at least work for specular as well.

    monkey-blender.jpg
    1883 x 891 - 326K
    monkey-diffuse.JPG
    539 x 856 - 66K
    Post edited by andya_b341b7c5f5 on
  • Thanks. Never worked with Blender Internal but will ask uncle Google, should not be a problem.

  • handel_035c4ce6handel_035c4ce6 Posts: 457
    edited October 2018

    It isa comlete mess in my head. Blender, Daz, importting from Blender to Daz, importing from Daz to Blender. Now tried to look into blender render, which I never ever used and only know of its existance, and started to get smoke from my ears. I loaded a simple blend file - a tin can - in google drive, done in Cycles. Is it possible please to explain as dumbproof as possible how to export to Daz and how to apply the textures and the UV map please (the can is rather big - I did it a long time ago, so forgot why it is so big; the texture itself should be packed into the blend file but I upload it in the same folder anyway). Of course every other example will do the job - but very very dumbproof please:-)

    https://drive.google.com/drive/folders/1gj8pnT3nlMvXHmQL2i5To70Zp2MNI0zd?usp=sharing

    Thanks in advance!

    Edit: LOL... Actually I had this can saved in DAZ as support asset and I easily could assigned (almost, no idea why tiny artifacts appeared) the needed texture. Beats me why. My problem still persists - no idea about why exactly this happens or vice versa - why it fails (about the textures I mean).

    About the artifacts - here how it looks in main view, and next to it - how it looks rendered:

    test1.png
    1920 x 1080 - 367K
    can_test.png
    969 x 889 - 326K
    Post edited by handel_035c4ce6 on
  • I can never get Daz to import the texture. Am used to doing it manual. If I import an OBJ that comes from Blender in another application it reads the textures just fine, but not Daz Studio.
    Andya's instructions seem clear to me for you to follow. If you can set up a material for Cycles you can set one up for Blender Internal.

    Either way, you should sort out the scale of that can. It's currently 7.2m Tall!
    Get it to a more realistic size then you'll be able to import it in to Daz at 1% Scale.
    Remember to apply the scale after adjusting the size.

    I wouldn't waste too much time on trying to get the whole texture export thing to work. Set up your materials in Blender. Get it in to Daz and then set the textures up there. You will need to learn how to do that anyway for better renders, if you intend rendering in Daz.

  • I wouldn't waste too much time on trying to get the whole texture export thing to work. Set up your materials in Blender. Get it in to Daz and then set the textures up there. You will need to learn how to do that anyway for better renders, if you intend rendering in Daz.

    I am still scratiching my head what to choose. My props are coming from Blender and will proceed to come from there; and there is a great free script which imports *everything* from Daz to Blender. Literally everything - riggning, morphs, expressions (everything put on sliders from 0 to 1), posing, including importing pose presets; just the Cycles shaders presets need some more tweaking. But I find making poses on Daz much easier and really funny, If I make poses in daz I need to transfer some key objects with min textures, make the poses and import them to Blender. On the other side is importing every prop to Daz for every scene... Damn!

  • andya_b341b7c5f5andya_b341b7c5f5 Posts: 694
    edited October 2018

    TL;DR at the end!

    I've looked at your blend file and made this process work from it as a technical exercise, but it took an hour and I'm afraid I don't have time to document every step in detail.  It would need many screenshots and an essay.  Here are the main points below.

    I cannot attach the .obj, .mtl or revised .blend file here - they are blocked, understandably.  I will try to send you a PM with a link to download the files later so you can see what the blend file looks like.

    I adjusted the UV mapping so the areas for the 'label' and the 'metal' do not overlap.  DS uses UDIM, and so can work with this overlap.  Blender doesn't support UDIM natively yet, so better to not do this.  (There are ways to 'fake' UDIM functionality, but it gets messy quickly.  Maybe native in 2.8?)  Overlaps may also confuse the OBJ exporter.  The 'metal' areas do not even need to be mapped to part of the label image.  I added some seams to the model to improve the unwrapping.

    OBJ exporter in Blender does not support Cycles materials: it doesn't 'understand' node-based materials.  It can only cope with Blender Internal materials.

    DS cannot find the image if it is packed in the blend file when you export the OBJ.  You must unpack it and have the image on disk somewhere and assign it to the texture from there in Blender.  Then when you export the OBJ, the location on disk will be recorded in the .mtl file.

    Check the .mtl file.  (You need to check 'Write Materials' in the options when you export from Blender, of course.)  It's a text file - open it in your editor of choice.  You should have a line like this pointing to the image (your disk location may differ):

    map_Kd D:\Downloads\ETIKETI.png

    You cannot have spaces in the name of the .mtl file.  The OBJ importer in DS will not handle this, even on Windows.  This file name is derived from the name of the obj file, so I changed the .obj name when exporting from Blender to remove the spaces.

    Check the DS log file if the OBJ does not import correctly.

    After all of that, the OBJ imported into DS with the label image assigned correctly.  I converted the surfaces to Iray with the Iray Uber Shader, and assigned a brushed aluminium to the metal (bit too shiny). 

    TL;DR.  It can be done, but I really don't think it's worth the effort. Blender Internal is removed from Blender in version 2.8, replaced by EEVEE (woohoo!), so (y)our time is better spent learning that instead unless you intend to be a 'hold out' for 2.79 for other reasons.  (EEVEE materials are node-based too.)  Assign your image maps manually in DS.

    Can Daz.jpg
    1920 x 1080 - 303K
    CanDazRender.jpg
    600 x 960 - 238K
    Post edited by andya_b341b7c5f5 on
  • InkuboInkubo Posts: 742

    ... there is a great free script which imports *everything* from Daz to Blender. Literally everything - riggning, morphs ...

    That sounds terrific! I'd love to rig props in Blender and just import the rigging. May I know what script you use?

  • Inkubo said:

    ... there is a great free script which imports *everything* from Daz to Blender. Literally everything - riggning, morphs ...

    That sounds terrific! I'd love to rig props in Blender and just import the rigging. May I know what script you use?

    Here: The last version is 1.3.1 The developper is ready for the new render so this is the last version for the Cycles:

    https://blenderartists.org/t/daz-importer/684697/153

  • handel_035c4ce6handel_035c4ce6 Posts: 457
    edited October 2018

    I've looked at your blend file and made this process work from it as a technical exercise...

    Thanks a lot. Overlapping the "metal" with the labels were one of the points which were frustrating me.

     

    Got it at last. As long as the image texture is governed by UVmap input the textures fits perfectly.

    Blender_to_Daz.png
    936 x 341 - 46K
    Post edited by handel_035c4ce6 on
Sign In or Register to comment.