pivots of parented objects are wrong for posed figures

Issue #2111 new
Alessandro Padovani created an issue

4.2.0.2171, blender 3.x 4.x

It seems cameras are not imported correctly anymore. This only affects dbz, while unmorphed works fine. Test scene included.

steps:

  1. import the test scene as dbz, and compare the cameras with daz studio

Comments (21)

  1. Thomas Larsson repo owner

    This happened when we saved the world-space transforms for nodes in the dbz file, in order to get the right locations of the piercings. Apparently the values for rotations in the dbz file was the right one to use. Now the plugin only uses the location in the dbz file, and takes rotation and scale from the duf file. Both the camera file and the piercing files are now imported correctly.

  2. Alessandro Padovani reporter

    Commit d6b68d8.

    Cameras and lights are ok, but it seems “eliminate empties“ doesn’t always work, also objects parented to bones have a wrong pivot point. Then the imported empties are very small and difficult to select, I’d use a 10cm radius to make them more visible and similar to daz studio.

    steps:

    1. easy import the test scene camera-2.duf as dbz, with “eliminate empties” and “apply transforms”
    2. the empty is not eliminated
    3. the pivot point of the torus is off

  3. Thomas Larsson repo owner

    I have fixed the issues with the empties. The pivot point is tricky and will have to wait.

  4. Alessandro Padovani reporter

    If it helps, it seems to work fine if I import as unmorphed then parent to bone.

  5. Thomas Larsson repo owner

    This turns out to be a quite nasty bug. The pivot point of bone parented objects are at the location where it would be for the unposed and unmorphed character. The location of the torus in DS is (3.09, 176.77, -8.65) and that is also where the plugin puts the pivot point, which you can see with Utilities > Inspect World Matrix, cf last column.

    World Matrix Torus
    <Matrix 4x4 ( 0.3652,  0.4436, 0.0586, 0.0309)
                (-0.4965,  0.2880, 0.0589, 0.0865)
                ( 0.0590, -0.3219, 0.1334, 1.7677)
                ( 0.0000,  0.0000, 0.0000, 1.0000)>
    

    But this is not right if the character is morphed or posed.

    This bug is quite old. I checked with versions 1.6.2 and 1.7.0 and the behaviour is the same there.

  6. Thomas Larsson repo owner

    Is it just me, or did Bitbucket change the text color to light grey? It is almost unreadable for me.

  7. Alessandro Padovani reporter

    4.2.0.2180, blender 4.1.1

    Doesn’t work fine. Again I can get the right pivot by importing as unmorphed then parent to bone as shown above.

    Yes the light grey is annoying.

  8. Thomas Larsson repo owner

    The torus behaves strangely because it is parented to the eyelashes head, not to the G8F head. After manual import it is located somewhere around the head. The mesh location is the same with dbz and unmorphed, but the pivot is slightly different.

    After rigs are merged the torus is parented to the G8F head, but it jumps down to the chest. If you parented it the head bone again (it is already bone parented to it) it jumps up to the head region. The mesh and pivot are close to the locations after manual import, but both are slightly off.

  9. Thomas Larsson repo owner

    With the last commit I think that pivots may be located correctly for morphed meshes, but they can be off if the mesh is posed. The attached files contain a tall G8F with several bone children. The unposed file comes in right, but the posed one does not.

    Note that you must use the latest version of the dbz exporter, because the files contain four instances of the same cylinder, and the plugin used to mix them up. It used to assume that the instances are defined in the same order in the duf and dbz files, but this isn't the case here, and therefore it needs the labels to distinguish between them.

  10. Alessandro Padovani reporter

    4.2.0.2183

    The dbz pivot is off it’s not the same pivot as daz studio so something is wrong with dbz.

    The unmorphed pivot is fine.

    bug. merge rigs. Merge rigs doesn’t work fine if there’s parented meshes. It should unparent before merging.

    steps:

    1. manual import the test scene as unmorphed, the torus pivot is fine
    2. unparent the torus: alt-p clear and keep transforms
    3. merge rigs
    4. select the torus then the armature as active then go to pose mode and select the head bone
    5. reparent the torus: ctrl-p bone and keep transforms
    # merge rigs
    unparent meshes
    merge rigs
    reparent meshes
    

  11. Alessandro Padovani reporter

    4.2.0.2187 Nothing changed here same bugs.

    note. The torus parented to eyelashes is not a “strange thing“, we can have items parented to hairs or outfits that would be the same. The tools should work fine in these conditions. Also posed figures are essential to the prebended workflow.

    note. I believe the reason why the torus “jumps” with merge rigs is because the bone is deleted so the torus gets unparented without keep transforms. If we unparent then reparent as explained above then the issue is fixed.

  12. Thomas Larsson repo owner

    The issue with merging rigs is gone now. The merge rigs tool did some strange things behind the scenes, like putting the the rigs in rest pose before merging. With that code eliminated the torus stays in place.

  13. Alessandro Padovani reporter

    4.2.0.2188

    Merge rigs works fine thank you for the fix. It remains the issue with the dbz pivot for the torus that's not imported or exported correctly. Couldn't we just take the unmorphed pivot for parented meshes ? That seems to work. Let me know.

  14. Thomas Larsson repo owner

    It is not so easy to get the pivots right. Remember that dbz bakes both morphs and poses; the data are taken from the final vertex and bone locations that DS uses for rendering.

    What changed lately is that an offset is added to the pivot point; this offset is the difference between the parent bone’s baked and original locations. One should probably take the parent bone’s rotation into account as well, but that would be messy. This should be fixed for completeness, but in practice I don’t think this is a huge problem.

    1. As a character generator. Then the figure is typically shaped but not posed, and the pivot points are now correct, as in the test file I uploaded.
    2. For rendering in Blender. Then you don’t need the pivot points, only the meshes which are right.

    Of course there are cases where a figure needs to be posed, e.g. a foot pose for high heels.

  15. Alessandro Padovani reporter

    4.2.0.2189

    Unfortunately that doesn't seem the case. Pivots for parented objects don't work even for figures in rest pose. Below an example from #2084, that you can add to my test scene. Some rings are bone parented to the the braids and have a wrong pivot in rest pose.

    Again, one way I can fix this by hand is to import as unmorphed and replace the wrong items in the dbz version.

    steps:

    1. import testpercingg8f.duf in #2084

    errata corridge. The braids in the test scene are not in rest pose, the figure is but the hair is not. Once I place the hair in rest pose the pivots are right. So the issue seems limited to posed figures, as you noted.

    possible workaround. If this issue can't be fixed I can leave it open as reference, together with the other known limitations. In this case for posed figures we can fix the pivots by importing as unmorphed then replace the wrong items in the dbz version.

    steps:

    1. import as dbz
    2. delete parented objects
    3. import as unmorphed
    4. unparent from unmorphed and reparent to dbz, keeping transforms
    5. delete the unmorphed version

    better workaround. It is easier to unparent in daz studio then reparent in blender.

    1. in daz studio unparent items
    2. import in blender without “apply transforms“ to preserve the pivots
    3. reparent in blender

  16. Alessandro Padovani reporter

    question. unmorphed vs dbz pivots ? I can’t understand why pivots are different in the first place. I mean morphs can’t change pivots anyway, so why do you export different pivots in unmorphed and dbz ? Please let me know.

  17. Log in to comment