Friday, March 26, 2021
More on the Morped Fitting Option
Wednesday, March 24, 2021
Importing a Morphed Character Without a DBZ File
The preferred workflow is to design a character in DAZ Studio, save it and export a dbz file, and then import the duf file with the DAZ Importer and Mesh Fitting set to DBZ. However, both DAZ Studio and Blender are evolving software that put increasingly strong demands on your hardware and software, and if you are on an old computer the latest versions may not work on it.
One solution would be to uninstall the latest version and stick with an old version that works, but I am not sure if that is possible with DAZ Studio. Another solution is to import the scene directly into Blender, without opening DAZ Studio. This will work as long as the DAZ database is intact. However, it means that you must import the character without having access to a dbz file, since you must open DAZ Studio in order to export it.
It is now possible to import a morphed character directly into Blender, without the need of a dbz file. However, the process is somewhat complicated and involves several steps. It works in the latest version of version 1.6.0 of the add-on. Since this feature is something which may be most interesting on old computers that may not be able to run Blender versions later than 2.79, and Blender 2.79 support has been removed from version 1.6.0, the stable version 1.5.1 has also been updated. Stable version 1.5.1c can be downloaded from
https://www.dropbox.com/s/6ec0e1nzuimlwg2/import_daz-v1.5.1c-20210324.zip
The illustrations below were made with Blender 2.79 and DAZ Importer 1.5.1.
The body mesh has a number of shapekeys that we need to transfer to the other meshes. With the mesh active and all other meshes selected, press Transfer Other Morphs (Transfer Shapekeys in version 1.6.0). Make sure to include all meshes, including hair and eyelashes.
In the options dialog, make sure that all shapekeys are selected. The other settings can be left at their default values.The shapekeys are now transferred to the clothes and hair. With all meshes selected (the order does not matter in this case), press Apply All Shapekeys.
The shapekeys go away and we have successfully imported the morphed character into Blender. We can now continue with the other steps (merge materials, load morphs, merge geografts, ...) that makes the character ready for animation.
The process above assumes that we have saved the DAZ scene but not the corresponding dbz file. But we can also design new characters from scratch, even if DAZ Studio is not working, as long as the DAZ database is intact.
{DAZ root}/People/Genesis 8 Female/Characters/
Select Aiko 8.duf or one of the corresponding png files, and import the DAZ file with Mesh Fitting set to Morphed.
With the Aiko mesh selected, press Import Custom Morph and go to the directory that contains the Aiko morphs, i.e.
{DAZ root}/data/DAZ 3D/Genesis 8/Female/Morphs/DAZ 3D/Aiko 8/
This tool should start in the directory
{DAZ root}/data/DAZ 3D/Genesis 8/Female/Morphs/
by default, so the Aiko 8 directory is only two clicks away. (If several root directories have subdirectories with Genesis 8 Female morphs, the tool may pick something that is far away from the right directory. That is a nuisance.).
Do not pick the CTRLAiko8.duf file. As explained above, it contains pointers to the FBM and FHM files, and the morphs are not loaded, at least not in version 1.5.1.Pick instead the FBM and FHM files in the same directory directly.Now the two Aiko morphs are loaded, and we can turn them on in the Custom Morphs panel. Notice that the brows and eyes are now aligned with the armature. Also notice that the shapekeys are driven, i.e. the sliders are purple. This will be important below.
Just importing the nude character is not so interesting, we want to add clothes and hair too. So let us import them with the Import DAZ File button, with Mesh Fitting set to Unmorphed this time.
Clothes and hair are imported, but clearly they do not fit the character. So again we use the Transfer Other Shapekeys tool.Select all meshes (clothes, hair and eyelashes) and make sure to transfer all morphs.
This problem did not appear for the previous character, because in that case the shapekeys were not driven. The Transfer Other Shapekeys tool automatically turns all shapekeys off before transfer and turn them on again once the transfer is complete. However, if the shapekey values are driven, this does not work, and we must turn them off manually instead.
Monday, March 22, 2021
Easy Import
After we have imported a DAZ character into Blender, we usually need to perform a number of operations on it before it is suitable for animation. The philosophy behind this is that the add-on can not foresee the need of every user, so the best thing is to import the scene as faithfully as possible, and then provide tools to turn the raw import into something useful. However, this flexibility can make it difficult to choose which tools to use and in which order. The new tool "Easy Import DAZ" is provided to facilitate import in the most common case, a single human character in rest pose.
- Easy Import DAZ is mainly intended for importing a single human character in rest pose. There are no guarantees if the scene contains something else, e.g. multiple characters, characters not in rest pose, animals, environments, props. Things may work, or they may not.
- The tool can import standard morphs (face morphs, body morphs, JCMs) but not custom morphs. Adding custom morphs to the character or its geografts must be done in a separate step afterwards.
- The tool has options for merging geografts and eyelashes to the main character. However, if those have been merged, it is not possible to add further morphs because vertex numbers have changed. If you plan on adding custom morphs after import, you must the disable the Merge Geografts and Merge Lashes options.
- Easy Import DAZ has an option to convert the native DAZ rig to the more animator-friendly MHX and Rigify rigs. However, again it is not possible to add more morphs after the rig has been converted.
- Easy Import does not work with nested geografts. E.g., Roasty is a geograft for Futalicious, which in turn is a geograft for female characters. In this situation you must uncheck the Merge Geografts option, and instead merge the geografts in a two-stage process afterwards.
When we invoke the Easy Import DAZ tool, a file selector with many options appear. This lets us decide how the character is treated during and after it is imported into Blender.
- Mesh Fitting: This option is the same as for the Import DAZ button, see this.
- Viewport Color: This option is the same as for the Import DAZ button, see this.
- Rig Type:
- DAZ: Leave the native DAZ rig unchanged.
- Custom Shapes: Add custom shapes to the native DAZ rig.
- MHX: Convert the rig to MHX.
- Rigify: Convert the rig to Rigify.
- Mannequin:
- None: Don't add a mannequin.
- Nude: Add a mannequin for the body mesh only.
- All: Add a mannequin for all meshes.
- Merge Materials: Merge identical materials into a single material.
- Merge Rigs: Merge clothes rigs with the main character rig.
- Merge Toes: Merge the individual toe bones into a single toe bones which moves all bones.
- Merge Geografts: Merge geografts to the main character. Body shapekeys (JCMs and flexions) are transferred to the geografts first.
- Merge Lashes: Merge eyelashes to the main character. Face shapekeys are transferred to the eyelashes first.
- Extra Face Bones: Add an extra layer of face bones, which remain posable after face morphs have been loaded. This is done before morphs are loaded.
- Make All Bones Poseable: Add an extra layer of poseable bones for bones that are driven. This is done after morphs have been loaded.
- Convert Hair: Convert strand-based hair (SBH) into particle hair in Blender.
- Face Units: Import face unit morphs.
- Expressions: Import expression morphs.
- Visemes: Import viseme morphs.
- FACS: Import FACS units morphs.
- FACS Expressions: Import FACS expression morphs.
- Body: Import body morphs.
- JCMs: Import JCMS (joint corrective morphs).
- Flexions: Import flexion morphs.
- Transfer Shapekeys (only visible if JCMs or Flexions is selected): Transfer JCMs and flexions to all clothes. Shapekeys are always transferred to geografts and eyelashes before merging irrespective of this setting.
Wednesday, March 3, 2021
New Morph System
Loading morphs and their associated drivers was done with one of the thorniest pieces of code in version 1.5 of the DAZ Importer. The code had grown organically over the years, with patches layered on patches. A major goal of version 1.6 is a complete rewrite of the morph system, something that is now almost done. There are still some known issues, but most things seem to work, in some aspects considerably better than before.
The new morph system is based on two suggestions.
engetudouiti suggested to use intermediate properties, to mimic how formulas are evaluated in DAZ Studio. I was initially skeptical about this idea because I was worried about update problems, but so far I have not encountered any. The old morph system attempted to flatten this hierarchy by computing the intermediate properties at load time. This worked reasonably well for most morphs, but for the recently introduced FACS morphs the size of the drivers blew out of propertions.
Xin pointed out that the drivers can be rewritten solely in terms of simple expressions, using even more intermediate properties that are eventually added with a sum driver. Unlike scripted expressions which are limited to strings with less than 512 characters (used to be 256), sum drivers do not have a limit on the number of variables. The limitation of scripted expressions was the reason why the custom drivers were introduced in the first place. Using simple expressions rather than custom drivers has several advantages:
- Performance is apparently much better, since simple drivers are evaluated in C++.
- The drivers can be easily inspected in the driver window.
- Animations will work even if the DAZ Importer is disabled, which means that you can send your files to a render farm without including the stripped runtime system.
You can choose whether to use the new simple drivers or the old custom drivers with the global setting Use Python Drivers (the name will change to Use Custom Drivers). However, the custom drivers are deprecated and will probably be removed eventually, even if the custom driver functions will be kept to not break old files.
There are still a number glitches with the new morph system, the most obvious is probably that you can only import morphs of a given type (face units, expressions, visemes, ...) once. For custom morphs, you can only import morphs to a given category once. If you need to import more morphs, reimport the old ones too.