Supporting bone translations

Issue #1636 resolved
Rakete created an issue

Would it be possible to support bone translations in the save pose preset code? In principle it should work but in practice blender handles bone translations differently from daz. In blender the location is local to the parent, it seems in daz it is always in world orientation?

Not entirely sure what is going on there. Setting the use_local_location setting in blender helps with some bones, but not all of them. For example see the attached images for what happens when I move a finger bone of a Genesis 8 figure.

Comments (12)

  1. Thomas Larsson repo owner

    Oh, I had forgotten. Daz bone matrices are weird. Translations are in parent bone’s space, but rotations and scales are in the bone’s own local space. In Blender all three are evaluated in the bone’s local space. Let T,R,S are translation, rotation and scale matrices, and D is rest pose matrix. Then the transformations are as follows:

    In Blender:

    M = D T R S D^-1
    

    In DS:

    M = T D R S D^-1
    

    This was implemented in the Import Pose tools long ago, but now it has been fixed for Save Pose Preset too.

  2. Thomas Larsson repo owner

    This means that daz orientation doesn’t work for translations, only for rotations and scale. From the formulas in my previous post (edited), we see that daz and Blender translations are related by

    T_DAZ = D T_Blender D^-1
    

    which is more complicated than just switching axes. In Rakete’s example, the lIndex3 translation in Blender

    T_Blender = (0, 10, 0)
    

    corresponds to the daz translation

    T_DAZ = (6.0726, -7.9094, 0.75167)
    

  3. Alessandro Padovani

    Rigs usually don’t use translation for bones, unless they’re ERCs but that’s not in pose mode. So rotation and scale it’s enough.

    Anyway as I understand it daz orientation can’t work with quaternions that makes it unusable for ik animation. So the use now is pretty limited. Certainly the standard orientation doesn’t work for “subtract rest pose“ while the daz orientation does.

    There’s a possible workaround that’s to implement copy absolute action with constraints #1445, so the standard orientation could work with prebended rigs. Once that’s implemented and verified to work we could remove daz orientation and “subtract rest pose” entirely, or keep them as experimental.

  4. Thomas Larsson repo owner

    While daz orientation doesn’t work for translations in general, it should work for bones that are aligned with one of the coordinate axes, because all the rest pose matrix does in that case is interchanging axes. Fortunately, that includes all bones that normally can be translated, i.e. hip, face bones, and face control bones.

  5. Rakete reporter

    I asked for this mostly because of non-figure armatures, so for example furniture can have bones to open drawers, all kinds of followers (hair, genitals, clothing) can sometimes use bone translations (or at least it can be useful to translate bones in those cases).

    The latest change fixed a bunch of problems I had previously, which is why I marked this as resolved.

    In figures where you’d use quaternions, I guess I just wouldn’t use translations, leaving the translation of those socket bones locked. Then the change shouldn’t affect those.

  6. Thomas Larsson repo owner

    I don’t think quaternions or Euler angles matter at all. Internally rotations are represented by 3x3 anti-symmetric matrices with determinant 1. Quats and eulers are just ways to describe those matrices, but the translations are independent of that description.

  7. Log in to comment