bad hd mesh

Issue #733 resolved
Alessandro Padovani created an issue

daz studio 4.15.0.2, blender 2.93.4, diffeomorphic 1.6.1.0637

It seems the HD meshes for outfits are not exported correctly. Below an example with the persian top for G2F where I subdivided the outfit in daz studio. I get an error for vertex weights and the uvs are scrambled. Test scene included persian-hd.duf.

steps:

  1. Export the test scene persian-hd.duf as HD, with or without the HD uvs it's the same.
  2. Import in blender and render.

Comments (16)

  1. Thomas Larsson repo owner

    Apparently the original and multires meshes do not have the same topology in this case, so the failure to copy vertex groups is correct. The Print Statistics tool gives the following results:

    Object: PersianFullTop.001
    Verts: 42769, Edges: 85128, Faces: 42748

    Object: PersianFullTop_HD
    Verts: 43951, Edges: 85128, Faces: 41566

    So the number of edges is the same, but the HD mesh has more vertices and fewer faces than the original. If we import the true HD mesh, it has the following statistics:

    Object: PersianFullTop_HD
    Verts: 170645, Edges: 338096, Faces: 167840

    Adding a multires modifier and rebuilding subdivisions indeed gives the multires mesh above, which differs from the original.

    So this problem is caused by Blender's multires modifier. Not a bug, since there is no reason why it should give back the same mesh that we started from in DS. That it does work for many meshes is just dumb luck, but we weren't so lucky with this mesh, probably because it consists of many disconnected parts. Or because of the triangles at the top of the beads.

  2. Thomas Larsson repo owner

    Yup, seems to be the triangles that are the culprit. Multires apparently replaces them with n-gons if it can. I don’t think there is much to do about it, because I didn’t find any setting in the multires modifier that could change the behaviour.

  3. Alessandro Padovani reporter

    Thank you Thomas for the explanation you found out, that’s very useful to know. So multires doesn’t work fine when the original base mesh gets triangles. May be this is not an issue with real HD figures if they are all quads, may be it only happens with subdivided meshes that we export as HD.

    I’ll leave this open for a while in case someone gets any idea. Then if we don’t find any workaround it’ll be good to mention this limitation in the docs.

    So as a rule of thumb we have to export to HD only real HD figures, and as subd the subdivided figures.

  4. Alessandro Padovani reporter

    Thomas, as a simple workaround, may be we can delete the HD mesh if vertex maps can’t be transferred. Since the resulting mesh is unuseful anyway. That is, if there’s a vertex error then it means the base mesh gets triangles and so that’s probably a subdivided mesh, not a HD mesh.

    This could also be an option in the global settings, something like “delete broken multires“.

    This way the HD importer may convert to multires only the HD meshes and leave as subdivision the subdivided meshes. Or at least the user doesn’t have to delete all the bad multires meshes himself.

    Then I don’t know if there’s a way to distinguish HD meshes from subdivided meshes. So that the HD exporter always exports HD as HD and subd as subd.

    Please let me know what you think. Then may be someone else gets a better idea.

  5. Thomas Larsson repo owner

    You can still use the transfer vertex groups tool, from base to multires mesh, so the multires mesh may still be somewhat useful. It is not so easy to guess what every user wants to do, and adding too much magic may ruin things for others.

    I don’t know if there is a way for the export script to distinguish between subdivided and HD meshes. It uses the cached geometry and the Mesh Resolution settings (the three first), and they seem to be the same for both types.

  6. Alessandro Padovani reporter

    As for the broken multires being somewhat useful I’m not sure to get it. If the vertex count doesn’t match then the uv map is broken too as shown above. How do we transfer the uv map ?

    As for ruining things for others I’m proposing an option to delete the broken multires, eventually with default off. Who wants to keep them wouldn’t notice a thing. But I agree this is not essential it would just help to deal with the broken multires issue.

  7. Alessandro Padovani reporter

    As for understanding if the figure is HD or not, I fear there’s no other way than scanning the duf file to check if it uses any dhdm. If the figure is using a dhdm morph then it’s HD, otherwise it’s not. This could be done on import, as I guess it’s harder to do with the daz script. So the HD exporter would always bake the viewport while the importer retrieves the HD or subd geometry based on the duf.

    Then I don’t know if this may be worth the effort. In the daz forum acdum1857 notes that most daz outifts are made with marvelous designer so it’s likely that they get some triangles around.

    https://www.daz3d.com/forums/discussion/524586/

  8. Thomas Larsson repo owner

    To check whether there is a dhdm file the importer must open the active morph files, which is not done unless mesh fitting is set to Morphed (Characters). But in the last commit I check whether the multires topology is right, and if not the true HD mesh is kept. I’m not sure if this is the best behaviour, or if we need a new setting.

    We don’t know for sure that a mesh with some triangles always generates a bad multires. It seems to be the case if we have many triangles together, but not necessarily if a single triangle is surrounded by quads.

  9. Alessandro Padovani reporter

    As I see it if multires is broken for some reason then it should be deleted to keep the subd mesh. That’s probably going to match daz in most cases. We already have the HD addon by Xin to deal with true HD anyway and it does it better.

    To keep the true HD mesh may only confuse the user more. Who may find in the imported HD figures a mix of subd and multires and true HD meshes.

    But, at the end, any option is viable. What it is needed is to explain this in the docs or the blog.

  10. Alessandro Padovani reporter

    daz studio 4.15.0.30, blender 3.1.0, diffeomorphic 1.6.1.0912

    With the provided test scene persian-hd.duf, there's an error that multires can't unsubdivide and the imported HD object renders black. That's a different behaviour than 1.6.1.0637 as reported above.

    Is this on purpose that now the unsubdivided HD is black ? I mean shouldn't the exported HD uv be used instead ?

    edit. There’s no uv map associated with the HD mesh.

  11. Thomas Larsson repo owner

    I don’t think anything has changed here for a long time. Do you have the same problem in Blender 2.93? HD import relies on the multires modifier, and maybe something changed with that? I will check when I get home tonight.

    A true HD mesh will not have UVs unless you export the HD UVs from DS.

  12. Alessandro Padovani reporter

    Thank you Thomas for looking at this.

    Yes I mean the HD uvs exported from DS. As for blender 2.93 it’s the same. If I uncheck “add multires“ in the global settings then the HD uv is imported correctly and the HD geometry renders fine.

  13. Thomas Larsson repo owner

    It should work now. If the multires mesh doesn’t have the same number of vertices as the cage mesh, the true HD mesh was used, but I forgot to add the UVs in this case.

  14. Log in to comment