HD Eye Bones don't work after importing.

Issue #1221 resolved
Jay3DM created an issue

When importing a mesh through HD, the eye bones never work in Blender. They only work when importing non-HD. This is unfortunate because the HD eyes are much better with a lot more verts. If you could take a look into this, that would be great!

Comments (16)

  1. Jay3DM reporter

    If you can’t re-create this, try setting the subd in Daz of the eyes to 3, and then import the entire mesh through HD.

  2. Thomas Larsson repo owner

    The problem is that the HD eyes don’t have any vertex groups. The plugin copies vertex groups from the base mesh to the HD mesh, but in order to do so the HD mesh must be converted to a multires mesh so the vertex count is the same for both meshes. When the import is completed the plugin issues a warning that it failed to rebuild subdivisions, so vertex groups couldn’t be copied.

    In fact, in this case rebuilding subdivisions worked too well. The multires modifier got four levels, i,e. one more than the number of subdivisions in DS. So the vertex count was off because the multires mesh has fewer verts than the base mesh. This happens because you could add a multires modifier to the base eyes and rebuild one subdivision. Never seen that before.

  3. Thomas Larsson repo owner

    Fortunately, it is straightforward to fix this in Blender. The general method goes like this:

    1. Enable the global setting Keep Base Meshes (just under Build HD Meshes).
    2. Copy vertex groups from the base eyes to the HD eyes with Advanced Setup > Meshes > Transfer Vertex Groups.

    However, in this case you can easily assign the vertex groups by hand, since there are only three of them:

    1. Rigidity. weight = 1 for all verts.
    2. l_eye: weight = 1 for left eye verts, weight = 0 for right eye.
    3. r_eye: the opposite.

  4. Alessandro Padovani

    @Thomas, since G9 is supposed to work only in HD mode, and it is the new main figure, perhaps it is worth to make a “custom fix“ for the G9 eyes so that the user don’t have to fix it by hand every time.

    note. Personally I don’t like G9 at all and I foresee it will be a lot of troubles for blender, I mean if we want the full features. The point is G9 can’t work without HD, so a full integration of the Xin addon and HD morphs would be required. Or you may also leave G9 to the Xin addon entirely, that actually means a lot of manual work to make the HD figure work.

  5. Thomas Larsson repo owner

    The last commit adds vertex groups to the G9 eyes. It is not elegant, because the plugin explicitly recognizes the eyes, but I didn’t find a more general solution.

  6. Alessandro Padovani

    Commit 8f85b0f works fine here thank you for the fast fix. In this case I believe there’s no general solution so a custom fix for G9 is good. If there’s nothing to add we may mark as resolved.

  7. Thomas Larsson repo owner

    For this reason multires is always disabled for the Genesis 9 eyes in the latest commit.

  8. Alessandro Padovani

    One possible solution could be to limit the unsubdivide levels for multires to the viewport subdivision in daz studio. This may also be a generic fix not only for G9.

    For example the daz viewport subdivision for the G9 eyes is 1. While the current commit unsubdivides the G9 eyes two times instead of one. Once the eyes have the correct 1x unsubdivision then it’s possible to trasfer the uv map from the base mesh, same as the other HD meshes.

    Let me know what you think.

  9. Thomas Larsson repo owner

    The HD eyes should work now. Instead of rebuilding subdivisions from the HD mesh, I make a copy of the base mesh and add a multires modifier to it. This loses info from higher levels, but in the eye case I don’t think there is any.

  10. Alessandro Padovani

    @Thomas that makes no sense. The only purpose of multires is to bake the HD details, if we don’t then we can use the base mesh that’s the same. The fix I proposed above works in the general case, did you try it ? I tried it myself and works fine here. Let me know if something is not clear so I can help.

    steps:

    1. import the base and HD meshes
    2. add multires to the HD mesh and unsubdivide from the daz viewport subdivision, that's 1x for the G9 eyes
    3. copy vertex groups from base mesh to HD mesh (vertex groups > copy vertex group to selected)
    4. copy uv maps from base mesh to HD mesh (object > link/transfer data > copy uv maps)

  11. Thomas Larsson repo owner

    No, I don’t understand how that could work. When the eyes are unsubdivided, we end up with a mesh which has -1 subdivisions compared to the daz base mesh. How many subdivs we start from doesn’t matter; it could be 0, 1, 2 or more, the multires mesh has always a quarter of the number vertices compared to the base mesh. What we would need is a means to tell the multires modifier to stop unsubdividing after a certain number of levels; the levels should be around 2-log(sqrt(#HD verts/base verts)).

    If one can set the vertex locations at the top level one could copy them from the HD mesh. There should be some way of doing it - the scult tools do - but I haven’t figured it out.

  12. Alessandro Padovani

    “What we would need is a means to tell the multires modifier to stop unsubdividing after a certain number of levels”

    That’s exactly what I’m explaining above. With multires we can unsubdivide one step at a time, so we can match the daz viewport subdivision. Don’t use “rebuild subdivisions“, just use “unsubdivide“. For example if the daz viewport subdivision is 3x then you need to unsubdivide 3 times.

  13. Thomas Larsson repo owner

    Thank you for this. Implemented in latest commit. The plugin still rebuilds subdivs by default, and only resorts to unsubdivide if that fails.

  14. Log in to comment