Saturday, August 1, 2020

Global Settings Improved

The Daz Importer depends on a number of global settings, that can be changed in the Settings panel. The most important of those are the Daz root paths, which tell the importer where to look for Daz assets; if the root paths are not the same as the ones defined in Daz Studio, the importer will not find the assets.

Until now, the global settings have been implemented as Blender properties, more precisely as scene properties. This is necessary in order to be able to display and modify the properties in the Settings panel. However, there is a serious drawback. If you have saved a start-up file, it will be loaded after the Daz importer has been initialized, and if the start-up file contains the scene properties used by the Daz importer, those values will be overwritten. So it does not help if you press the Save Default Settings button. The next time Blender is started, the new default settings are loaded, but they are immediately overwritten by the values in Blender's default start-up file.
Saving a startup file
To address this problem, the upcoming version 1.5 treats the global settings differently. The global settings are now global variables, which Blender can not mess with. In order to inspect and change the settings, they are converted into scene properties only when necessary, and then immediately converted back to global variables again.
To change the settings, press the Global Settings button immediately below Import DAZ File. The Global Settings dialog now appears.
In this dialog you can now change the settings, in particular the root paths to the left. If you press OK or hit carriage return, the settings are updated, and if you press outside the dialog or hit Escape any changes are cancelled.

Note that there are no Load/Save Default Settings buttons. This because all changes are persistent, so the default settings file is automatically updated when the settings are changed. The next time you open Blender, the updated settings are loaded.

The new settings system should be compatible with the old one, but since quite a lot of code is affected, there might be some glitches that have to be worked out.