Saturday, January 4, 2025

FILATOON

With daz studio 4.23 comes Filatoon, a new shader to draw toon style figures. With blender 4.3 and the new 4.3 version of the importer we can now get filatoon figures in blender. Beweare this is a first release so not all the filatoon features are supported, but it is enough to import most toon figures available in the DAZ shop.

ref. https://bitbucket.org/Diffeomorphic/import_daz/issues/2235/

Note that filatoon can only be rendered with eevee, not with cycles, this is the same in daz studio where filatoon only works with filament and not with iray. The toon outline is rendered with freestyle.

However there's a difference in lighting between daz studio and blender, as toon figures in daz studio are not lit by the HDRI, while in blender they always are. Even with the new light linking in blender 4.3 there's no way to exclude the HDRI. Of course this is not a issue if we only use regular lights without HDRI.

Below there's an example where we import a scene with HDRI, we have the G8F figure with iray materials, and the G9F toon with filatoon materials. We can see that in daz studio iray can't correctly render the toon figure, while filament can't correctly render the G8 figure. In blender we can render with eevee and both the toon and G8 figures are rendered correctly, however both are affected by the HDRI.


We can adjust both the HDRI threshold and the toon light inside the "daz toon diffuse" and "daz toon light" groups, note that adjusting one group will affect the whole scene.




Thursday, January 2, 2025

Strand-Based Hair and Hair Guides

In DAZ Studio we can give characters Strand-Based Hair (SBH), which corresponds to hair curves in Blender. Unfortunately, SBH often has a very high vertex count, which makes it rather unusable unless you have lots of patience. However, the DAZ Importer has an option to import hair guides in addition to the SBH itself, and the guides are much more lightweight and therefore better suited for Blender hair.

Here is Aiko equipped with a new hairdo made from SBH.
We can inspect the vertex counts with the mesh statistics tool. Aiko herself has some 16,500 verts, but the hair has a whopping 2,5 million verts, which will make it very heavy to animate.
Exporting a dbz file to Blender takes almost 70 seconds, compared to between 5 and 10 seconds for a typical transmapped hair. Waiting for the export script to conclude is quite painful, but there is nothing to do about this.
In Blender, turn on the "Import All Hair Versions" option. This will import the hair guides in addition to the hair itself.
Two polyline hair meshes are imported into Blender: the main hair with 2,5 million verts, and the hair guides with 200,000 verts. A difference of a factor around 12.
Now we delete the main hair and convert the hair guides to hair curves. 200,000 verts is still somewhat high for my taste, but the result with ten render children is quite good, so there would be nothing to gain by keeping the full hair mesh.

 

Saturday, December 28, 2024

DAZ Importer 4.3.0 Released

Version 4.3.0 of the DAZ Importer and MHX Runtime System have been released. They can be downloaded from

The previous stable version 4.2.1 does not work with Blender 4.3 due to an API change. The new version has also been tested with Blender 4.4 alpha, so there is a reasonable chance that it will work with the future Blender 4.4.

The previous release contained two more add-ons, DAZ Rigging and Shell Editor, which depended on the DAZ Importer. Because dependencies between add-ons lead to lots of complications, they have been reintegrated into the main add-on. Instead the DAZ Importer has been modularized. Many tools are not loaded by default, to keep down the complexity of the add-on for the casual user, cf the posts on Modularization and Modularization Complete.

Support has been added for Filatoon, a new shader in DAZ Studio 4.23 to draw toon style figures.

Import of morphed characters without first exporting a dbz file has been improved, even if it does not work quite as well as the dbz pipeline. I will write something about that later.

Sunday, November 24, 2024

Modularization Complete

Because the DAZ Importer addon has grown too big and unwieldy it has been split into several submodules, or features. The core functionality is always available, but peripheral tools are relegated to submodules that have to be enabled in the add-on preferences. The core functionality is roughly what is needed to make the Easy Import tool work. This was discussed in the previous post on Modularization, and the modularization process is now essentially complete.

Documentation on the various features is available at https://bitbucket.org/Diffeomorphic/import_daz/wiki/Features.

To see in where the buttons have gone, see the List of tools ordered by feature.



 

Wednesday, November 13, 2024

Modularization

The size of the DAZ Importer was growing out control, and therefore I decided to split the addon some time ago. Some seldomly used tools were moved to separate addons, which depend on the DAZ Importer. However, this did not work out so well, especially after Blender extensions were introduced in Blender 4.2. The preset exporter, daz rigging tools, and shell editor are now back in the  main addon, but they are now features that can be enabled and disabled in the addon preferences.

At the bottom of the dialog we can enable and disabled features.
If the DAZ Exporter feature is disabled, there is no export  panel in the DAZ Runtime tab.
If we enable the feature, the Export panel appears.

The tools for building advanced rigs (simple IK, MHX and Rigify) have also been made into features that can be disabled if you don't want them.

If all three rigging features are disabled, the Rigging panel is almost empy.
But if we  enable all three features the buttons are back.

