Friday, May 31, 2024

Diffeomorphic Add-ons Version 4.1.0 Released.

It is time for new stable releases. This time six separate add-ons are released at the same time, so you only need to download the add-ons that you actually need. As announced previously, the add-on version is now synced with Blender, so the latest version of Blender that these add-ons have been tested with is Blender 4.1.0. They have also briefly been tested in Blender 2.83, and there is a good chance that they will work with intermediate Blender versions too.


DAZ Importer
The DAZ Importer is a Blender add-on for importing native DAZ Studio files (.duf, .dsf) into Blender. It also contains some tools to make the assets more animation friendly.
Download:
https://www.dropbox.com/scl/fi/58f6obzmh063ae9d88ugg/import_daz_v4_1_0.zip?rlkey=qnq6cu0fx4qki9rpxlu95o9h1
Documentation:
https://bitbucket.org/Diffeomorphic/import_daz/wiki/Home


MHX Runtime System

The MHX Runtime System is a Blender add-on for posing the MHX rig, that can be generated by the DAZ Importer.
Download:
https://www.dropbox.com/scl/fi/869tqthaajnznk2vaka2f/mhx_rts_v4_1_0.zip?rlkey=94tfjkaiofzmkwm5ff2gs0m8t
Documentation:
https://bitbucket.org/Diffeomorphic/mhx_rts/wiki/Home


BVH and FBX Retargeter
The purpose of the BVH and FBX Retargeter is loading animations from BVH or FBX files to a given armature, and editing these animations in various useful ways.
Download:
https://www.dropbox.com/scl/fi/ge0grf1x4fzr9ojgc76up/retarget_bvh_v4_1_0.zip?rlkey=7tdo5tfppgay04h7g3wjvk2bb
Documentation:
https://bitbucket.org/Diffeomorphic/retarget_bvh/wiki/Home


The next three add-ons were recently spawned from the DAZ Importer in order to keep down its size somewhat. They contain rather specialized tools that are probably not of interest to most users. They are also poorly documented.

Important: The DAZ Importer must be enabled first, before any of these three add-ons can be used.

DAZ Preset Exporter
This add-on contains some tools for creating pose presets and other assets that can be used in DAZ Studio.
Download:
https://www.dropbox.com/scl/fi/nfqjioymya3sofq71pcv4/export_daz_v4_1_0.zip?rlkey=4nujmfmir99dqf6sm7y0weyzi
Documentation:
https://bitbucket.org/Diffeomorphic/export_daz/wiki/Home


DAZ Rigging
Some specialized tools for rigging certain types of figures, link chains and tails.
Download:
https://www.dropbox.com/scl/fi/yxbgw81qefraag8kfmwbs/rig_daz_v4_1_0.zip?rlkey=it2g7t7gka9i0jz5z52g1oxec
Documentation:
https://bitbucket.org/Diffeomorphic/rig_daz/wiki/Home


Shell Editor
Contains some tools for manipulating shells imported from DAZ Studio.
Download:
https://www.dropbox.com/scl/fi/zl1s34xasma4i9deo05j7/shell_edit_v4_1_0.zip?rlkey=7fr4izofl0a7srvacppgr0x8u
Documentation:
https://bitbucket.org/Diffeomorphic/shell_edit/wiki/Home


Sunday, May 19, 2024

New Version Numbers

It will soon be time for a new release of the DAZ Importer and MHX Runtime Systems. But recently a number of related add-ons were spawned from the importer add-on, cf the post on Add-on Split. There has also been some progress on the BVH Retargeter, which can now also deal with FBX files, see FBX Files and BVH Retargeter. The plan is to release all of them together in the near future.

Since the last release was version 1.7.3, the original plan was to call the new release 1.7.4. However, the BVH Retargeter is already at version 2.2 (version 2.0 was when the name changed from MakeWalk), so going back to 1.7.4 would be confusing. Therefore, I decided to change the version number of all add-ons to 4.1.0. 

Making such a jump in version number is unusual, but it is not that different from DAZ going from Genesis 3 to Genesis 8. And of course the new version number carries another piece of information: 4.1.0 is the most recent version of Blender that the add-ons have been tested with. Even if the Diffeo add-ons are by now quite mature and I don't expect to add much new functionality (but you never know), there will probably be updates since new Blender versions always tend to break something.

Tuesday, May 14, 2024

Blender Shells

