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.