I have a problem with custom morphs

Issue #1995 resolved
Prenses Karolin created an issue

I don't use the add-on's "Favorite Morph" feature, instead, I use the "Custom Morph" feature.

Here's how I use it;
1: I import a standard G9 character into Daz Studio and add the morphs I want as favorites.
2: Then I import the character into Blender with the "Favorite Morph" feature turned on.
3: Then I export my custom morphs as JSON using the plugin's "Save Favorite Morphs" option.

4: Using this method, I combine all my custom morphs into a single JSON file with all my custom morphs categorized and I use the same file for each character.

Here's the problem I'm facing;

There are too many morphs in common and they need to be combined in one place (FACS panel). I think they take up unnecessary space and there will be an optimization problem.

For example; "Jaw Open" morph is both in the FACS panel (it makes more sense to have it only here) and in all the other panels I added specially.

If I remember correctly, when I used to use this method, this problem did not exist and the common morphs were in the only category they should be in. But now when I try it, it spontaneously occurs in all categories.

I am not sure if this problem has anything to do with me, I am doing the usual setup. I don't know if this problem is serious or not, but for some reason it makes me think it is an optimization problem.

I have sent you the custom morph files I used for your review.

Comments (21)

  1. Prenses Karolin reporter

    A small note: Old version Diffeomorphic and Old version blender do not have this problem. Everything seems to be fine (works exactly as I want)

  2. Prenses Karolin reporter

    Since you have raised the issue, let me tell you which steps will create the problem and which steps will solve it.

    Problematic steps
    1- Save the special morphs you want to add to the G9 character in Daz Studio as a Favorite (for me it's a list of expressions). Then save and export the character to import it into Blender.
    2- In Blender, only activate the "Favorite Morphs" and "FACS" options in the import settings and import.
    3- Select the armature and export the morphs as JSON using the "Save Favorite Morphs" feature.

    Result: When you examine the JSON file, you will see that FACS and the Custom Morph category are written in the file. However, you will also notice that the features in FACS are also written extra in the Custom Morph category.

    Non-problem steps
    1- Save and export any character.
    2- Import the character into Blender without making any adjustments.
    3- Using the "Load Favorite Morphs" feature, batch select the expressions you want to create custom.
    4- Morphs will be formed in the panel, in 2 categories. "FACS" and "Custom Expressions". Then export them as a JSON file using the "Save Favorite Morphs" option.

    Result: When you examine the JSON file, you will see that FACS and the Special Morph category are written in the file without repeating each other.

    The second step worked for me. Now I can use it this way. I don't know if this is a problem that needs to be fixed, it's up to you.

    The main purpose here is to prepare a JSON file in advance for one time only. So we can use these files for all characters.
    I don't like the "Favorite Morphs" feature because it doesn't create morphs in a categorized way. This makes it hard to find and control the morph.

    Also, for the morphs in the morph panel; if there is an image of a morph (a small png file), I would love to see that preview image when we hover the cursor over the morph. Because, when hundreds of special morphs (especially expressions) are used, I don't know which morph gives what kind of result. So it's a strange request, but if there was such an option / convenience, I would be very pleased.

  3. Alessandro Padovani
    • changed status to open

    Since he opened the issue, please give Thomas some time to look at this and give a reply. I don't use "save favorite morphs" myself but it is probably a bug to have duplicate entries.

  4. Prenses Karolin reporter

    I had previously tried to edit the JSON file to solve this problem, but it was too complicated and I gave up. Disabling the new "compact view" option is a nice step to remove this complexity and make it easier to edit the file. But I believe this is a temporary solution, because it's really tedious for someone like me who uses hundreds of custom morphs (90% of them are expressions) to edit the json file. the "Non-problem steps" I wrote above works fine for me, it's easier to use it (at least for me).

  5. Prenses Karolin reporter

    Also, If I remember correctly, when I used to search for morphs with name search in a morph panel, it didn't matter whether it was lowercase or uppercase. But now it does.

    For example; If the morph name is Jaw, when I type jaw instead of search, the result is not listed.
    Isn't it better that "it doesn't matter lowercase or uppercase"?

  6. Thomas Larsson repo owner

    I can confirm that searching for morphs is case-sensitive in Blender 4.1, but that is not something that I changed, at least not knowingly. If I append the same character made in Blender 3.6 into Blender 3.6, 4.0, and 4.1, morph search is only case sensitive in 4.1.

  7. Prenses Karolin reporter

    So can't you change it to add-on specific? If you can, maybe you can add an option in the settings? I think it would be useful.

  8. GeneralProtectionFault

    Hi @Thomas, I’m attaching jsoncleaner.py.

    If you’re interested in implementing, and would like me to clean it up, don’t hesitate to ask 😂. I think scaping through JSON text is begging for automation. I tested this script and I think it works. You can specify categories to keep (like FACS, etc…) when a dupe is found, and it will remove the rogues and then can rewrite the JSON file.

    If there’s case sensitivity to be added, I think that would be a simple tweak to the file, but this is mainly to go after the duplicates according to the morph’s file path, which I assume we’d still want to count as a duplicate, as DAZ is a Windows program 😋 .

  9. GeneralProtectionFault

    By the way, forgot to mention… Near the bottom where the script writes the new JSON file:

    json.dump(corrected_json, new_file, indent = 4)
    

    The indent = 4 is basically formatting it to be more readable. It’s not exactly the same as your way (it looks like it puts a new line for every comma), but I presume it could be eliminated or subbed out with however you’re saving it in order to line up with the “Compact View” option.

    If you leave the indent=4 argument out, it just writes the usual text vomit 😁

  10. GeneralProtectionFault

    Just realized there’s a problem with the file I uploaded--if there are duplicates, and one of them is NOT in the categories we set to keep, then it would delete both.
    Imma work on updating it to handle that.

  11. GeneralProtectionFault

    Ok ditch the original, attached jsoncleaner_ver2.py.

    Tricky SOB, but I think that will do the trick. I tested by just altering a few on purpose. I can test more thoroughly tomorrow with the files in this ticket.

  12. Thomas Larsson repo owner

    It is actually easier to remove duplicates before saving the json file. In the last commit there is an option to remove duplicates.

  13. Log in to comment