Material Import Issues

Issue #857 resolved
Midnight Arrow created an issue

Dev Build 1.6.1.0849

I've been experiencing issues with material import for some time now, and they’re still present in the latest dev build.

The first is that figures with strong blue hues in their diffuse channel tend to look, well, blue. Excessively so, much more than in Daz Studio.

On the left is Christabel by Lyoness, who has pure white in the diffuse channel. On the left is Evangeliya by iSourceTextures, who has a value of #94B3B3 in the diffuse channel.

This is what they look like in Blender, with the exposure turned up to similar levels:

Making a nighttime scene with a character like Evangeliya is nigh impossible since her blue skin blends in with the blue walls, unless the lights are turned up so bright they dispel the shadows. If I turn Evangeliya’s diffuse channel up towards white, the results become much better. That makes me think colored diffuse channels should be modulated on import, because the default seems way too strong.

(Also, for some reason, Evangeliya is missing limit constraints on the shoulders and collars on import. Since I don’t use the Daz rig, this doesn’t really affect me.)

Another issue I have is that certain characters give a new meaning to the term “glass jaw”. This is what Christabel’s teeth look like on import:

The character has a diffuse map for the teeth, but for some reason it’s not getting exported correctly, so the teeth become purely refractive.

Comments (31)

  1. Alessandro Padovani

    This weekend I’m quite busy but will try to look at it. Are both the blue skin and the black teeth on the Evangeliya figure ?

  2. Alessandro Padovani

    That’s interesting. I will work more on this but at a first look here’s the basics for now.

    1. As for the black teeth they’re 100% refractive in iray. This means that diffuse is ignored by iray and only volume comes into play, if you don’t trust me try a green diffuse. In your picture I see you disabled the volume that’s why you get it odd. It also means that the PA doesn’t really understand what he’s doing since teeth are not refractive at all, but it happens that PAs don’t understand materials and it doesn’t matter anyway for the sake of conversion.

    Then there’s a bug that translucency is ignored for 100% refraction that shouldn’t happen, but it is minor in this case. I need to look at what we did for pure refractive materials since it is possible we took some approximations. Will expand later.

    Below there’s the teeth with volume enabled.

    2. As for the blue skin there’s something odd with the monochrome sss conversion, it needs to be improved. Need more tests.

  3. Midnight Arrow reporter

    After further testing, applying the figure’s translucency presets in Daz Studio will radically alter the Iray glossy settings and cause the Diffeomorphic importer to not create a volume node. So this may be a bad material preset rather than a bad export. Saving the figure with the “All Maps” preset does add the volume node. It looks better, but still pretty terrible.

    Oddly, this also affects the mouth material, which definitely should not be refractive. This is what it looks like in Workbench:

    This may be an issue on the Daz end of things, but on a related note are there are plans to allow importing materials directly from Duf files? Having to export a whole new figure just to test whether a material will work in Blender or not is pretty tedious, not to mention it’d be useful for adding and removing things like nail polish and tattoos.

  4. Thomas Larsson repo owner

    I made a tool for loading materials directly from a duf file to the active mesh. However, it only works for scenes yet. The daz material files are organized a bit different from scenes, so reusing the old code does not load the interesting stuff.

  5. Thomas Larsson repo owner

    Now you can import materials directly from a material preset. Typically a file whose name ends with “All Maps”.

  6. Alessandro Padovani

    As for commit 73da8b9, I tried “import daz materials” on the dark storm armor and I get an error. Test scene included armor.duf.

    steps:

    1. import the test scene armor.duf, it’s the G3F dark storm armor
    2. load the “ciakra armor” material preset or any other

  7. Alessandro Padovani

    As for commit d4e5933 there’s a minor issue. It seems not all the textures are pruned when we change the materials.

    steps:

    1. import the test scene armor.duf with the principled option
    2. load the “ciakra armor“ material preset
    3. check the “leftshoulderplates“ material, the specular map “sdsarmarmorleft01s“ is not pruned

  8. Alessandro Padovani

    As for commit 96e1204, I'm not sure if this is supposed to work, but it seems we can’t load makeups. I tried with Victoria 8. If “partial” materials are not supported then it’s fine this should just be explained in the docs.

    steps:

    1. import Victoria 8
    2. load a makeup

  9. Thomas Larsson repo owner

    The tool imports all materials in the duf file, and by default assigns replaces existing material slots with the first ones. So this works if the materials in the file and the mesh are ordered in the same way. You could also just load the materials, and then replace material slots manually. There may be a makeup material that should replace the face, lips, and ears.

    Note that you must not merge materials, because then the mesh material order is not the same as in the file; some materials such as the ears may be missing.

  10. Alessandro Padovani

    Nope, even if I import Victoria 8 with a makeup I get the black mask above. No materials merged.

    steps:

    1. import Victoria 8 with a makeup
    2. load another makeup

  11. Alessandro Padovani

    update. black teeth explanation.

    As for the Christabel figure the issue is that she’s using the “weighted“ mode for the teeth and mouth materials. Actually we don’t support this material mode and to be honest I never saw it in any other figure or prop, this is probably the only PA using it. There’s also something odd when using the translucency presets, because the volume gets thin walled off but no values are shown. You have to turn thin walled on then off again to show the values. This is probably a bug in the preset.

    As a workaround you can set the material mode to “metallicity/roughness” then turn off refraction. This way the teeth and mouth are exported fine.

  12. Thomas Larsson repo owner

    There is now an option to match material names. This means that file that only affect some materials can be loaded, e.g. an eye file affects cornea, irises and sclera. Makeups can be loaded in some cases, namely if the makeup file contains the full face material. Sometimes a makeup file only contains a partial material, e.g. a diffuse overlay, and then it doesn’t work.

  13. Alessandro Padovani

    Thomas, just an idea please let me know what you think.

    To load “partial” materials, would it be possible to keep the material file paths when we load the scene ? This way we could “merge“ the original full material and the partial material, so keeping the ids that are missing in the partial material, then replace the full material for the figure. The material file paths alone should not take much memory.

    Otherwise it’s fine if we can only load “full” materials. Then if it would be possible to make an “exception“ in some way only for the diffuse overlay makeups, since this would likely be a most useful feature for female figures.

  14. Thomas Larsson repo owner

    The V8 makeups are all-right now. The problem was that I didn’t considered the image modifications, which among other things said that the overlay mask should use the alpha channel. But the V8 makeups are still full materials. Handling partial materials with diffuse overly only should be possible, but will take some work.

  15. Alessandro Padovani

    Commit 3453d88 works great with Victoria 8 makeups. It doesn’t work with Victoria 8.1 makeups though, that's the pbrskin.

    steps:

    1. import Victoria 8.1
    2. load a makeup

    edit. update. important. I also tried saving the full face material as a material preset and doesn’t work. So this should be a bug with the pbrskin. On the other side, since saving a full material preset is easy enough, we don’t need to handle partial materials if this is difficult to implement. That is, we just need to apply the materials we want in daz studio then save as a material preset, then we load the material preset in blender.

    These notes can be added to the docs to explain how to use the “import daz materials” tool.

  16. Alessandro Padovani

    As for commit 9c5ac0d, in daz studio it is not possible to animate materials, so I’m not sure what it means. How do we save material presets defined as animations ?

    As for 3delight materials, as always it is better to convert them to iray before exporting for better conversion. That’s also true for material presets that we can load then convert then save to be loaded in blender. This can be another note for the docs.

    As for partial materials, as explained above they may not be necessary, since we can always save full materials by presets.

  17. Thomas Larsson repo owner

    Even if it is not possible to animate materials in DS, the material properties are still saved as animations. If you look in one of the V8.1 makeup files, you will see lots of lines like

            {
                "url" : "Genesis8_1Female#materials/Lips:?extra/studio_material_channels/channels/Metallic%20Weight/image_file",
                "keys" : [ [ 0, "/Runtime/Textures/DAZ/Characters/Genesis8/Victoria8_1/Victoria8_1_MU01M_1001.jpg" ] ]
            },
    

    I agree that it is not very important to be able to load materials directly from daz files. Normally you save the character in a scene, and a scene file always contains complete materials. But when MA requested to import materials directly from duf files, I implemented it since most of the code already existed.

  18. Alessandro Padovani

    Thank you for the explanation. I never said it is not important to load materials I believe it is a nice idea from M.A. and a useful feature, thank you so much for implementing this. I said it may not be important to load partial materials, that is, materials that do not define a full surface in daz studio, since we can always save a material preset as a full surface. Unless I misunderstand what you mean by “partial material“.

    As for commit 9c5ac0d the Victoria 8.1 makeup is not imported fine. Below what I get. I also tried to save a full face material preset but didn’t work either.

    steps:

    1. import Victoria 8.1
    2. load the MU01 makeup

    alt steps (this does nothing, the face material is not changed in blender):

    1. in daz studio apply the MU01 makeup to Victoria 8.1 and save a full face material preset
    2. in blender import Victoria 8.1 without makeup
    3. load the face material preset

  19. Thomas Larsson repo owner

    There is now support for some types of partial materials: Pbrskin makeup (Victoria 8.1 makeup) and iray diffuse overlay (Aiko 8 makeup). Those are the only ones I have encountered so far.

  20. Alessandro Padovani

    As for commit 9379afd the Victoria 8.1 makeup is better, but doesn’t work fine. It misses the metallic speckles in the makeup 01 for example. Also, if I save the makeup as a full face material preset, it doesn’t work at all.

    That said I understand that loading materials may be more difficult than it was meant to be. So if we know the limitations we may be happy with this.

    But why saving the full preset doesn’t work ? I mean if I save the full face material it is not a partial material anymore.

  21. Thomas Larsson repo owner

    Basic material import should work now. The materials look the same both when I import the entire character or just the materials. But so far partial materials only consider the makeup channel, not metallic flakes.

  22. Alessandro Padovani

    @Thomas Commit 12ea955 seems to work fine here. It is easy to save full material presets from daz studio, so as a general rule we can modify the materials then save the full preset if we want to load in blender.

    @Midnight Will address the “blue skin“ issue as I get some time. As for the weighted mode should work fine now.

  23. Alessandro Padovani

    update. The “blue skin” is fixed with #898. Please note that there are other two factors that come into play in general and also for the skin tint. They are the cycles settings and the tone mapping. Since the skin is volume based the more volume bounces the more the precision. Also tone mapping of course plays its role with tints.

    If @Midnight has nothing to add we may mark as resolved.

  24. Alessandro Padovani

    update. Thomas this is just to point out that there’s no documentation for this new feature yet. I mean that it is now possible to load materials. Unless there’s documentation but I didn’t find it. Also we should mark as resolved I can’t.

  25. Log in to comment