Thursday, October 10, 2024

Diffeomorphic Add-Ons version 4.2.1 Released

It is time for a new stable release of the DAZ Importer and the other Diffeomorphic add-ons. The main novelty is that the add-ons have been converted to Blender extensions in Blender 4.2, cf the posts on Blender Extensions and GPL and Addon Scripting and Blender Extensions. The add-ons can also be installed in earlier versions of Blender. As usual, several bugs have also been fixed.

The DAZ Studio export script (export_to_blender.dsa) has also been updated and should be copied to the Scripts folder in a DAZ Studio directory. The specialized HD export script (export_highdef_to_blender.dsa) has been merged with the main export script and is now obsolete. Old versions of the script still work in most situations.

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/hka5ej1dv65gk04p1pn5x/import_daz-4.2.1.zip?rlkey=9ukju1y5zai4pryp5atblcbe9
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/ry8nwojh62s3y23w4g5bp/mhx_rts-4.2.1.zip?rlkey=mx0worrq46afetxumvmo8yhg8
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. It can also import facial animations in FaceCap, LiveLink, VMD and FBX formats.
Download:
https://www.dropbox.com/scl/fi/qh6czqobslto9q0ea6kh6/retarget_bvh-4.2.1.zip?rlkey=g9xpumgp6xzh94frzromb8psy
Documentation:
https://bitbucket.org/Diffeomorphic/retarget_bvh/wiki/Home


The next two 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 and result in warnings about policy errors. The the previous release there was a third add-on for exporting pose presets back to DAZ Studio, but that has been merged with the main DAZ Importer add-on again.

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

DAZ Rigging

Some specialized tools for rigging certain types of figures, link chains and tails.
Download:
https://www.dropbox.com/scl/fi/xqgb698891hlwqr3bon7z/rig_daz-4.2.1.zip?rlkey=k5mhdxlwi7civx5uzrozk6svz
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/bqh6cu4o33jdpwr4nspct/shell_edit-4.2.1.zip?rlkey=09ls8m6em95dicc4kvk54r000
Documentation:
https://bitbucket.org/Diffeomorphic/shell_edit/wiki/Home

Wednesday, October 2, 2024

Addon Scripting and Blender Extensions

As mentioned in the previous post on Blender Extensions and GPL, the DAZ Importer is now a Blender extension under Blender 4.2. It still works as a legacy addon in earlier Blender versions. This poses some challenges when using the addon in scripts. Here is an example.

import bpy
import import_daz

relpath = "/scenes/aiko-basic-wear.duf"
abspaths = import_daz.get_absolute_paths([relpath])
import_daz.set_selection(abspaths)
bpy.ops.daz.easy_import_daz(
   useExpressions = True,
   useJcms = True,
   clothesColor = (0,0,1,1.000),
   useTransferClothes = True,
   useMakePosable = True,
)
print("Loaded %s" % import_daz.get_selection())


This script loads a scene with Aiko dressed in Basic wear. The scene is located in the scenes directory under one of the DAZ root paths. The corresponding absolute path depends on the root paths specified in the global settings, and we use the import_daz.get_absolute_paths() function to retrieve it. Since a relative path may correspond to multiple absolute paths, this function returns a list.

Easy import is done with the bpy.ops.daz.easy_import_daz() operator, but we have to tell it which files to import first. This is done with the import_daz.set_selection() function, which should be called before any operator that acts on a list of strings.

The script above works fine in Blender 4.1 and earlier versions of Blender (some keyword argument may be different in very old addon versions), but in Blender 4.2 it causes an error:

ModuleNotFoundError: No module named 'import_daz'

The culprit is the line

import import_daz

which doesn't work because the import_daz module is not in the Python path anymore. To resolve this, we first notice that the entire DAZ Importer API is located in the import_daz.api submodule, which can be imported into the script with the line

from bl_ext.user_default.import_daz import api

Since we have imported the api module rather than the import_daz one, all function calls must change. E.g.,

abspaths = import_daz.get_absolute_paths([relpath])

is replaced by

abspaths = api.get_absolute_paths([relpath])


With these modifications, the full script becomes

import bpy
from bl_ext.user_default.import_daz import api

relpath = "/scenes/aiko-basic-wear.duf"
abspaths = api.get_absolute_paths([relpath])
api.set_selection(abspaths)
bpy.ops.daz.easy_import_daz(
   useExpressions = True,
   useJcms = True,
   clothesColor = (0,0,1,1.000),
   useTransferClothes = True,
   useMakePosable = True,
)
print("Loaded %s" % api.get_selection())

The new script works fine in Blender 4.2, but now we get an error when running the script in Blender 4.1.

ModuleNotFoundError: No module named 'bl_ext.user_default'; 'bl_ext' is not a package

To make the script work both in Blender 4.2 and earlier Blender versions, we can replace the code at the top with

try:
    from import_daz import api
except ModuleNotFoundError:
    from bl_ext.user_default.import_daz import api