Trying to fully understand DAZ Rigs

cbacba Posts: 0
edited March 2018 in Daz Studio Discussion

My ultimate goal is to develop a solid (I mean, really solid) solution to finally create high quality animations for DAZ characters, using a full-fledged control rig with all the features a professional animator would ask for. Optimally, the animations could be done directly in DAZ but I would also be happy if I'd have to export the figure data, animate it in another tool (Blender, Maya, ...) and then re-import it.

In order to do this, I need to know more details about DAZ rigs. Since quite some time I'm trying to understand how they actually work but I haven't found much information on this. There are discussions, guesses and tons of weird workarounds for all sorts of problems going on but nobody really seems to know how this stuff works under the hood.

If you search for anything related to animations in DAZ, the only things you get are tutorials on aniBlocks, or how to do very simple animations. I also found a bunch of tutorials and small scripts supposed to help export DAZ figures to other tools but none of the approaches actually preserves the exact rigging information (Exchange formats are a pain since decades). Rotation limits/constraints (which are vital) seem to be completely ignored by pretty much all of the approaches I've found.

What I want to achieve:

  • Being able to automatically create a complete control rig for human DAZ characters allowing rock-solid IK
  • Either an integrated solution in DAZ or a reliable export-import workflow (I'm okay with a custom file format)

What I think I figured out so far

Bones in DAZ have their origin at the center point (duh!) but the end point adds some mysterious properties that I still couldn't wrap my head around...
The first axis of the rotation order (XYZ, ZXY, ...) determines the forward axis of the bone. If the end point's position on that particular axis (the first in the rotation order) is smaller or greater than the center point's position on the same axis, the orientation of the bone is flipped accordingly (try doing that with a bone having a 0,0,0 orientation).
If the end point is translated on one of the other axes, the bone merely changes in length. While messing around with the end points, I was assuming that the bone's length is equal to the distance between the center point and the end point but that doesn't seem to be correct.

The orientation of a bone also isn't entirely clear to me. First I thought it's pretty straight forward but the dependency to the end point makes it rather confusing.

I'd assume that either having a start point, an end point and a roll-value or an origin, a length and an orientation would be sufficient for describing a bone..?
DAZ seems to use an approach I haven't seen anywhere else...

What I did so far

Because I want to have full control over every single piece of data, I wrote an export script for DAZ characters that writes out a file in a custom format. I then wrote an add-on for Blender to import the data, so that I can create a control rig.

The big problems that are preventing me from making progress are the bone orientations and the lengths. Blender also uses a start-point (head) and an end-point (tail) for each bone but it uses a roll-value to determine the bone's rotation along its forward-axis (Y in Blender). I tried many different things but I couldn't figure out the correct math to convert DAZ's bone orientations to Blender.

When I almost felt like giving up on this and rage-quit, I tried something different by creating the bones in Blender pointing along their forward axis (also depending on the end point's position to do the orientation-flipping), then use the orientations from DAZ to rotate the bones in Blender's Pose Mode to finally bake the resulting pose as the rest pose - no success so far...
I haven't spent too much time on this idea, though. It's totally possible that I messed something up because converting all the axis-related stuff from DAZ to Blender is pretty finnicky and requires extra care.
Even though I assume that the bone lengths aren't too critical, I still don't know of a function or the according math to figure out the exact lengths in DAZ. To get a bone's length, I simply compute the distance between the center point and the end point but, as mentioned before, that doesn't seem to be 100% correct.

I didn't think too much about creating an integrated solution for DAZ because writing a good IK-solver isn't very trivial. If I keep failing with the current idea, I'll probably look into this.

Thank you for hints

First of all, I want to thank you if you actually read this far. I hope, my explanations aren't too hard to follow.
If you have any hints or if you can disprove any of my assumptions, please let me know. If you actually know a workflow which allows me to do what I want, I'd also appreciate that.

I'm pretty sure, the only reason why I'm struggling with this so much is simply because I don't fully understand how DAZ defines bones in the first place.

Thank you for helping!


- Chris

 

Post edited by Richard Haseltine on

Comments

  • Richard HaseltineRichard Haseltine Posts: 102,418

    Moved to Daz Studio Discussion since it's about DS rigging rather than scripting.

    Not being familiar with Blender or its rigging I'm not sure of some of your terms, the first axis in the rotation order is the twist axis, the second and third are bends (the third being the one most likely to hit ninety-degrees, to reduce the likelihood of gimbal lock. The orientation is used to modify that, since bones rarely fall exactly along an axis. The end-point can be useful in creating a skeleton (snapping the centre of the enxt bone to the end of its parent) and is used for the Point At feature (as I recall). Length per se is not, as far as I know, important - generally bones touch end to end but it isn't functionally significant (again, as far as I know).

  • cbacba Posts: 0

    Even though the stuff I'm trying to do eventually involves a bunch of coding, moving this disucssion to a different section makes sense because it's about understanding DAZ rigs - so, thank you for that...

    I think I figured out the same behavior of the orientation-axes (exactly how Euler angles work) but it's good to know that I seem to be on the right path.

    The end point still remains mysterious to me, though. I understand what it's used for in DAZ but my goal is to really understand how it influences the bone mathematically. If the end point would be some kind of special "anchor" which could be used for the PointAt-feature but without influencing the bone, I'd have a lot less trouble unterstanding what it does internally.
    The same confusion applies to the length... It doesn't seem to matter much in DAZ but there is no clear reason to me why it is there and (foremost) how it is actually calculated.

    I'll do some more experiments...

    Thank you for your reply!

  • PadonePadone Posts: 3,786

    @cba What you aim for is impossible because DAZ Studio doesn't provide parentable ik targets as Blender or Maya do. So the ik system in DAZ Studio is better used for posing, rather than for animation. A professional rig for animation does require parentable ik targets.

Sign In or Register to comment.