Sunday, August 30, 2020

Rotation locks and limits

In DAZ Studio, bone rotations must stay within certain limits, in order not to create impossible poses. These limits could not be used in Blender when characters were imported with the old (Blender Legacy) bone orientations, because there was no straightforward relation between the bone orientations in DAZ Studio and Blender. Therefore, only very basic limits were imposed to prevent the rig from breaking: bone locations were locked (except for face bones), and X and Z rotations were locked for bones whose names end with "Twist".

In the new (DAZ Studio) orientation, bone orientations are the same in Blender and DAZ Studio, except that some axes have been interchanged in order to make Y the twist axis and X the primary bend axis. We can therefore use the locks and limits that are stored in the duf files, provided that the axes are interchanged in the same way. This is implemented in the latest commits.

Wednesday, August 26, 2020

DAZ Studio bones


With the help of engetudouiti the bones are now oriented correctly even when the mesh is posed in DAZ Studio. Compare a posed Aiko from yesterday and from today.

Since this means that the Apply Morphs and Copy Bones buttons are no longer frequently needed, they have been relegated back to the Advanced Rigging section. The Use Clothes Bones option of the Merge Rigs button was also removed for the same reason


Original post

The way the Daz Importer creates bones in Blender has been slightly different from how the bones are oriented in DAZ Studio. The Blender bones go from the bone's center point (head or pivot point) to the bone's end point. However, in DAZ Studio the end point is a handle to grab the bone, and not necessarily located along the direction of the bone. Although usually it is, which is the reason why the end point works quite well as bone tail. In fact, I would not have noticed the difference, unless frequent commenter engetudouiti had pointed it out.

In version 1.5 of the plugin, the default bone orientation has been changed to conform with the orientation in DAZ Studio.

You can choose the method used for bone orientation in the Rigging section of the Global settings dialog. There are three alternatives.

  • Blender Legacy: The old method where bones end in the end points. This still works as it always has.
  • DAZ Unflipped: The bones are oriented exactly the same way as in DAZ Studio, apart from a 90-degree rotation in world space (can be turned off by disabling Z Up). This mode is for debug purposes only, since bones in DAZ Studio don't have to be point in the local Y direction.
  • DAZ Studio: The bones are oriented as in DAZ Studio, followed by a set of 90-degree rotations which shift the local coordinate axes.

Here we have imported Aiko, who is the heroïne of the 1.5 documentation, using the three different methods for bone orientation. The armatures to the left and right look quite similar, but there are some differences.

If the character was imported with Mesh Fitting = DBZ File, Aiko's feet fit into her sandals, but her foot bones do not. This is just how the information is stored in the .duf file. The orientation of the body feet bones (red) are the same as in the rest pose, whereas the sandal feet bones (blue) have a different orientation. We want the bones of the merged rig to be like the blue bones. This is done with the Copy Bones tool, which copies the bones in edit mode from the selected rig to the active one.

If Aiko was imported with Mesh Fitting = Unmorphed Shared or Unique, the foot appears to fit into the sandal. However, this is an illustion because the foot is posed; the rest pose is still standing on the soles.

We can fix this with the Apply Rest Pose tool. Note that in the picture below, there is still a slight difference between the red and blue bones, so we might want to Copy Bones too.

The Merge Rigs button has got two new options which modifies the rigs before doing the actual merge:

  • Apply Rest Pose: Apply the rest poses of all selected meshes before merging rigs.
  • Use Clothes Bones: Copy bone orientation from all selected (clothes) rigs to the active (body) rig before merging bones.

Using these options is convenient, but sometimes they are too crude. You may want to use the bone orientations for some the clothes but not others. In that case using the Apply Rest Pose and Copy Bones buttons are the way to go.