strange uv issue with some hd assets

Issue #1861 open
Alessandro Padovani created an issue

daz studio 4.21.0.5, blender 3.6.5, diffeomorphic 1.7.3.1936

It is difficult to reproduce this issue because it seems to only happen with specific assets. Below an example where I imported the hi-topz sneakers at subdivision 2, this way the uv map is lost and reverted to single polygons. If I export at subdivision 1 everything works fine.

This may be a issue with multires, but I don’t get any error here in the console with verbosity 3. Plus the geometry seems to be imported and unsubdivided correctly so this is only a issue with the uv map that is lost.

Other assets that I tested work fine, so this may also be some issue in the daz asset geometry, but again no errors in the console, as for example when blender has to fix bad geometry on import.

steps (doesn’t work):

  1. in daz studio export the test scene topz-hd as HD
  2. in blender import as dbz, the uv map is lost

steps (works fine):

  1. in daz studio change subdivision to 1 for the test scene topz-hd and export as HD
  2. in blender import as dbz, the uv map is fine

Comments (12)

  1. Thomas Larsson repo owner

    It appears that when the multires modifier rebuilds subdivisions, the vertex numbers are not always preserved. So the multires and the base vertices can be numbered differently, even though the topology is the same. In that case the uv layers cannot be copied from the base mesh. Or at least it would require a lot more work, to identify the base and multires vertices.

    You can avoid this issue by turning off Multiple UV Layers. Then the uv layer is created automatically from the HD uvs when subdivisions are rebuilt, and there is no need to copy uvs. The downside is or course any additional uv layer will be missing.

    In the last commit the plugin raises an error if this happens, with a suggestion for the remedy.

  2. Alessandro Padovani reporter

    Commit 59aea45.

    Thank you for looking into this. Disabling multiple uv layers and exporting the HD uvs worked fine as a workaround, of course it is not ideal. Instead of copying the uv from the base mesh, which requires the vertex order to be the same, in blender we can transfer the uv by topology. I tried it with the test scene and seems to work fine, this way we transfer the uv maps from the base mesh to the multires mesh by topology.

    Let me know.

    object > link/transfer data > transfer mesh data > uv

  3. Thomas Larsson repo owner

    Thank you, this works very well. The plugin now uses this operator to transfer both uv maps and vertex groups to the hd mesh. This simplified the code quite a bit, and seems to work both for the topz and the persian full top, which cannot be turned into a multires.

  4. Alessandro Padovani reporter

    Commit ccd9a3b.

    Unfortunately mapping corners by topology doesn’t seem to work fine. I was fooled because the uv map looks fine, but when we render the uv corners are flipped in most cases so the texture looks scrambled.

    In my tests the best transfer I could find is by proximity, in this case the texture looks fine, but the uv map has some errors in the islands. I tried to set the islands precision to 1.0 but didn’t get better.

    • face corner: nearest corner best normal
    • face: nearest face

  5. Alessandro Padovani reporter

    note. May be we can use the “nearest corner“ method for now, then warn the user that copying uv maps wasn’t possible. I’ll let you know if I find anything better.

  6. Thomas Larsson repo owner

    Maybe we should revert to the previous commit. With Multiple UV Layers enabled, the uvs were right in most cases, and when it doesn’t work the user is informed about it. If disabled, the uvs are always correct, I think. Only a single layer is imported, but that it enough for most meshes.

  7. Alessandro Padovani reporter

    Yes whatever you choose is fine for me, since there’s not an ideal solution anyway. The workaround requires the HD uvs, that slows down the exporter and doesn’t work for shells, but it generates a correct uv map when available.

  8. Thomas Larsson repo owner

    I reverted to the previous commit yesterday. If the plugin fails to transfer an uv layer, the user can always try to transfer data from the base mesh to the hd mesh with Blender’s built-in tool. That can be used for shells as well. Export the HD figure from the geometry editor, and save a copy of the duf file in the scene navigator to get the materials with shells. Import both files into Blender. Transfer uvs from the base to HD mesh to get the shell uvs, and copy materials from the shell mesh to get the materials with shells. Not very straightforward, but all tools are readily available for the advanced user.

  9. Alessandro Padovani reporter

    Yes, would be ideal to correctly import the HD uvs without the user having to fix it, but it appears this is a limitation in multires we have to deal with. To recap, multires has limitations both with geometry that may fail to unsubdivide, and with the uv map that may fail to match with the base mesh, even when unsubdivision and topology work.

    I’m leaving this open and marked as task together with the other blender limitations, for the user to be aware of.

  10. Log in to comment