preferences and multiple installations

Issue #2201 resolved
Alessandro Padovani created an issue

It is probably too late now, as previous versions already do it as is. But some users may want to keep multiple versions of blender, each with its version of the addon. For example blender 2.7 with importer 1.5, then blender 2.9 with importer 1.7, then blender 4.2 with importer 4.2.

I understand the current approach is using a global folder “daz importer“ to store preferences, which is shared among different addon versions, with custom code to handle preferences.

I also understand blender has its own standard way to handle preferences, that some addons use as the miku dance importer “mmd_tools“ for example, which code seems very well structured in general. This way the preferences inherit from the AddonPreferences class and are handled by blender, thus they’re local to the blender version.

You may find this interesting and want to update the code, though it seems to me that blender doesn’t fit very well large preferences as it is the case with diffeomorphic. Let us know if you’re interested, or we can close as wontfix if you think this is not useful.

https://docs.blender.org/manual/en/latest/editors/preferences/addons.html

https://docs.blender.org/api/current/bpy.types.AddonPreferences.html

https://devtalk.blender.org/t/appending-addon-preferences-from-modules/27276

Comments (22)

  1. Thomas Larsson repo owner

    Implemented in last commit. The directory with the settings file is specified in the

    There is a new restriction. The paths to scanned morphs and error dump file are now local, so it is not possible to put them outside the main directory. This was the default behaviour before too, but now it is mandatory.

  2. Alessandro Padovani reporter

    Works fine thank you, now we can specify the preferences location that wasn’t possible before. For example I specified the blender 4 config folder so the addon settings go with the other blender settings.

    todo. bvh. This needs to be done for every addon having preferences though, including the bvh retargeter. Let us know.

    note. settings reorganization. Personally I was thinking something more radical, as transferring the preferences to the standard blender panel, plus a reorganization to shrink the preferences, and make most options more in the proper place. Something as below. I understand this is some work, the benefit would be a more standard use of the preferences, and a better organization of options, as now we have some options in the global settings that are really tools, more than global settings.

    • daz studio root directories, debugging, presets: move to the addon preferences standard panel.
    • general: move “unit scale” to the import dialog, and the others to the addon preferences.
    • meshes, objects, rigging: move to the import dialog.
    • materials: move what possible to the import dialog, as “sss” “displacement“ “skin method“ for example, the rest to the addon preferences, as “render settings“ “light settings“.
    • morphs: move what possible to the import dialog, as “default drivers“ “optimize jcms“ “spline drivers“, move what possible to the morphs panel, as “show final values“ “show used morphs only“, the rest to the addon preferences.

    Each section can have its own tab as in the standard fbx importer for example, so to keep easy import as is, plus some extra tabs with the optional default values. If you are not interested, or it is too much work, we can close as resolved as the preferences location was the most important thing and it is fixed. Let us know.

  3. Alessandro Padovani reporter

    p.s. too many options ? For further simplification some global settings could be removed all together, as they are options more for the developer than the user, and mostly confusing to deal with. Below my notes that you may want to consider, at least for confrontation. This would be a great simplification.

    meshes:

    • improve triax: removed and always on, there’s no reason not to
    • build HD: removed and always on, it is redundant with the HD convention
    • add multires: removed and always on, eventually the user can apply multires later if he wants the True HD mesh
    • import all hair versions: removed and always on, the user can delete guides later if he doesn’t want them

    rigging:

    • daz orientation, subtract rest pose: always off and moved to debug, or removed all together. These don’t work and were to allow the pre-bended workflow, but we can do the same with the retargeting addon which works fine, for we can retarget a daz pose or animation to a pre-bended rig.
    • quaternions: in my opinion this should always be off when we import the daz rig, so to have the rig the same as daz studio. Then the rig conversion to mhx or simple ik should always convert to quaternions, as animation is not possible without.
    • bone colors: removed and always on, there’s no reason not to

    morphs:

    • slider limits, final limits: removed and always “daz”, this is anyway necessary to get daz poses and animations right
    • final multiplier: removed and always 10, same as above
    • custom min, custom max: removed, the new soft limits make this obsolete and not necessary anymore
    • shapekeys, shapekey categories, mesh drivers: removed and always on, there’s no reason not to
    • optimize jcm drivers: now that this is fixed can be removed and always on
    • spline drivers: in my opinion removed and always on, as daz poses and sliders don’t work fine without

    materials:

    • lower resolution folders, materials by index, sort alphabetically: if these work fine then removed and always on, unless there’s some reason not to
    • layered images in shells: if this works fine then removed and always on, as daz studio does use LIEs for shell textures.
    • displacement, emission, volume, reflection: removed and always on, there’s no reason not to

  4. Thomas Larsson repo owner

    I do appreciate that people may want different settings for different Blender versions, although that could be achieved before with the Load/Save Settings buttons. But I think the current global settings dialog works fine, and I don’t want to spend a lot of work on something that doesn’t really improve anything.

    Having global settings is useful if we have many buttons that do the same thing. E.g., there are a dozen buttons that import morphs (including easy import). It doesn’t make sense if each of these have options for ERC morphs. In fact, I would rather go in the opposite directions and put the make posable and transfer to face meshes global options.

    It might be time to remove some obsolete options. However, some need to stay. E.g. ignoring emission is very useful if you import a scene with many lightbulbs with emissive materials, because a lot of small light sources will slow down rendering and cause fireflies.

  5. Alessandro Padovani reporter

    Thank you for considering my notes. Personally I’m under the impression that the importer is by far overcomplicated as for options, and a simplification would benefit the usability, but I understand it may be not worth it if it takes too much work.

    Let me know if you can add the preferences location for the retarget_bvh addon, or use the same location as the importer, so we can close as resolved.

  6. Thomas Larsson repo owner

    I have started to clean up the global settings. Everything related to morph limits has been replaced by a single option, with three values:

    • None: No limits.
    • Soft: Daz limits for sliders, 10 times for final properties and shapekeys.
    • Hard: Daz limits for both sliders, final properties and shapekeys.

    Custom limits can be achieved with the Set Slider Limits button in the advanced morph section.

  7. Alessandro Padovani reporter

    As I understand it based on #2158 #2143, for daz morphs to work we must have:

    • daz limits for final values
    • no limits for sliders, where we use daz soft limits eventually by a multiplier, soft limits don’t limit the final value but only the slider scrubbing
    • no limits for shapekeys, where we use the -10 10 maximum allowed by blender

    So none of the new options will work, unless I misunderstand what you mean. The slider multiplier is useful in animation to overshoot the daz sliders within the blender slider range for a practical interface, so I would not remove it as it is probably the only useful option we have, unless you can add the option to “set slider limits“.

    This is the old settings that will work for daz poses, is this equivalent to the new “soft” option ?

    • slider limits: daz
    • final limits: daz
    • slider multiplier: set by the user, or add the option to “set slider limits“
    • final multiplier: 10 for adjusters to work, this is only necessary for adjusters

    Please let us know, thank you.

  8. Alessandro Padovani reporter

    note. important. The idea here is to simplify options by removing/grouping them and using default values instead, working on the front-end. Not to change the logic behind, that would be potentially dangerous and possibly hard to fix if something goes the wrong way.

  9. Alessandro Padovani reporter

    Commit d62653f.

    bug. local preferences. Installing the last commit changed my preferences to default values in another blender installation, thus defying the purpose for local preferences.

    steps:

    1. install commit d9d40cf in blender 3.6 with preferences in the blender 3.6 folder, then change some preferences
    2. install commit d62653f in blender 4.2 with preferences in the blender 4.2 folder, this changed my preferences in blender 3.6 to default values

    options. adjusters vs slider multiplier. Practically the slider multiplier, that is now removed, was an alternative to adjusters. That is, we either used separate adjusters for each category, or the slider multiplier which worked everywhere. It is true that we can use adjusters instead of the slider multiplier, achieving the same final effect, but being the slider multiplier much easier both as interface and implementation, would be useful to have it back.

    update. important. It turns out adjusters can’t replace the slider multiplier. That is, adjusters do affect a daz animation, being them multipliers for the slider values. While the slider multiplier doesn’t affect a daz animation, being it a multiplier for the slider range. This is not a bug as it is the intended behavior, but it proves that adjusters can’t replace the slider multiplier as they’re very different things.

    steps:

    1. set adjusters to “all“ in the global settings
    2. import a daz animation then set adjusters other than 1.0, this will affect the animation, while the slider multiplier doesn’t

    bug. clear morphs. It seems clear morphs doesn’t work anymore.

    steps:

    1. set “soft“ limits in the global settings
    2. import G8 with face units
    3. import or do some face animation, for example the test animation eyes.duf in #2158 but any will do
    4. try to “clear morphs” in the morphs panel, it doesn’t work

    update. errata corridge. Clear morphs works fine, I forgot we need “auto keying“ on for it to work for animations, otherwise it only works for poses when there’s no keyframes in the timeline.

    bug. set keys doesn’t work for props. It seems “set keys” doesn’t work for props, it’s the same also in previous commits.

    steps:

    1. import the test scene bowl.duf in #2143, with daz favorites
    2. try to “set keys” in the morphs panel, it doesn’t work

  10. Alessandro Padovani reporter

    Commit 1608440.

    The “local preferences” bug seems gone, at least installing the new commit didn’t clear the preferences in my other blender installation. The “set keys” bug is still there.

    bug. adjusters. The adjusters for categories don’t appear anymore, we only have the global adjuster for morphs.

    steps:

    1. in the global settings set adjusters to “all“
    2. import G8 with expressions and visemes and daz favorites
    3. we only have the global adjuster for morphs, not for expressions and visemes, not for daz favorites

  11. Thomas Larsson repo owner

    Switching setting directories doesn’t work that well. I had to add a button that updates the settings from disk, because just choosing a new settings directory does nothing. The buttons for loading and saving settings file were also moved from the utilities panel.

    There is now a single option to use morph limits. The limits for the final values depends on whether adjusters are created or not.

  12. Thomas Larsson repo owner

    The slider multiplier is back. It now affects both sliders, final values and shapekey limits.

  13. Alessandro Padovani reporter

    Commit 9b56ee4.

    Thomas, the slider multiplier must only affect the slider range as before, not final values or shapekeys.

    Specifically the shapekeys range should always be unlimited aka -10 10 for daz poses to work. Because the final value for shapekeys can be anything depending how the daz morphs drive each other. If you are concerned about #2202 and want to make diffeomorphic compatible with unreal, then we can set -5 5 instead of -10 10 that hopefully will work fine with most morphs, it’s just that -10 10 is safer.

    As well the final limits should only be defined by the “daz limits“ option, that is, none or daz or daz * 10 if we use the adjusters (or * 5 if we want to but * 10 is safer), because adjusters multiply the actual values as explained above, so they need to go outside the daz final limits. The slider multiplier is only intended to multiply the sliders range aka soft limits not other things.

    Or please let me know why if you believe I’m wrong, thank you.

    p.s. As for preferences, what’s the difference between “load settings file“ and “update settings“ ?

    p.p.s. Ok I got it, we can “load settings” and “save settings” from other files which are not the currently used, not that I believe this should be common practice. While “update settings“ should always be done at startup, unless the user changes them from another blender installation, that again should not be common practice.

  14. Thomas Larsson repo owner

    The settings are loaded from the specified file on upstart. It is only when you change the settings directory in the preference dialog that you have to force the settings to update. It would be better if the settings updated automatically when the directory is changed, but I didn’t manage to implement that.

    The load/save settings buttons have been around forever, but they used to be located in the utilities panel where nobody noticed them.

    The final properties should have daz limits. You can think of the raw/final pair as a single daz slider, which can be both changed independently (raw) and driven (final). The daz limits applies to the final result.

  15. Alessandro Padovani reporter

    Yes I understand that, that’s why I don’t get what the slider multiplier has to do with it, since it is supposed to only change the slider soft limits and nothing else. Why the slider multiplier has to affect final values and shapekey limits ?

  16. Thomas Larsson repo owner

    Now the settings are automatically updated when the settings file is changed, so the Update Settings button is obsolete.

  17. Thomas Larsson repo owner

    Oh, I thought you wanted to drag the final value beyond the daz limits. It is not necessary to change the soft limits. You cannot drag the slider beyond the limits, but you can type in any number in the field, and then drag the slider to whatever value.

  18. Alessandro Padovani reporter

    Ok I believe I understand what you mean, thank you for the explanation. In #2158 #2143 we set both sliders and shapekeys as unlimited to allow computing daz morphs. But shapekeys are only affected by the final values, not the slider values, so we don’t need them to be unlimited as the sliders are. Unlimited shapekeys were necessary for props when we didn’t have a separate slider, as in that case the shapekey and slider values were the same, it is not so anymore.

    Commit 319905f is fine for me, both for the slider multiplier and the local settings. What about retarget_bvh, can we have local settings the same as import_daz ?

  19. Thomas Larsson repo owner

    The retargeter settings have been moved to the preferences. Since there are only five settings in total, I put them all in the preferences and ditched the settings window and file entirely.

  20. Alessandro Padovani reporter

    Works fine here thank you, if there’s nothing to add we can close as resolved.

  21. Log in to comment