Does MHX rig has too much Dependency cycle normal in blender?

Issue #1498 resolved
Edward lee created an issue

it really slow down the playback speed in blender viewport, from 60fps to 5 fps

Comments (25)

  1. Alessandro Padovani

    Can’t reproduce the issue here. Be sure to update both the plugin and mhx to the dev version and do a clean install. Then if the issue stills there provide the exact steps to reproduce the issue and possibly a test scene in duf format as simple as possible.

    If there are no news I’ll close as invalid.

  2. Thomas Larsson repo owner

    This is a problem with the combination finger IK, posable bones, and (mhx-compatible) body morphs. There was an analogous issue with tongue IK which was fixed somehow. I thought the fix also applied to finger IK but evidently not.

    https://bitbucket.org/Diffeomorphic/import_daz/issues/1387/mhx-tongue-ik-creates-a-cycle-and-does-not

    The mhx-compatible body morphs are in fact only compatible with mhx without finger IK. There should be a way to detect this.

  3. Alessandro Padovani

    Yes Thomas I can reproduce the issue from your description.

    steps:

    1. import G8F and merge rigs
    2. import mhx compatible body morphs and make all bones posable
    3. convert to mhx with finger and tongue ik

    Since IK and body morphs are mutually exclusive, the tooltip correctly reports that body morphs will be removed. But this doesn’t seem to happen, that is, even if we choose the IK options the body morphs are not removed thus causing the cycles.

    A probably simpler way would be to do the opposite, that is, if there are body morphs then IK is not generated.

  4. Thomas Larsson repo owner

    Fix in last commit. The plugin removed copy location, rotation and scale constraints, but at some point we changed that to copy transforms constraints that were not removed.

  5. Alessandro Padovani

    bug. As for commit bcd7c47. The finger and tongue morphs are not removed, though they don’t work so cycles are not generated anymore.

  6. Thomas Larsson repo owner

    Some cleanup: drivers and driven bones are now removed. The properties themselves remain, but there is a warning about disabled morphs.

  7. Alessandro Padovani

    The tooltip still tells “Finger morphs will be removed“ that’s not the case. The morphs are disabled in that they don’t work but are there nonetheless. I don’t think the new extra warning with the list of non-working bones is useful, since there’s already the warn in the tooltip.

    tooltip: “Generate IK controls for fingers. The MHX compatible body morphs for fingers will be disabled.“

    As suggested above, you may want to do the opposite and generate IK only if there are no body morphs. This way the user knows that body morphs must not be imported if he wants IK. Because it makes little sense to generate a rig with morphs that are listed as properties but not working.

    tooltip: “Generate IK controls for fingers if there are no MHX compatible body morphs. Since IK and body morphs are incompatible.“

    Let me know or I’ll close as resolved since the tool works as intended. Please fix the tooltips.

  8. Thomas Larsson repo owner

    I agree that it is better to disable tongue and finger IK if the bones are driven. Implemented in last commit.

  9. Alessandro Padovani

    Commit fe9da14. Some issues I noticed.

    1. tongue. I see the tongue IK scales the whole tongue in all axes if dragged, you probably want to scale only along Y.

    2. MHX interface. Even if finger or tongue IK are disabled the user can still check the IK options in the MHX panel, though they do nothing. It would be better to disable the IK options in the MHX panel.

    3. tooltips. The tooltips for finger and tongue ik still tell “morphs will be removed“ so they need to be fixed.

    Finger IK tooltip: “Generate IK controls for fingers if there are no finger morphs. Since IK is not compatible with driven bones.“

    Tongue IK tooltip: “Generate IK controls for tongue if there are no tongue morphs. Since IK is not compatible with driven bones.“

  10. Thomas Larsson repo owner

    I agree that would be better to only scale the tongue around Y, but I don’t know how to do that. The only parameter that seems to affect scaling is IK stretch, but that doesn’t distinquish between different axes.

    It could probably be achieved by adding an extra layer of tongue bones and some constraints or drivers, but do we really want that.

  11. Alessandro Padovani

    It is possible to do it with a series of stretch to constraints, wll not be ik though. Below I extruded some bones for the stretch targets and parented them to lower teeth. The stretch targets can be used to deform the tongue as needed.

  12. Alessandro Padovani

    Another possibility, keeping the IK, is to disable IK stretching then scale the tongue. The solution with stretch constraints is far more easy to pose though.

    • disable IK stretching
    • set tongue02-04 to inherit scale aligned
    • lock tongue01 to scale Y
    • move the ik target and scale tongue01

  13. Thomas Larsson repo owner

    OK, it turned out to not be too difficult. Now there is tongue IK using stretch-to constraints.

    I’m a bit unsure what the best setting for volume preservation is. Currently it is set to XZ.

  14. Alessandro Padovani

    Commit 4155f56 works as intended.

    Let me know if you don’t care about the notes below so I’ll close as resolved.

    As for the volume option, personally I’d set it to none as in the example above. Because if we preserve volume then the tongue will shrink the more we stretch it that’s probably not what we want.

    I see you stretch the deform bones to the IK chain that works as intended. But as noted above, personally I believe this way the tongue is hard to control it is much better to use the stretch targets alone without IK, as in the example setup above.

    This is already reported above in point 2 MHX interface. Even when IK is not generated, the user still can check the tongue and finger IK in the MHX properties panel. This way the user sees working properties that do nothing. It would be better to disable the checkboxes.

  15. Thomas Larsson repo owner

    Implemented in last commit. The option should be renamed, however, since it does not use IK anymore.

    Perhaps one should use the same technique for the fingers as well. I find the current finger ik setup pretty much unusable.

  16. Alessandro Padovani

    Commit bd68853 works great thank you Thomas for the fast fix and nice improvements.

    As for the “Tongue IK“ name, I agree it is not strictly correct, but from a user perspective it makes little difference because the controls are IK-like since they use targets.

    As for the fingers, differently from the tongue they don’t stretch so I don’t think using stretch constraints would be a good idea. Unless I misunderstand what you mean.

    If there’s nothing to add we may close as resolved.

  17. Thomas Larsson repo owner

    The fingers don’t stretch, that is true, but it is often important to pose them exactly. The tongue usuallly does not interact with other things except perhaps the lips, but the fingers may grab something and then we want to pose them exactly relative to the other object. Anyway I have never used finger IK myself (it was introduced because somebody requested it), but if I can place the finger joints exactly I might.

    It should be possible to do IK-FK snapping for the tongue and fingers too.

  18. Alessandro Padovani

    I never used the finger IK as well. My own opinion is that fingers are best posed with FK eventually helped by auto-ik, while the IK target is on the hand that keeps all the fingers in place. I can’t imagine why someone has requested IK for the fingers but may be there’s some specific use for it.

    Of course this is just my way of seeing things, having extra options doesn’t harm.

  19. Thomas Larsson repo owner

    FK-IK snapping for fingers and tongue has been implemented. I will write something about it later, but the way I intend to use it is as follows:

    1. Do rough posing with fk fingers.
    2. Snap ik fingers.
    3. Tweak the location of the ik fingers so the hand is grabbing the object precisely.
    4. Snap back to fk if we want to save a pose preset.

  20. Alessandro Padovani

    Commit 5986450 works as intended.

    Personally I don’t think I’ll ever use stretching fingers but it may be a nice special effect in some situations.

    may be bug (minor). Also I noticed that fingers ik are checkboxes while tongue ik is a slider, is this a bug or there’s a reason for that ? I mean if you want to drive the influence then it should be sliders both for fingers and tongue, and you also have to keyframe when auto keying is on. But I believe this is a unnecessary complication in this case and influence can just be 1.

    update. errata corrige. Sorry I didn’t update the mhx addon, I see now fingers are sliders too. Should keyframe with auto keying imo.

  21. Alessandro Padovani

    Commit 296c246.

    bug (minor). The MHX tooltips still tell that IK and morphs are not compatible, that is no more the case.

  22. Log in to comment