A geometry shell or geoshell in DAZ Studio is a kind of virtual mesh. It is a clone of a base mesh which can modify materials and some other properties. When loading a figure with geoshells the DAZ Importer creates a special node group in every material affected by the shell (if the Shell Method setting is set to Material). GeneralProtectionFault recently suggested that we might want to use the shell tools to add other node groups created in Blender. 

This idea has now been implemented. Since the DAZ Importer has grown too large and unwieldy, it was recently split into several separate add-ons, see the post on Add-on Split. The new tool that makes Blender shells is located in the Shell Editor, which contains tools for manipulating shells and layered images from DAZ Importer. The idea is to take a given node group, and make it into a shell which behaves just as the shells imported from DAZ Studio.

GeneralProtectionFault made a script which creates a procedural dirt node group. The script can be downloaded from here. To create the node group, load the script into Blender's text editor and press the Run Script button.

A node group is created in Blender's database. We could also create the node group manually. The only requirement is that the first input and output sockets be the ingoing and outgoing shaders, respectively.
Select the mesh and Add Custom Shell.
In the dialog, select the node group at the top and select the materials . Here we pressed the Skin button to quickly select all skin materials.
At the end of each node tree, a shell node group is created. It has the same sockets as every other shell node. Notice that the Influence slider is purple, meaning that it is driven.
To create drivers the global setting Shell driver type must not be None. I prefer to use rig properties to drive the influence, because using mesh object properties doesn’t seem to work with file linking, but armature object properties do.
The shell node group is a wrapper that contains the original node group and mixes the output with the original shader according to Influence. The only requirement is that the first input and first output are the ingoing and outgoing shader. If you want to tweak the node parameters, we can do it here and all materials are changed. The UV and Displacement sockets could also be used.
We can control the influence of shells in the DAZ Runtime > Visibility > Shells panel.

 

Saturday, March 30, 2024

Manual Editing of Favorite Morphs

It is possible to import the same morph twice, both as a standard morph and as a custom morph. If we have done that and then saved the morphs as favorite morphs, the duplicate morphs will be loaded to each new character that uses these favorites. This is a nuisance that I have run into several times, and since it turns out that I'm not alone, I will explain how I deal with this issue: by cheating. More exactly, by editing the json file with favorite morphs in a text editor.

Here we have loaded some FACS morphs, and also loaded some custom morphs that move the jaw. We notice that the FACS Jaw Open and Custom Open sliders always show the same value. This is because they are in fact the same slider; the custom property "facs_jnt_JawOpen". We want to remove this slider from the json file, so next time the slider only appears in the FACS panel.

Save favorite morphs to a new file. Disable the new Compact View option to make it easier to edit the json file.

Now open the json file that we just saved in a text editor. Each line contains information about one morph: the file where it is defined, the morph name, and the body type. We see that  several JawOpen morphs appear in both the FACS and Custom/Jaw sections. Delete the lines from the latter and save the json file.

If we now load the favorite morphs to a new character, the Jaw Open morph only appears in the FACS panel.

A warning. The json format is quite picky, and it is easy to change the file to illegal syntax. That is why I recommend that you save a new file, so the old one is not corrupted. 

Here is an example. Removing the last morph from the FACS section make the syntax illegal, because of the trailing comma at the end of the line before it. The elements of a json list are separated by commas, but there must be no comma after the last element.

If we try to load the corrupt file we get an error. More information about what went wrong is given in the console window.

JSON error while reading ascii file
"D:\home\myblends\New Folder\my-favos-noncompact.json"
Expecting value: line 14 column 13 (char 2101)

So the problem with the extra comma happens close to line 14 (the comma is actually on the line before).

Sunday, March 24, 2024

Fixing Sloping Shoulders

When we imported the UE4 animation in the post on FBX Files and BVH Retargeter, we noticed that the collar bones have a quite unnatural pose; the shoulders are sloping. This is unfortunately something that happens quite often, but not always. It depends on the rest pose of the rig in the BVH file.

This can sort of be fixed with the Shift Animation tool. Rotate the collar bones up, and then rotate the upper arms down to compensate. However this is quite annoying and the result is not always good, so I found a different solution. The new Clear Bones tool clears the animation of the collar bones, which usually shouldn't move so much anyway, and then rotates the upper arms so their rotation in world space remains unchanged.

Here we have a typical situation. The collar bones slope far too much.
With the collar bones selected, press Clear Bones.
Now the collar bones don't slope anymore, and the arms remain oriented in the same way as before. The pivot points of the upper arms have moved, since the collar bones are rotated differently, but the arm's world space rotation is unchanged.

Friday, March 22, 2024

