Blender addons to manage HD morphs and to generate .dhdm files [part 4]

Issue #1862 open
Xin created an issue

[ Continuation of: https://bitbucket.org/Diffeomorphic/import_daz/issues/1399/blender-addon-to-generate-rigged-hd-meshes ]

The source is available in the following repository: https://gitlab.com/x190/daz-hd-morphs . There you can also find compilation details for the .dll and .so, and documentation on how to use the addon. If you find this addon useful, consider supporting its development and maintenance here: https://xin888.gumroad.com/l/daz_hd_morphs .

The latest version (the main branch) includes documentation in the form of a .pdf in “./blender_addon/documentation/daz_hd_morphs_documentation.pdf”. It includes several step by step examples.

Instead of uploading files here, it’s more convenient for me if you downloaded the files directly from the gitlab link above. Once you get the files you need to place the directory “./blender_addon/daz_hd_morphs” in “…/AppData/Roaming/Blender Foundation/Blender/3.6/scripts/addons” manually if you downloaded it from gitlab. You can alternatively create a .zip from the daz_hd_morphs directory (call it “daz_hd_morphs.zip”) and tell Blender to install it.

And here is the addon that lets you create .dhdm files. The documentation is also included:

https://gitlab.com/x190/daz-dhdm-gen (free)

https://xin888.gumroad.com/l/daz_dhdm_gen (for support)

As usual, they are both the same version.

Comments (63)

  1. Xin reporter

    There is now a Linux version for daz_hd_morphs on the gitlab page. I haven’t tested it much, so let me know if you encounter any issues.

  2. Xin reporter

    I’m now testing and documenting a ZBrush version of daz_dhdm_gen.

    After that, since the Linux version of daz_hd_morphs is currently faster than the Windows version, I will look into the compilation of the libraries used by the Windows version (I compiled those a long time ago), since I compiled the Linux version’s libraries recently with additional libraries that might have helped with performance.

  3. Maneki

    Not sure if I do something wrong, but in Blender 4.0.2+ and the 1.0 daz HD addon, I can’t make import favorites work, when I select a daz importer generated favorite morph list. The addon just says “0 morph files added”

  4. Xin reporter

    The problem is that import_daz now saves morphs' relative filepaths in the favorite file instead of absolute filepaths, which makes the favorites file not easily portable. I could modify the script to try to read the daz library root paths from import_daz’s scene properties but that would introduce an unnecessary dependency. I will ask Thomas first if he could add an option to save absolute paths.

  5. Xin reporter

    Thanks Thomas. I will add the changes soon.

    Maneki, what do you mean by copying mute drivers? could you give a simple example?

  6. Maneki

    daz importer has a option to add mute drivers to every morph, which turns them off completely when they are at a 0.0 value. The drivers are on the right side of shapekeys:

  7. Thomas Larsson repo owner

    One thing I found was that it is not possible to drive shapekey mute with the value of the same shapekey; that results in a dependency loop. Instead both shapekey value and mute must be driven by the same external property, e.g. an object or armature property. The creation of mute drivers is done in the function addShapeDriver at line 499 of load_morph.py.

  8. Maneki

    There’s also another bug I noticed: When I create custom shapekeys by sculpting in Blender and then generate a HD mesh, those custom shapekeys work fine on the HD mesh. But when I copy driver from one morph to these custom shapekeys because I want both get activated by the same condition, and then generate the HD mesh, the custom shapekeys with drivers don’t work at all. The drivers work but it doesn’t seem to transfer the mesh deformation.

  9. Thomas Larsson repo owner

    The crash should be gone now. It didn’t happen when only running my code, but Xin must have done something differently that triggered the crash.

  10. Maneki

    For the issue with the custom shapekeys which don’t work. I imported them into Daz and saved them and tried to manually load them on the HD mesh and get this error:

    The morphs get applied to the mesh but don’t work.

  11. Xin reporter

    Maneki, I can't reproduce that issue. I follow these steps:

    1. Add shape key to base mesh and sculpt some deformation.
    2. Right click an existing shape key and press Copy Driver, the right click the new shape key and press Paste Driver.
    3. Generate HD mesh with “Import base morphs” and “Copy other meshes” enabled.

    The drivers work fine on the HD mesh. Could you explain the process you are following more closely?

  12. Maneki

    I’ll look deeper later but I basically imported a morph I already have to blender, then adjusted it by sculpting, exported the morph as obj and applied it to a base G9. Afterwards I ERC rigged those morphs and tried to import them on the HD mesh. But the issue that shapekeys don’t seem to work in a certain scenario even appears without the Daz forth and back. I take a look tomorrow if I’ve a general issues of custom sculpted morph with drivers not working or just with a very specific process.

  13. Maneki

    If I remember correctly, the HD addon also transfered vertex groups, weight maps and attributes in the past but it doesn’t seem to appear to transfering them anymore.

    EDIT: To make the weight or color attributes transfer well, the base mesh needs a subD modifier of the same subD like the true HD mesh with simplify turned off otherwise the maps are jagged.

  14. Xin reporter

    DAZ filed copyright notices against the ZBrush plugin and has been taken down from Artstation. I will publish it in another market if Artstation refuses to follow the law, since reverse engineering is fair use. Not my fault that DAZ has no competitive advantage and wants to profit off artificial barriers.

  15. Vincent Burmeister

    Wow, until now I didn’t even know the Zbrush plugin existed. That’s super awesome. My utter respect for not backing down to DAZ. Please share the info here when the Plugin is up again on artstation or elsewhere, I definitivly want to buy it.

  16. Alessandro Padovani

    Historically DAZ has always been “strange“ over competition, for example it is a TOS of their forums that it is not allowed to link or talk about competitive products, you can be deleted or even banned for that. This is unique to DAZ I didn’t witness such behavior in any other site. That they even attack fair competition on other sites is new.

  17. Azaz

    I have a question if the addon has options to create partial morph or be able to isolate and save only the created changes.
    I care about creating corrective morph and if there is a symmetry option for example I have a morph where thighs in A-pose position overlap and I would like to mirror according to -x axis .
    For any answer thanks in advance.

  18. Xin reporter

    Azaz, the addon itself doesn’t have any tools that facilitate it, but you can achieve that by using Blender’s native tools in combination with the addon. For example, by using a shape key for the original morph, and a new shape key for the modification. Then you could create a morph from the modification only.

  19. Balkazzaar

    Are there some simpler and easier step by step tutorial to follow on how to use the HD addon with daz importer?

    I am using a Victoria 8 HD model with vascular definitions to show muscle and veins and i dont know and dont see any dhdm files in daz associated to that.

    Would anyone care to show a simple step by step on how to import an HD G8F character into blender using Xin’s addon and daz importer addon?

    Please and thank you.

  20. VZEWL

    Whenever I export a 16-bit PNG Displacement texture from an HD morph, it always comes out middle grey. There’s no information and my file size is always only 40 KB in size even though it take about 5 minutes to export. I got it to work once yesterday, but since then no other morphs work and even when I tried the one that did work, it wont work now.

    For further context I have a Victoria 8.1 figure exported at 0 subdivisions. I have my “Component” set to both and I have my Start SubD’s at 0 and my Max at -1 to use the full range. This is also just the scalar displacement in the “Normals/Displacement” settings.

  21. Xin reporter

    Balkazzaar, the included .pdf has step by step examples.

    VZEWL, I would need more details to understand the issue. In any case, try to follow the normals generation example in the .pdf, since that example applies with minor changes to grayscale displacements. If you still have issues, upload a .blend.

  22. VZEWL

    So it seems to be working. I have no idea what could have caused it. Imported a newly exported Genesis 8.1 base model today, works flawlessly. I will let you know if and when I can recreate the issue with more information, I appreciate the response.

  23. Maneki

    @VZEWL make sure to set the texture node manually to “non-color”. I don’t know if that is a bug in recent Blender version, but I myself noticed when I import skin maps and the node sets it automatically to “sRGB”, it’s not actually set to sRGB and it looks really off. When I select sRGB manually again it looks as it’s supposed to be.

  24. VZEWL

    @Maneki Thank you for the tip, I did already know it but unfortunately that isn’t where the issue was occurring. It was during the creation o the maps, in my working directory the maps had no information. It seems to have resolved itself for now.

  25. Maneki

    Color Attribute Maps on the Base Mesh cause a error when I try to convert it into a HD mesh with the HD addon.

  26. Xin reporter

    Maneki, thanks for reporting that. What do you use those color maps for? to properly transfer those maps would require changes to the C++ code too, so it will take some time to implement that if they are really needed.

  27. Maneki

    I generally use color maps/attributes for multiple cases but in this case it’s to dynamically map skins/ vector displacements.

  28. bouich jules

    Hello Xin,

    For a specific VICTIORIA 9 HD model i am getting this crash, when i try to generate the HD mesh any idea why please?

    Thank you!

  29. bouich jules

    Hi Xin,

    Thank you so much for your quick reply,

    i did try again multiple time with the last version on gitlab

    I have this error unfortunately .

  30. bouich jules

    when i delete my shapekeys the crash dont happen. it’s really weird because need all my shapekey ;P

  31. Xin reporter

    It’s an issue with a specific .dsf file, so if you could share the conflicting .dsf, that would help.

  32. Xin reporter

    Could you download the latest version from gitlab and paste here what the console says when the error happens?

  33. bouich jules

    The error is still there, i downloaded the latest version from gitlab.

    I believe its the same error except in line 339 instead of 338 .

  34. Xin reporter

    yes, the error will be the same, but if you look at the console output (by going to Window > Toggle System Console) it should print the filename of the file that is causing the issue.

  35. bouich jules

    Hi Xin,

    I think i figured the problem it’s a bunch of dsf that are causing this issue. here is the error:

    But actually the funny part is when i move all those morph to another folder, the error doesn’t show up anymore, and everything is fine, it seems the error happen only for that specific daz folder.

    Very weird, but all good now that i moved all my morphs to another folder.

  36. Maneki

    Xin, were you able to fix the color attribute issue yet?
    I also got another error: Is it normal that Displacement Maps (not vector) can’t be generated as EXR? PNG works but EXR (32 bit) gives a error.

  37. Xin reporter

    The color attribute thing would be a new feature so I will look into it whenever I have more time. First I will look into the EXR issue for grayscale displacements, because they should work.

  38. Xin reporter

    Hi, between work and studying I have been quite busy lately, but I will look into those issues as soon as I can. Also, I will need to move away from .collada files since they will be discontinued in future versions of Blender.

  39. Guang Yang

    I'm having some problems with the v1.0 blender plugin, I'm trying to merge all the hd morphs into a new morph, the subdivision level is 4, the hd morphs are imported via diffeomorphic, is the settings wrong?

  40. Xin reporter

    Could you try doing it at subdivision level 3 instead? I can’t test subdivision level 4 because my hardware can’t handle it. Also try version 2.0.0 of the addon too (in gitlab, select the v2_0_0 branch).

  41. Alessandro Padovani

    I would add that, for fine details as the example above, it is much easier to export the HD shape with diffeomorphic, then import as multires and bake to normal maps. Or you can keep the HD shape via multires, that’s improved for difficult meshes with the recent commits, see #2112. The Xin addon is not needed for that. While the Xin addon is essential to import HD morphs, as HD face expressions for example.

    Unless you do need the fine details as a morph instead of a shape, to apply to the figure for a “transformation“ effect. In that case the Xin addon can work better.

    https://bitbucket.org/Diffeomorphic/import_daz/wiki/Advanced/HDMesh/Bake Maps

  42. Guang Yang

    I tested subdivision level 3 in blender 4.1 daz4.22 and the daz character did not have any hd morphs applied and was not sculpted after importing using diffeomorphic, the V1.0 plugin had the same problem and the V2.0 plugin seems to have messed up the vertex order.

  43. Xin reporter

    Could you share a blend file just before the generation? I believe the base mesh you are using might not be the base mesh the addon expects.

  44. Xin reporter

    I did a quick check, but will continue checking it later. Your mesh seems weird, it seems to have the correct vertex and face order, but the edge order is different than what I get by importing a genesis 8.1 female base mesh. If I continue with that mesh I have no problem, but your mesh does produce incorrect results, I suspect it’s due to the wrong edge order, but I’m not sure where that is coming into play because the addon doesn’t depend on edge order, or at least it’s not clear yet to me.

  45. Guang Yang

    I tried importing base mesh A and hd mesh B separately using diffeomorphic and then applying the multires modifier to base mesh A. Although the vertex order of the base mesh is the same for both, it is not the same after applying the multires modifier, mesh A generates the correct dhdm and mesh B does not. the multires modifier seems to be influenced by certain properties of the mesh and diffeomorphic or daz changes those properties.

  46. Xin reporter

    Thanks for checking it. The addon does rely on applying the multires modifier to the base mesh (the “matching files” in previous versions or the pre-generated files in version 2.0.0 are based on that), so if that depends on edge order, then it will produce wrong results if the edge order is not the usual one. Will verify it later.

  47. Log in to comment