Save Pose Preset Not Working.

Issue #1615 resolved
Pass xL created an issue

Just like in the Git image I provided, the action cannot be fully imported into Daz (I have another more complex animation and it does not work at all), here is my import process.

I am using MHX RIG

  1. Animation -> Bake Action
  2. Transter IK => FK
  3. Bake Pose To FK Rig
  4. Save Pose Preset

The above process works perfectly well in some old beta version (I forget what version).

Comments (46)

  1. Thomas Larsson repo owner

    Fixed in last commit. I noticed that you had kept the original deform rig when you generated the mhx rig. In that case there is another way to make the pose preset, using the deform rig. I think this way is safer.

    1. Unhide and select the deform rig.
    2. Mute Control Rig.
    3. Save the preset for the deform rig.

  2. Alessandro Padovani

    daz studio 4.21.0.5, blender 3.6.0, diffeomorphic 1.7.1.1660

    Your test animation works fine here. You need to export locked channels and unlock/unlimit the figure in daz studio as usual. This is necessary because the IK animation may exceed the FK limits. It is also common for daz poses to unlock limits anyway.

    Pose preset included test-baked.duf.

    steps:

    1. in blender load your test.blend scene
    2. bake the daz rig with object > animation > bake action (I do mean the daz rig, since mhx drives the daz rig you don’t need to bake mhx)
    3. save pose preset for the daz rig, with “include locked channels“
    4. in daz studio unlock/unlimit the figure with edit > figure > limits/lock
    5. load the pose preset

    @Thomas we may want to check “include locked channels“ as default since this is necessary to correctly save pose presets. It would also be a good idea to uncheck limits and check quaternions in the global settings as default, since this is required for IK animation in blender.

    note. about importing ik animations in daz studio. The requirement to unlock the figure to import ik animations is not limited to blender. For example we need to do the same to import miku miku dance animations in daz studio. So unlocking the figure is required to import ik animations in general.

  3. Thomas Larsson repo owner

    Locked channels are now saved by default. Perhaps the option should be removed completely.

  4. Pass xL reporter

    Unfortunately, the original deform rig method does not work for me, and after importing into daz3d, it causes a lot of problems, such as: shaky hands and feet or incorrect position.

  5. Alessandro Padovani

    That means you didn’t bake the daz rig and/or you didn’t unlock the figure. Or you imported the animation on a figure with different proportions that may also cause sliding.

  6. Pass xL reporter

    @Alessandro Padovani

    I think I have already done the steps you mentioned above, but the results are still not satisfactory.

    Maybe something went wrong when I imported for MHX, so I'll explain my whole procedure in detail.

    Here are my detailed steps (All files in attached):

    1. Daz export - Unlocked and Unlimited all :

    2. Import Blender:

      • Import Setting :

    3. Convert_To_MHX:

      • Convert_To_MHX Setting:

    4. Posing:

    5. Daz Pose Import:

      • Pose Import Setting:

    6. Daz Result:

  7. Alessandro Padovani

    you missed step 4, select children to unlock all

    4. in daz studio unlock/unlimit the figure with edit > figure > limits/lock

  8. Pass xL reporter

    Oh, sorry I forgot to write, I used a script called unlocker.
    After unlocking my Rig can bend like this.

  9. Alessandro Padovani

    how to unlock in daz studio.

    Yes it seems the script you use to unlock doesn’t work fine. Unlock as I told you with the daz menu instead. I’m including the generated pose preset test-pose.duf that you can use as reference, together with a video of the resulting animation in daz studio.

    steps:

    1. in blender load your test scene 04-07_test_pose.blend
    2. mute or bake the daz rig and save the pose preset
    3. in daz studio load G8F, then select children and edit > figure > lock > unlock selected nodes
    4. load the pose preset and unlock limits when asked

  10. Alessandro Padovani

    note. important. fix elbows and knees.

    When you convert to mhx uncheck “fix elbows and knees“ since this option changes the elbows and knees pivots a little, so it’s not compatible with daz poses, that’s probably why even in my animation you still see a very small “sliding“ in hands and feet. Moreover this option is not necessary if we use “improve ik“. I already told @Thomas about this but he wants to keep the option as default, not sure why. Anyway I added a note in the docs some time ago.

    Or you can use simple ik instead of mhx that’s easier to save pose presets with.

    https://bitbucket.org/Diffeomorphic/import_daz/wiki/Setup/Rigging

    https://bitbucket.org/Diffeomorphic/import_daz/wiki/Setup/Rigging/Convert To MHX

  11. Pass xL reporter

    Thank you for your patience, your method can indeed greatly reduce the jitter problem, but unfortunately can not be entirely solved, Perhaps the “Keep Daz Rig” feature needs a little more time to polish.

  12. Alessandro Padovani

    You don’t read don’t you ?

    I can confirm that disabling “fix elbows and knees“ fixes the jittering. Test scene included no-fix.blend where I generated mhx without the fix and works fine.

    Anyway thank you for this. I am not interested myself in exporting pose presets so I tend to be lazy on it and you pushed me to do tests and see what happens. So now we know. I’m closing this as invalid since everything is now explained in the docs and there’s no issues if you unlock.

    @Thomas You may want to remove the “fix elbows and knees“ option since it causes jittering for pose presets and anyway it’s not necessary if we use “improve ik“.

  13. Pass xL reporter

    Before I say anything, I always think it through.

    When I say "not entirely solved", I've already retested it in the way you described above.

    This is my test result and .blend file, your method can reduce the jitter, but can not completely solve it.

  14. Alessandro Padovani

    I can’t reproduce the issue here. What’s your global settings and mhx settings, did you disable “fix elbows and knees“ ?

  15. Alessandro Padovani

    I did a second test scene where I animate the toes as you do and indeed there’s a very little jitter, less than your example though. The toes don’t seem to stay perfectly still as in blender they move a little. Not sure why. My guess is it may be a precision issue since the toes go down the fk hierarchy so they depend on the whole fk chain rotations.

    @Thomas What is the precision we export pose presets to ? May it be that we lose some precision when we convert from blender to daz coordinates ?

    steps:

    1. load mhx-toes.blend
    2. select the daz rig and save the pose preset
    3. in daz studio unlock g8f and load the pose preset

    note. mhx vs simple ik. I also did some tests with simple ik that doesn’t have the reverse foot setup, and there the blender animation matches perfectly with daz studio. So I wonder if it may be the mhx reverse foot in some way, instead of being a precision issue. As I understand it some small jittering is expected from rigify and mhx when we save pose presets. For a perfect match we need simple ik that’s what simple ik is for. This is also explained in the docs.

    https://bitbucket.org/Diffeomorphic/import_daz/wiki/Setup/Rigging

  16. Thomas Larsson repo owner

    Fixed in last mhx commit. FK/IK snapping seems to work perfectly for the frames where it is done. However, the interpolation to intermediate frames turns out to be different between FK and IK. In the last commit the FK bones are snapped for all frames in the specified range, not just the ones with keys, so there is no interpolation that can go wrong.

  17. Alessandro Padovani

    Sorry I don’t get it. In my example above I don’t use the mhx rig at all I’m baking the daz rig. The baked/muted rig animates fine in blender so all frames are in place as needed. How can this be a problem with snapping ?

    Or rephrased, then what have we to do to get the toes working ?

  18. Alessandro Padovani

    diffeomorphic b539354, mhx 6c6c35b

    Indeed in my tests everything is as before, unless I miss something.

    steps:

    1. load mhx-toes.blend
    2. select the daz rig, unmute and mute to redo the baking with the new mhx, then save the pose preset
    3. in daz studio unlock g8f and load the pose preset

    I also tried redoing the animation from scratch with the new mhx but it’s the same. If you look at my mhx animation I don’t use the fk bones at all, only ik, so again I don’t get what snapping has to do with it. As for muting/baking the daz rig animates fine in blender.

    p.s. May be you mean you fixed saving the pose preset directly from mhx, without keeping the daz rig ?

  19. Thomas Larsson repo owner

    Sorry, I didn’t read the thread carefully, but only looked at Pass’s picture Test_2-min.gif. I could reproduce that effect in Blender (i.e. without saving a preset) by making an IK animation and transferring it to FK. In that case the intermediate FK and IK poses differ, even if the keyframed ones are the same.

  20. Alessandro Padovani

    That’s another thing entirely and, if I understand correctly, what you did is wrong.

    That is, baking and snapping are two different things.

    Snapping is to join the ik and fk animations, of course ik and fk don’t follow outside snapping but we don’t care. That’s why we snap on a single frame. That is, we do one part of the animation with ik and fk doesn’t follow, here ik drives the deform bones. Then we snap fk to ik so they join, we go on with fk animation and ik doesn’t follow, here fk drives the deform bones. Below there’s a video showing the animation process with snapping in rigify.

    https://www.youtube.com/watch?v=98E9H6fjaV8

    Finally we bake the deform bones if necessary, for example to save a pose preset. After baking the constraints are usually cleared so the deform bones don’t follow anymore ik/fk bones.

    What you did in your fix is to bake the fk bones making them follow the ik bones. That’s not what snapping is for nor what baking is for, and doesn’t resolve the pose preset issue. Again if I understand correctly what you did, if not please explain what we have to do.

    p.s. Personally I believe snapping is more a waste of time and I prefer to do everything with ik, but I’m alone with this any pro animator will do snapping.

    p.p.s. Then to import daz poses in a ik animation it makes sense to snap ik to fk, since daz poses are fk.

  21. Thomas Larsson repo owner

    The transfer animation tool snaps the fk bones for all frames within the specified range. It would be very strange if the fk and ik poses were different within that range, just because the ik bones don’t have keys on all frames. Outside the specified range the fk bones are not snapped. I didn’t see the problem before because I had only used these tools on mocap animations, which have keys on all frames anyway.

    There was another bug that has been fixed: the interpolation mode was changed to linear. This makes the curves less cluttered if there are keys on all frames, but is wrong otherwise, i.e. for the hip bone in your file.

    Now the feet don’t slide if we save a preset directly from the mhx rig. However, there is sliding if we save from the deform rig. This is due to how the mhx rig is set up. The thigh bend bone has a damped track constraint pointing at the shin, which means that it is not perfectly aligned with the long thigh bones. E.g., on frame 2 the thigh x rotation is -11.7 degrees, but the bend bone rotation is only -10.2 degrees.

  22. Thomas Larsson repo owner

    We can get sliding feet already in Blender, like this:

    1. Mute Control Rig.
    2. Impose Locks And Limits.

  23. Alessandro Padovani

    Yes, that’s why we have to unlock in daz studio.

    Thank you for the explanations. As I see it we have to use simple ik for pose presets that always works fine. While for mhx rigify there may be glitches due to how the rigs are setup, so we can use daz poses but there may be little differences. This is already explained in the docs. Then thank you for your work on the improvements.

    If there’s nothing to add we may mark as resolved since the original issue is resolved with unlocking and further glitches are resolved using simple ik. I added notes in the docs about all points here.

    p.s. It would be useful if you can add an option for reverse foot to simple ik, same as mhx, that will make feet animation easier. I mean if it’s not causing feet sliding with pose presets.

  24. Thomas Larsson repo owner

    The original idea with simple ik is that it should be simple, basically just adding ik constraints to the daz bones themselves. That isn’t really the case anymore, but adding reverse feet to it would mean a new level of complexity, and I don’t want to go there.

    Instead I have modified the mhx rig by making pole targets optional. The reason why the bend bones uses damped track constraints instead of copy rotation is that the latter causes strange behaviour. When the quaternion Y component passes though zero, the bend bone is twisted 180 degrees. However, this seems to only happen with pole targets. If the knee and elbow locations are controlled in the rigify style, copy rotation constraints seem ok.

    This is still experimental so pole targets are generated by default.

  25. Alessandro Padovani

    Commit e6fc4b3 mhx b722787.

    I get an error with the new mhx.

    steps:

    1. import G8F and merge rigs
    2. convert to mhx without poles

    Error: Python: Traceback (most recent call last):
    File "C:\Users\Alessandro\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\import_daz\error.py", line 222, in execute
    self.run(context)
    File "C:\Users\Alessandro\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\import_daz\mhx.py", line 414, in run
    self.convertMhx(context)
    File "C:\Users\Alessandro\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\import_daz\mhx.py", line 522, in convertMhx
    self.constrainBendTwists(rig, bendTwistBones)
    File "C:\Users\Alessandro\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\import_daz\fix.py", line 1191, in constrainBendTwists
    cns.euler_order = pb.rotation_mode
    TypeError: bpy_struct: item.attr = val: enum "QUATERNION" not found in ('AUTO', 'XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX')

    I partially disagree on simple ik, in that the main feature of simple ik is not to be a simple rig, but to use exactly the daz rig for the deform bones without modifications, so to be sure we have a 100% compatibility with daz poses and jcms and pose presets. Then “keep daz rig“ for mhx rigify has the same goal, but doesn’t seem to work as pointed in this discussion. Then I agree that simple ik should also be “simple”, avoiding features that are not compatible with daz poses, for example tweak bones.

    Actually simple ik is the only rig that works fine with pose presets without jitters. But I’m also going to test the new improvements to see if they work. That said again I’m not interested myself in pose presets, so I tend to be lazy there and may be Pass XL can test it better.

    p.s. Of course I use quaternions in the global settings, this is mandatory for ik animation and should be the default, we can’t animate free joints with euler. It makes no sense to use a ik rig without quaternions it will never work in animation. That is, euler is only good for the daz rig if we animate with fk without a ik rig. Same with limits we have to turn limits off to animate with ik, otherwise snapping doesn’t work. Limits are only good to animate the daz rig with fk without a ik rig.

    I added this note in the docs.

    https://bitbucket.org/Diffeomorphic/import_daz/wiki/Global/Rigging

  26. Thomas Larsson repo owner

    Now I finally managed to save a pose preset with a deform rig, and then reimport it, and the feet don’t slide. Entirely in Blender, The feet do still slide in DS, but maybe I didn’t manage to unlock everything. However, I’m not sure how useful this is, because the deform rig bones generally have translations so the pivot points are changed.

  27. Thomas Larsson repo owner

    I changed the owner and target spaces of the copy transforms constraints to Local With Parent, that seems to maintain the offset between the mhx and daz bones. There is nevertheless some foot sliding when the preset is saved from the deform rig, and that is absent if we use the mhx rig directly.

  28. Alessandro Padovani

    Commit 75e3486 mhx b722787.

    mhx with/without poles. works fine. I can confirm that mhx works perfect without poles. There’s no hands/feet/toes jittering of any kind thank you for this nice improvement. Works fine with poles too.

    steps:

    1. convert to mhx with or without poles
    2. animate
    3. transfer ik to fk
    4. save pose preset

    edit. There were errors in my other tests, now redoing them.

    mhx with/without poles keeping the daz rig. works fine. I have no issues here even keeping the daz rig. Everything works fine. As explained above we have to unlock the figure in daz studio and uncheck “fix elbows and knees“ when converting to mhx since this changes the pivots. Other than that works perfect here.

    I’m including the pose presets generated with the various options for testing.

    steps:

    1. convert to mhx with or without poles keeping the daz rig
    2. animate
    3. select the daz rig and mute the control rig
    4. save pose preset from the daz rig

  29. Alessandro Padovani

    mhx presets generated with the various options, there's no ik sliding everything works perfect, we have to unlock the figure in daz studio

  30. Log in to comment