MHX Stretch deform toggle option for each limb

Issue #525 resolved
engetudouiti created an issue

This is current MHX, which free move hand / foot IK with real stretch mesh deform.

Though we may not clear notice without you check hidden bone ( with def shape), when IK stretch, IK hand pivot have distance forarm tail. it is not problem it just how MHX rig work so. we can stretch as we like.

But it cause issue when snap FK to IK for strech pose, and try to pose with FK.

your character limb return as default FK bone length (Hand FK connected with FK forearm to avoid stretch), then show as if arm shirnk. It is annoying if you make smooth switch with real animation keys. (though actually you can smooth it , with IK influence value change)

And there is case, user not hope to stretch limb with IK, but hope perfect straight pose for IK limbs, (upper and forearm line), you may notice, keep perfect non stretch with IK is not so easy. So if there is option which can switch for each limb setting (R / L Arms and Legs) it is useful.

It can be easy done . I only need to change each original bones (hand.R , hand.L, foot.R, foot.L) connected with their parent bones in edit mode (or make custom script) , then IK never stretch, (but IK controller can move free still , it auto restrict, then can easy get straight limb pose without worry stretch deform. (and snap work perfectly)

At same time, there will be case, you may hope to get stretch deform, but hope to snap FK to IK correctly. why currently add on not work so, IK can move free, and deform as stretch, but FK bone is connected so we never see stretch deform with FK >> snap issue.

To snap FK to IK with IK stretch pose add on need to change hand.fk.R / L , foot.fk.R / L not connected with their FK parent. (andThomas need some edit, to confirm free move FK hand / foot can locate on current IK hand / foot, after that it should work without snap issue)

Then we need one of 2 option.

stretch and deform for FK and IK / Never stretch and deform for FK and IK

Current MHX rig (at least when I convert with default options), (small issue)

IK limb can stretch , and we can free move IK controll bones. (hand / foot) then deform bone follow it (they are not connected), but FK limb can not stretch because FK controll bones are connected with their parent.

Then if user can toggle stretch or not, (Stretch for FK and IK, or never stretch for FK and IK) for each limb, with click button (like FK / IK mode change) it offer really useful setting option.

And with real test I confirm, toggle option may better to be offered for each limb (so user can change stretch, for each limb with current posing) actually both have pro and con, so I do not hope to use same setting for all limb with each pose. as same as we change FK and IK for each limb, but may hope to change each limb stretch as I need. I think it is simple enhancement but if add on offer it, it actually often used. (or at current I need to change those connected setting, everytime ^^;)

Comments (18)

  1. Thomas Larsson repo owner

    In the last commit there is an option for arm and leg stretchiness when you convert to mhx. It is not a parameter that can be turned on and off, because if the limbs dont stretch the hand and feet are connected to their parents, which can only be changed in edit mode. It affects both fk and ik, because in order to snap correctly either both or neither must have stretch. And with the last mhx commit, fk-ik snapping seems to work perfectly. :-)

  2. engetudouiti reporter

    Yes I understand, I can not animate the strech on and off. I do not plan to mix use it with one timeline , but if there is case, I may use marker, and when render I manually change it with frames (eg only10 to 40, I change rig as strechable, then render 10 to 40 as different sequence)

    Then if you can change it not only when convert but can change after convert MHX, (without set keys) with click , it is more useful.

    Because I actually exchange it after convert armature for each purpose. if it only work when I generate, I need to re-generate MHX everytime,, so I hope you add option as funciton which can change after generate )

    (though as private purpose, I am now merge it as my other utility tool, so even though you do not hope it, I apreciate this commits thanks.

    And yes I already thought MHX snap is really perfect (more better than most of IK FK compatible ifgure snap, I feel)

  3. engetudouiti reporter

    OK I afraid, if you need to change snap function for each option, and it make more complex , so only when you will think , you may hope to change setting after generate , (though I do not know which type you hope to use it as your default) , re- think again.

    If you will plan it, As best, make UI toggle button with function (it actually change edit bone parent relation then not use as animatable prop) user can confirm now current rig can strechable or not and convert it wheneve they need so it is more user friendly. but need to confrim snap work as same as before)

    At current I content with your new commit, (I may use non strech version as default , I suppose so if snap work perfect, it is no issue for me thanks you take time to this small issue.🙂

  4. Thomas Larsson repo owner

    Fixed in last commits. The mhx rig is always stretchy when it is created. Buttons to toggle stretchiness for each limb are found at the bottom of the FK/IK Switch panel.

  5. Thomas Larsson repo owner
    • changed status to open

    Open this again because I think it the possibility to toggle stretchiness is really an improvement, and it would be good to iron out all related bugs.

  6. engetudouiti reporter

    Thanks (now I happend to start make stable library again,, then did not notice it ^^; )

    can I safety update and try the MHX related commit for the blender scene which I just save untill conver MHX ? (it is usually final step, after merge mesh import morph etc, then I save it separately , then I now try to convert,, with check here and notice new commit offer those)

    ======

    I test with both version, (though at current not set keys still), on and off after generate MHX for each limb > pose limb , with IK twist , snap still work without deform. thanks. default stretch with snap work well too. 🙂 as you suggested test more and report again if find new problem related with this commit. (I am exciting to use MHX ,, I do not care snap any more ^^b )

  7. engetudouiti reporter

    Thomas with recent version, I do not know reason but, without stretch, now snap cause new issue for foot,, ^^; before I confrimed it work.

    when I use non strech option and pose IK foot free,,, (at current it change as default) then snap FK to IK now toe remain the place.

    before it auto adjust the pos correctly.

    I need to remove the tnrasform value after snap FK to IK, once it happend, the location value remain always. so I think you need to remove those location when snap FK to IK. (user may not need to add local transform for FK toe)

    it happen this way,, with non strech and IK pose

    it is what I expect, (only IK foot controller moves, but remain deform as non stretch)

    then snap FK to IK >> as you can see toe FK try to locate the place (IK place) , before it not worked so. (auto adjust location but copy rotation well)

    it start with one of recent commit,, I confrim yeseterday it worked (when you add strech option and I test it, because I excited and test too many times but there was not such issue.

    This is one thing I afraid,, if you need to make different snap function, to work both option.

    to correct it, I need to remove toe location value. (it auto added when actually snap to the IK pos, but with non strech option it should not, but just copy rotation, and FK toe need to be connected as same as before)

  8. engetudouiti reporter

    OK I found reason,, when user set option as no strech = you need to return FK toe connected with FK foot. so it auto locate pos correctly (FK snap to IK foot)

    I may test again with make it so. (for both case work or not, )

    yes it work. Though I do not use merge toes. but if you set FK toe connected with FK foot, it work as I mentioned. (can snap FK to IK, without non deform) then IK to FK work without problem. I test with strech , non strech with many pose, then snap FK<> IK no issue.

    so you can safe Connect FK toe to the parent FK foot then this new option work for both.

    . sorry not test with G7 enough though,,

  9. engetudouiti reporter

    And as usuall,, you need to set it for hand FK too.

    when stretch, >> hand FK not connected when non stretch hand FK connected with. you need to change those FK bone setting with edit mode (when toggle ) without it, non stretch option snap FK to IK never work. mm,, I do not know actually script do so. then I think if there is up-date issue, when I roggle with pose mode… (if I toggle in edit mode it work about hand I feel)

    No actually your first setting is wrong.

    it start as non strech , so FK hand must need to be connected, or it cause issue when snap FK to IK (FK hand locate on IK pos (free moved)(

    but I clear see, FK hand not be connected. as it should be. so even though not deform FK hand locate on wrong place, then once it happen really difficult to return it. untill user remove manulally transform from FK bone (locked translation)

    Then srcipt may try to toggle connected on and off with change the stretchness (so basically we need reverse setting for FK hand , once user correct it, maybe script work correctly.

  10. engetudouiti reporter

    Thomas no.

    I think you can snap FK to IK, and IK to FK even though you use stretch IK pose.

    but you can not free move FK hand because, IK strech pose actually need to keep forearm and upper arm as stragith line.

    there should not be pose, strech hand but bend arm lmbs . (you can not make such pose as default)

    then you can snap FK to IK without deform. but if user free move FK hand, with not stragith arm line, then snap IK to FK should break IK chain.

    basically I do not suppose, free move FK hand. you can rotate upper arm, after snap FK to IK with strech pose. (but need to keep straight line)

    then snap IK to FK work correctly. but once you bend fore arm with FK hand I do not think IK snap work any more, even though it can snap,

    after snap IK hand for those FK pose (strech hand, with non straight arm pose), it should corrupt IK chain.

    I feel you seems try to solve this problem by add new strech for some bones,, but it cause new problem for IK chain.

    so to think about it, I can not recommend to free move FK hand even though when snap with strech pose it shrink.

    But without strech option, should offer real snap,

    (IK strech on off ok, but FK should not, or user need to keep rule, (keep straight line , = not free move hand bone with FK, and not rotate forearm. you can only rotate Upper arm with keep straight line (which you made for IK strech pose) or when snap IK to FK, it cause issue.

  11. engetudouiti reporter

    I summarize if user hope to use strech option for IK FK with snapping.

    you can pose free with IK stretch. then can snap FK to IK correctly.

    after snap FK to IK,

    1. you should not free move FK hand anymore. untill remove transform value from FK hand. after remove local transform from FK hand, then can pose free. (use some frame to return FK hand transform smooth = non stretch pose)
    2. when FK hand have transform value, you should not rotate fore-arm like this.

    though you can still keep FK hand transform value as strech, (what you made with IK) but if you remain stretch hand pose with FK, you can only rotate forearms as straight line pose + stretch . that means, it need to keep like this pose. you can still twist or rotate upper arm FK. but need to keep the IK made straight pose for arm limbs, then it can return IK pose by snap IK to FK without problem. (IK chain not break)

    Once IK chain break it is not easy to correct it (because current MHX IK use twist and bend bone for each IK bone as hidden)

    so when you return to IK , you may better remove FK strech, (simply select FK hand and remove translation), then you can return IK pose without breaak anything,, >> make strech pose,, with IK,, snap FK to IK,, >>>> make some pose >> remove stretch (Or stiriclty keep straight chain pose) >>

    return IK .. continue.

    if user can understand these things, , free strech for IK and FK work. if not,, I afraid there will be many question. why it break etc.

    ====

    then anyway, Thomas might need to correct, the current setting first (without it both option not work ^^;)

  12. engetudouiti reporter

    For safe use, it seems good idea, to add functiion when user snap IK to FK, auto remove the FK hand transform first. then snap.

    Though it need to be described, why auto change hand pos so when snap IK to FK,, or may better show info.

    “ you should not include FK hand transform value, when snap IK to FK ! add on auto remove it” etc.

    Though if user keep straight line and pose with FK (roate forarm), then hope to return IK,, it not forgive their work-flow.. (So it may depend Thomas)

    About IK chain for leg, it is more complex (Include reverse foot IK chains ) than arm but basically it need same thing. and with keep the rule, it work well. if they understand when it break Ik chain, user can use both option more safety (free pose with FK strech ) with keep merit (perfect snap for FK <> IK (but need to know when it break IK chain)

    so do not snap IK to FK, when your current FK pose like this,,

    if use snap IK to FK , add on force to snap break IK chain for the location then you do not see issue at that time as deform.

    but as you see, IK chain bone not locate correctly. so you can not pose IK well any more (keep break chain)

    the right usage is, after pose with strech + FK as you need,, everytime remove the FK Foot transform (Local) = non strech,

    then return IK by snap IK to FK , so it work (keep good IK chain, then you can strech again ,,) like this

    Then snap IK to FK (remove strech) work like this . (perfect snap with keep clean chain)

  13. Thomas Larsson repo owner

    The last commits connect the FK toes to the foot, and also connects the reverse toes and feet. The FK hand and foot locations are cleared both the stretch is turned off, and when switching to IK. The latter is unintuitive, and I worry that people will complain, but OTOH the alternative breaks the IK chain. I hope I got your points right.

  14. engetudouiti reporter

    @Thomas

    I understand if you try to test and solve many issue at once, with read too many my report,, so lets solve one by one with test. firs of all, you may better concentrate default option (non stretch I suppose)

    1. I can confrim, with non strech option , leg IK FK work as I expected. ( I can pose all posable bone, with Fk and IK then confirm snap worked)

    so aboout legs with non stretch option , there seems no issue any more. (leg with non stretch = solved)

    1. I still see issue with non strech option, when I snap FK arm to IK arm. like this pic. (so it is default, I just pose IK hand, then snap FK to IK , I see this issue.

    It is because you do not connect FK hand with FK forearms, when non stretch, it must need , to snap FK work correctly. At current I pose IK hand as straight (so IK hand may move far), then snap FK to IK, FK hand still snap on to the IK hand position. (then it cause issue for FK pose with non stretch)

    then if I connect FK hand with parent, (for non stretch option), it work like this.

    So when non stretch option,, IK controller still move free.. but FK should not. then it can set FK hand or FK foot correcty on to the FK pose postion.

    if it not connected, FK hand simply locate on IK place,, (but not show stretch deform), after set hand FK or foot FK so,, now it make difficult to pose any more. (so with FK pose,, without stretch, FK pose bone need to locate on mesh deform positon, when snap FK to IK)

    as conculusion when stretch OFF >> hand FK must need to be connected with the parent bone (FK forearm)

    you do not need to change other bone setting. I confirm, after you make it so, now with nonstretch option, I can pose FK, IK arms and snap FK <> IK should work without problem,, I recommend untill start to edit script, manually change it so, and check how it work. keep non stretch option.

    after you confrim it work,, I may test for stretch version too.

    untill we can confirm arm and legs work well with non stretch option, It seems better, not add things for stretch version.

    For test with IK make arm pose like this (stretch off). even though IK hand move far, defrom stop as straght . (as we expect it)

    like this pic.. (I mix use IK twist too )

    Then now I need to change FK mode, but about the case, FK hand should not locate on IK hand, to work it so, you need to keep FK hand connected with. actually I edit so. then it snap correctly.

    Then if you return IK to FK snap with keep current pose. IK hand will snap current FK position, correctly. without change deform. if you connected FK hand, I have no issue. but need to confirm with your new commit, after I can confrim it work so, I can report with stretch version.

  15. engetudouiti reporter

    I test with stretch on too. (stretch deform ). it worked. so you only need to change

    “stretch OFF >> hand FK connected with the parent bone (FK forearm)”

    About snap IK to FK, with stretch on, You understand correctly what I mentioned thanks.

    IThere may be user, who request,, not auto remove translate for FK hand (or foot) when Snap IK to FK,

    but as you confrimed, if user remain the local translate value for FK hand with non straight pose, it break IK chain when snap. = real bug.

    if you limit FK non stretch as same as before, after all same thing happen when snap FK to IK for IK stretch pose, FK arm shrink (it is what you described ) >> Then we free move FK hand when strech IK >> when snap IK to FK it may cause issue >> we need to remove the local translate >> arm shrink about stretch FK pose ^^;

    I think current way (FK can stretch then snap FK to IK work, and can pose free. but when snap IK to FK , add on remove FK local transform)

    is better.. (do not know if user think it is problem) I do not know if there is good way,

    FK stretch free pose (not straight limb) >> IK snap to FK work without break IK chain.

    because I do not think we can make IK stretch pose which bend forearm. (I actually do not know such IK rig.. if it work, it may need to use non IK bone for stretch bone I feel)

  16. engetudouiti reporter

    Thanks now it should work. about for stretch with FK pose (and how snap IK bone to FK for stretch FK pose etc) if there is more better way you find change as you need.

    then if current way (can stretch with FK but auto adjust when snap IK to FK ) is matter anytime you remove it as you need. (eg not stretch for FK as same as before)

    But I hope to remain, current non stretch option for IK and FK with stable snap. (then as my side you already solve issue) then close please as you need.

  17. Log in to comment