Bad foot deformation when converting rig and using the option (Keep DAZ Rig) MHX

Issue #1658 resolved
DomDomk created an issue

User versions: Blender 3.6.1 + Diff 1.7.1.1703 + Mhx 1.7.1.0082

Steps to reproduce:

Import DAZ : GF81

-Select the rig and convert to MHX, leaving the default parameters with the Keep DAZ Rig option checked.

Screenshot : https://ibb.co/zVWsJRW

The foot is totally deformed.

hwever this does not happen to me doing the same steps with some older versions that I tested.

Screenshot: https://ibb.co/H71XXns

User versions: Diff 1.7.1.1666 + Mhx 1.7.1.0078

I hope it won't just happen to me.

If I may ask, is there any way Thomas, if you get this bug, you could include the fixes in your stable versions, so you can update the links on your blog? If it's not too much to ask?

Thank you very much for all you've done!

Comments (21)

  1. Alessandro Padovani

    daz studio 4.21.0.5, blender 3.6.1, diffeomorphic 1.7.1.1703

    Yes I can confirm the issue. The foot and metatarsal bones seem to be disconnected.

    steps:

    1. import g8f or g81f it’s the same
    2. convert to mhx keeping the daz rig
    3. pose the leg with the foot ik control

  2. Alessandro Padovani

    update. solution for @Thomas Larsson

    The bug seems to be that the daz rig uses “local with parent“ to copy transforms. While this is good in general, it’s not good for ik targets that has to be copied in “pose space“. This includes hands and feet. Also I’d advise to use “local“ in general, and only use “local with parents“ where the mhx and daz hierarchy is different. Same for rigify.

  3. Thomas Larsson repo owner

    I didn’t see your post before addressing this problem. My solution is to use copy rotation constraints instead of copy transform, except if translations are unlocked (hip and face rig). However, this doesn’t work if translation are unlocked, or for scalings, so your proposal may work better.

  4. Thomas Larsson repo owner

    In the last commit I use copy transform constraints in pose space for hands and feet, and in local space if the parent bone corresponds to the mhx parent.

  5. Alessandro Padovani

    update. about retargeting the daz rig.

    Unless I miss something. In general I believe we should connect bones in the daz rig. Otherwise rotations in the control rig become rotations + translations in the daz rig and this is not good to save pose presets. This is also why we need copy transforms instead of copy rotations. As we noted some time ago connecting bones is safe for daz poses and jcms, at least if we don’t use “daz orientation“. Once we connect bones then copy rotations should be safe, apart ik targets. Let me know what you think.

    Below the rigify deform bones as octahedral vs the daz bones as stick, using copy rotation without connecting bones.

    p.s. Then the pose preset is good with copy transforms because it also includes translations. That’s why we have to unlock the figure in daz studio. So the above proposal is rather an “optiimzation“ to avoid translations in the pose preset, apart ik targets.

    p.p.s. I see I wasn’t clear above sorry. About “local“ and “local with parents“ I was referring to copy rotations. If we use copy transforms then it doesn’t matter since translations are copied too, so we could always use “pose space” it doesn’t make any difference.

  6. Alessandro Padovani

    Commit 63e1349 doesn’t work fine.

    It only copies transforms for feet not for hands. All ik targets need to be fixed.

  7. Thomas Larsson repo owner

    I forgot to commit the last changes, so what I talked about above didn’t exist on bitbucket. Now it does. There was also a bug with the hands, because there is an extra bone (hand0.L/R) that makes it possible to twist the forearm by rotating the hands, both fk and ik.

    We want the daz rig to be exactly as it is in DS, without changing the orientation of any bone. But the mhx rig is changed in various ways, e.g. the bend and twist bones are perfectly aligned. Hence we cannot use copy constraints in pose or world space, because that would mean that already the mhx rest pose would yield a posed daz rig. Local with parent avoids that. We can always tweak the daz rig later when the control rig has been muted.

  8. Thomas Larsson repo owner

    Of course you can connect bone chains before converting to mhx. Then the new rest pose is closer to the mhx rest pose, especially if you turn off elbow and knee fix, and using constraints in pose space makes more sense. But there is still a small difference in rest poses, and the deform rig is not exactly the same as in DS.

  9. Alessandro Padovani

    Commit a1d16cb works fine for mhx. I also tried to export some pose presets and there’s no jittering for hands and feet.

  10. Alessandro Padovani

    daz studio 4.21.0.5, blender 3.6.1, diffeomorphic 1.7.2.1709

    bug. rigify with keep daz rig.

    There’s a bug with rigify. We see that the foot is compressed when the ik control is used. This is because rigify uses copy rotation that can’t be used unless we connect bones as explained above. To fix the bug we can use copy transforms instead same as now we do with mhx.

    Also please note that copy transforms can be done in “pose space”. There’s little sense doing it in “local” or “local with parent”, that’s for copy rotation. Using copy transforms we then need to unlock the figure in daz studio to import the bone translations in the pose preset, but we have to unlock anyway for ik targets.

  11. Alessandro Padovani

    daz studio 4.21.0.5, blender 3.6.1, diffeomorphic 1.7.2.1709, mhx 1.7.2.0083

    bug. mhx with keep daz rig.

    Again, please note that copy transforms as “local with parent“ is wrong, that makes sense only for copy rotation. Below we can see the metatarsal bones in MHX that are misplaced because they use “local with parent“, we have to use copy transforms in “pose space“.

    Please use copy transforms in “pose space” both for mhx and rigify. Or let me know if I miss something.

  12. Thomas Larsson repo owner

    Now copy transform in pose space is used for most bones. Exceptions:

    1. Face bones use copy transform in local space. The face bones are the same in the control and deform rigs, and I ran into problems with pose space.
    2. Rigify spine bones copies transform in local space, because the difference in rest pose is too big. MHX spine uses pose space.
    3. Rigify hip and toes copies rotation in local space with some axes reversed, since the orientations are completely difference.
    4. Metatarsals and rigify pelvis don’t copy rotation at all, but rely on parenting.

    Using pose space means that we cannot save a zero pose, because the zero pose for the control rig is not zero for the deform rig. But that is perhaps not a big problem, since we don’t need an advanced rig to make a zero pose preset.

  13. Alessandro Padovani

    Commit 9d46c95.

    bug. rigify toes. There’s a bug in the rigify toes that get inverted.

    note. bug. important. Then I’d rather use a copy transform in pose space because copy rotation does gitters.

  14. Alessandro Padovani

    note. daz rig viewport display. As a “aesthetic“ suggestion, in general we may want to display the daz rig as octahedral, with wire in front. This makes it similar to daz studio and also takes it apart from the blender rigs. This is minor.

  15. Alessandro Padovani

    Once the toe bug above is fixed the mhx and rigify rigs work fine to save pose presets. The feet compression in rigify is fixed. Please note that for rigify we don’t have to change the rest pose, also minor gitters happen for the toes but I guess this is unavoidable due to the differences with the rigify rig. Unless we want to try to connect bones first.

    steps:

    1. load pose-rigify.blend
    2. select the daz rig and save the pose preset, the control rig is already muted
    3. in daz studio unlock g8f and load the pose preset

    request. translation/rotation/scale options.

    Other than “use scale”, in some situations it may be convenient to have the option to export translation/rotation. For example if one wants to export an animation with only rotations, so that it doesn’t require to unlock the figure in daz studio, though there may be some gittering.

    • use translation
    • use rotation
    • use scale

  16. Thomas Larsson repo owner

    Back from the wilderness. Or at least back from our summer house, which doesn’t have internet access.

    The root cause of the problem is that the toe bones are oriented differently. In the daz rig, the local X axes for the leg bones (thigh, shin, foot, toe, small toes) all point to the right. In the metarig and hence rigify, toe X points to the left, but the other leg bones are oriented as in the daz rig.

    I tried to compensate for this difference by adding a copy rotation constraint in local space with X and Z inverted, which amounts to a 180 degree rotation around Y. Copying rotation in pose space is not good, because it messes up the foot in rest pose:

    The cleanest way to overcome the problem would be to change the orientation of the toe bones in the daz rig, to make the toes oriented as in the metarig. Remember that the bone axes in Blender are flipped compared to DS, to ensure that local Y always points along the bone. But I don’t want to do that because it may cause complications all over the place, in particular in existing files with the daz or mhx rigs. And it is really rigify that does something strange here. I think it is much more intuitive if local X points in the same direction for all leg bones. And I’m not sure how the orientation was in previous rigify versions.

  17. Alessandro Padovani

    Welcome back. Here the weather is fine and we’re enjoying a nice summer too, especially on weekends being near the sea.

    As for the toe issue it happens if we don’t optimize/align the figure so to don’t change the rest pose, that’s necessary to export pose presets with rigify. In that case the toes are reversed as shown above in my previous post. I can confirm that with optimize/align everything works fine as you noted.

    Here I can resolve the issue using copy transforms in local space with owner orientation, that seems to always work fine with and without optimize/align.

  18. Thomas Larsson repo owner

    The plugin now uses copy transform in local space with owner orientation for hip, spine, and toes, i.e. the bones where the daz and rigify orientations differ significantly. Other bones use pose space to keep the pose together.

    Nice find, btw. I didn’t know about this option. It seems to be new in Blender 3.0, so the Blender 2.83 and 2.9x version still uses the old code.

  19. Log in to comment