What are flippers, and why do they need translate?

Issue #1864 resolved
Rakete created an issue

When saving poses, there is a function setupFlippers, which sets up matrices that I assume are meant to “flip” the bone from blenders orientation to daz orientation.

When I try to save poses for followers with their own armatures (genitals or hair) I keep running into problems when I try to scale bones, I end up with additional translation components in the pose that should not be there.

I noticed I can fix that problem by changing the setupFlippers function like so:

Fn = pb.bone.matrix_local.inverted() @ self.Z @ dmat
_, rot, _ = Fn.decompose()
Fn = Matrix.LocRotScale(Vector((0, 0, 0)), rot, Vector((1, 1, 1)))

essentially eliminating the translation and scale components from that Fn matrix that is used to flip all the bone matrices. Now, would this break anything? My intuition says this should be fine since the point of the flipper matrix is to rotate, not translate or scale, so removing those from the matrix should not be a problem.

Comments (8)

  1. Rakete reporter

    Also, I think this code does nothing:

    idxs = self.idxs[bname] = []
    for n in range(3):
        idx = ord(pb.DazRotMode[n]) - ord('X')
        idxs.append(idx)
    

    Maybe it should append to self.idxs[bname]?

  2. Rakete reporter

    Well, I guess idxs should be a reference to self.idxs[bname], so it should still do something, but tbh I’ve been running diffeo with that code commented since forever and never noticed a problem.

  3. Thomas Larsson repo owner

    No, idxs and self.idxs[bname] are the same list, so appending affects both variables. But it is not very elegant. In the last commit I replaced the whole thing with a single line.

  4. Rakete reporter

    But is self.idxs used anywhere? I think it is only used there once and then never touched again.

  5. Log in to comment