FBX Files and BVH Retargeter

As the name suggests, the BVH retargeter imports animations from BVH files. However, it appears that popular sites like Mixamo only offer animations in FBX format these days. Recently user GeneralProtectionFault suggested that one could use the BVH retargeter for FBX files as well, by first importing the FBX file with Blender's built-in FBX importer and then writing the animation as a temporary BVH file. This technique has previously been used in this add-on.

Support for FBX files has been implemented in the development version of the BVH retargeter. We can notice that the "Load BVH File" button has been renamed, and is now called "Load BVH or FBX File". To import the animation, we select our target rig and press "Load And Retarget" as usual.
Select the Capoeira.fbx file which can be downloaded from Mixamo or from the issue in the bug tracker.

Also note that the panel to the right has changed. The add-on now uses the standard Blender way to specify the orientation of the rig in the animation file.

And now our character does the capoeira.

The DAZ Importer has been able to import facial animations in the FaceCap and LiveLink formats for a long time, see e.g. this FaceCap test. Bouich Jules found another good way, and it’s UE4 facial animation, used here by QUICKMAGIC https://www.quickmagic.ai/index/. Again the files are in FBX format, so we need to do a similar trick as above. First the add-on imports the FBX file with Blender's FBX importer, and then copies the FACS animation from the imported mesh to the target rig. A sample file can be found in the issue in the bug tracker.

The complete FBX animation includes both the body poses and the FACS morphs. To import it to our target character we proceed in two steps. First we Load And Retarget the FBX file in the same way as we did with the capoeira file above.
Our character now moves, but her expression remains blank.
Let us now import the facial animation. If you have not already done so, go to the DAZ Importer and import the FACS morphs and make all bones posable.
Now open the new FACS panel in the BVH retargeter tab. These tools used to be located in the DAZ Runtime > Morphs > FACS panel, but it makes more sense to import the entire animation from the same add-on.

With the target character selected, press Import FACS From FBX File.

Select the same FBX file as above. Disable the New Action option so the face and body animations belong to the same action. Alternatively, we can make a new action and push both actions down on the NLA stack.
And now our character both moves and smiles.

Sunday, February 4, 2024

Add-on Split

The DAZ Importer add-on has grown to become a huge beast, which contains lots of specialized tools that are of no interest to most people. In an attempt to reduce the size of the add-on, I decided to split it into several pieces and move some tools into specialized add-ons.

There are now five separate add-ons:

The DAZ Importer and MHX Runtime System are stand-alone add-ons, but the other three require that the DAZ Importer is installed and named import_daz.

The tools are located in panels in the DAZ Setup tab.
The DAZ Rig add-on also adds a panel in the DAZ Runtime tab. 

The new add-ons are poorly documented, but at least all of them have wikis:

 

Important note on installing dependent add-ons: 

The DAZ Importer must be called import_daz. If we download the development version as a zip file, Bitbucket adds the string "Diffeomorphic" and the commit identifier to the file name. So the zip file may be called Diffeomorphic-import_daz-c400c95d0ec9.zip. This is not a problem if we only install the DAZ Importer, but if we download and try to install dependent add-ons like the Preset Exporter, we get and the error message:

  File "d:\home\blenders\blender-3.00\3.0\scripts\modules\addon_utils.py", line 351, in enable
    mod = __import__(module_name)
  File "C:\Users\Comsol\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons\Diffeomorphic-export_daz-2e4b7ccd9acb\__init__.py", line 42, in <module>
    import import_daz
ModuleNotFoundError: No module named 'import_daz'


The problem is that the DAZ Importer is not called import_daz.

If we go to the place where Blender puts the add-ons, which on my system is C:\Users\Comsol\AppData\Roaming\Blender Foundation\Blender\3.0\scripts\addons, we see that it has copied the content of the zip files, but the folders have bad names.
Rename the DAZ Importer to import_daz. We can leave the name of the other folder unchanged.
When we refresh the preferences window, Blender no longer finds the installed add-on.
Disable the missing add-on. We can now search for the add-ons that contain the string "daz" and enable them. The DAZ Importer add-on must be enabled first.

 

Simpler Method

There is an alternative, simpler method to rename the import_daz add-on.

Navigate to the place where you downloaded the zip file. Open it in WinRAR or a similar program. It contains a single folder with the problematic name.

Change the name of the zipped folder to import_daz. We can also change the name of the dependent add-on in its zip file, although that is optional.

We can now install the add-ons from zip files, and they will be correctly named.