Extra Morph Import Options

Issue #1466 resolved
Maneki created an issue

I want to propose adding import shapekeys with ERCs on/off and morphs on/off to the import widow.
Sometimes the body morph is already “baked” into the character and all needed are character specific JCMs or some special correctives. Those correctives only trigger when the character morph is active but since the character morph is already baked there needs to be a empty controller.

Comments (35)

  1. Thomas Larsson repo owner

    I don’t see how making those options local would solve your problem. But I agree that there is a problem. Say, if you import Victoria JCMs to a baked Victoria character, those JCMs only trigger if FBMVictoria8 is nonzero. This property is hidden in DS and therefore it only appears in the Blender UI if the global settings Make Hidden Sliders is enabled. But that will also show a lot of other properties that you probably don’t want to see.

    One possibility to fix this would be to expose hidden properties if they are multipliers. Or maybe I misunderstand what you meant.

  2. Thomas Larsson repo owner

    Another problem is that these multipliers are imported as integers, which makes sense if the multiplier is a boolean but not in this case. The reason is that the clear morphs button ignores integers.

  3. Alessandro Padovani

    @Thomas. some tips.

    May be Maneki means that he imports FBMVictoria8 without shapekeys, so having it in the import options would be handy. No idea why he wants ERC local.

    As for the custom jcms issue, one solution is to import as unmorphed. That essentially means dbz doesn’t work with custom jcms and if we want a full custom figure exactly the same as daz then we have to use unmorphed with ERC. While this is a limitation for dbz, if it is documented it may be acceptable, with dbz used as a “simplified approximation“ of the custom daz figure, where only the standard jcms are used.

    Otherwise one solution with dbz is to import FBMVictoria8 without shapekeys and set it to 1. This workaround requires the user to be aware of the issue with dbz.

    All of this is odd though since in #1284 the solution to get the figure working was to don’t import the CTRL morphs but only import the pJCMS, so this may depend on the figure. You may also want to look at that case.

    note. I’m giving ideas trusting what you and Maneki are reporting is true, I didn’t test anything. As personally I don’t use complex figures with custom jcms, but rather tend to simplify and approximate the figure, as I believe this is “the blender way“.

  4. Alessandro Padovani

    update. may be solution.

    Actually the plugin may be aware of the morphs baked in the dbz by looking at the duf file. For Victoria 8 for example, the duf file will contain CTRLVictoria8 = 1. Thus the control morphs used in the duf file could be loaded by the plugin without shapekeys and set to 1.

    note. This is not necessary for the “prebending workflow“ where custom jcms are not used, so it would be better to have this as an option, “import baked morphs“.

  5. Thomas Larsson repo owner

    I think I understand what Maneki is after, and I agree that it is a very good idea. But I want to implement it a little bit differently.

    In the last commit I added two options to Import Custom Morphs:

    1. Only Properties: Shapekeys, ERC morphs and bone transforms are not imported, so you only get the control properties.
    2. Protect Morphs: A protected morph is not activated (the checkbox next to the morph). Thus if you clear morphs, the protected morphs remain unchanged.

    I will write something about this later today.

  6. Alessandro Padovani

    That requires the user to be aware of the custom morphs the figure is using, then import them as “protected“ and “only properties“, then set them to 1. Looking at the duf the plugin could do it automatically with the “import baked morphs“ option.

    Unless there are complications that’s entirely possible due to the complexity of the daz morphs system.

  7. Alessandro Padovani

    note. may be important bug.

    Also, the “import baked morphs“ option would be useful to avoid importing the same CTRL morphs again if the user selects them. As it happens in #1284 where, if I understand correctly, the CTRL are used twice because they are both baked in the dbz and imported by the user.

    In general the user tends to import all the custom morphs for a figure because it is hard to guess what of them are needed specifically. So “import baked morphs“, where a list of the morphs baked in dbz is used, may help to avoid importing unnecessary morphs. This should also resolve #1284.

  8. Thomas Larsson repo owner

    I wrote a blog post on this, and fixed some glitches in the process.

    Alessandro, I have to think about how to import baked morphs. It is quite possible that a user imports expressions but not jcms, and then he probably wants the custom ejcms but not the pjcms. Perhaps one could add it as an option to the standard morph importers. Although that would require that the custom files are named appropriately, otherwise we need to scan the files to see which morph it affects.

  9. Alessandro Padovani

    I did read the blog and I believe the tools are there for the user to do whatever he wants.

    Problem is, it is all extremely technical. That is, the user must have a complete understanding of how daz studio works, what’s pjcms ejcms fbm etc. because he has to select exactly what is needed for the custom figure and nothing else, plus fiddle with all the multipliers to make them work.

    I guess this is why #1284 didn’t work.

    The workflow should be much easier and user friendly. As:

    1. Import the dbz custom figure with the “import baked morphs” option. This will import all the custom morphs baked in the dbz as hidden “only properties”, the user doesn’t need to see them because they’re baked in the dbz and makes no sense to change these properties.
    2. Import all the custom morphs for the figure. This will import all the custom morphs, but not the baked ones that are already stored as hidden properties.

  10. Thomas Larsson repo owner

    Baked morphs are now created when the character is imported. It seems to work most of the time, but I have one character where it doesn’t. Have to check why tomorrow.

    Importing all custom morphs could be an easy import option, but it may take some thinking to do it right. E.g. if we don’t import jcms, we probably don’t want to import the custom jcms either.

  11. Alessandro Padovani

    As for commit 8d58e52.

    I’m using the spindle fae in #1284 which seems a good test case. Unfortunately it doesn’t seem to work, I mean at all.

    https://www.daz3d.com/ssy-spindle-fae-for-genesis-81-female

    steps:

    1. import the spindle fae as dbz and merge rigs
    2. import jcms
    3. import all the custom morphs (they’re in the G8F morphs folder)

    bug. The baked morphs are imported with value = 1 in step 1, that’s correct. But then they are reverted to zero in step 3, that shouldn’t happen since baked morphs should never change their value whatever it is. Also the custom pjcms don’t work, they are imported but not activated when I pose the figure.

    notes.

    • The “import baked morphs“ should be a option in global settings, since it’s not needed for the “prebending“ workflow, or any workflow where the user doesn’t need the daz jcms.
    • The baked morphs don’t need to be visible to the user, not in the “baked“ panel, nor in the “category“ panel, because these are morphs baked in the mesh and not supposed to be changed by the user. If this is needed for debug purposes then it should be an option in the debug section. Or at least add an option in the global settings to hide the baked morphs.

    As for easy import, my point of view is that it is for the novice user. What is expected by easy import is to import the figure and it will work, the same as daz for what is possible. In this sense easy import should always do jcms and flexions and custom morphs, or at least have these options as default, then if the user changes the defaults it is supposed he knows what he’s doing.

    For the advanced user who wants to customize and fiddle with the inner settings there’s the standard import.

    update. Everything works fine if I just import the jcms in step 3, without the other custom morphs. But if I just select the jcms then the figure works fine even without “baked morphs“. I mean, the purpose of “baked morphs“ is the user doesn’t need to worry of custom morphs, because the plugin knows what’s baked will not import baked morphs even if the user selects them.

  12. Alessandro Padovani

    update. easy import.

    bug. Tried easy import but it doesn’t work either. Specifically it doesn’t find the baked corrections, probably because they’re in the G8F folder instead of G81F. The duf file includes the folder for the custom morphs so the baked corrections should be searched in the same folder.

    Unless I misunderstand what baked corrections is for.

    steps:

    1. easy import with jcms and baked corrections

  13. Alessandro Padovani

    As I understand it they are the custom jcms and other correctives of the figure. That’s wonderful because this way easy import can get a full featured custom figure automatically, without the user having to load custom morphs apart. This is possible because the plugin knows the morphs baked in the dbz thus it can import the custom morphs in the same folder.

  14. Alessandro Padovani

    update. Commit 41c80f5.

    No news. Everything works fine with Victoria 8, but if I try the Spindle Fae then baked corrections are not imported as described above. May be this is because the figure is G81 but the morphs are in the G8 folder. The file path is available in the duf file though as noted above.

    minor note. The option names mismatch, it is called “baked corrections“ for easy import and “import corrections“ for the tool. It would be better to use the same name for both as “baked correctives“ and “import baked correctives“. Note that “correctives“ is the name used in daz studio.

  15. Thomas Larsson repo owner

    The spindle fae morphs are loaded now. Since I don’t what to open and scan the file content, the plugin makes a guess about the content based on the file name. Previously the guess was that a file contains an expression, facs, or jcm if the lower-cased file name starts with “ejcm”, “facs”, or “pjcm”, respectively. However, in this case the file names had an “SSY” in front of the type marker. In the last commit it is enough if the type string appears somewhere in file name.

    Why not import all morphs in the directory, you ask. The thing is that the directory also contains the morphs that are baked into the character, and we don’t want to load those. Even if the plugin knows about the baked morphs and we could avoid these FBM and FHM files, the directory also contains a CTRL file which must not be loaded.

  16. Alessandro Padovani

    Commit ef29573 works awesome thank you for the fast fix. I’m good here if there’s nothing to add we may mark as resolved.

    I’m also closing #1284.

  17. Maneki reporter

    I’m not sure if “import baked correctives” works? I loaded a character with vic9 morphs but no correctives are imported when I pick that option? I’m not sure if I do something wrong.

  18. Alessandro Padovani

    bug. I can confirm that Victoria 9 doesn’t work. From what Thomas explained for the Spindle Fae I suspect the reason is that for G9 the corrective names are different, it’s “cbs“ instead of “jcm“ not sure what the difference is.

    If I import the custom morphs by hand they work fine.

  19. Thomas Larsson repo owner

    Now morphs that include “body_cbs” are imported as jcms. One cannot just use “cbs”, since that would include morphs with the string “facs_cbs” as well.

  20. Alessandro Padovani

    bug. Commit b09559f doesn’t work fine.

    It seems some body_cbs are missing when we import the baked correctives, both with easy import and standard import. If I import the body_cbs by hand as custom morphs then everything works fine. Test scene and pose included v9-duf v9-pose.duf.

    steps (doesn’t work):

    1. easy import v9.duf with jcms and flexions and baked correctives
    2. import pose v9-pose.duf

    steps (doesn’t work):

    1. import v9.duf and merge rigs
    2. import jcms and flexions
    3. import baked correctives
    4. import pose v9-pose.duf

    steps (works fine):

    1. import v9.duf and merge rigs
    2. import jcms and flexions
    3. import Victoria 9 custom morphs “body_cbs“
    4. import pose v9-pose.duf

  21. Thomas Larsson repo owner

    Fixed in last commit. Here is what happened. V9 has five baked morphs. The culprit is the proportion height morph, which is defined in the Base Proportions directory. This directory contains other body_cbs files which are also loaded. In particular, ProportionSmallerBO_body_cbs_thigh_z90p_l.dsf is triggered when the thigh is bent, provided that the multiplier body_bs_ProportionSmaller is non-zero. The plugin define unknown multipliers when the morph is loaded, and set them to 1. This is usually desired, but not when we load baked morphs where all relevant multipliers are already known. Therefore we now set them to zero in this case. When body_bs_ProportionSmaller = 0, the proportion morphs don’t contribute.

    Here is a comparison of the thigh shapekeys before the fix. If we mute the four last, propertion, shapekeys, the shape is good.

  22. Maneki reporter

    Currently with the latest commit, when I just use the full body character slider in Daz it doesn’t seem to work. The body and head are set to 1 in Daz but it doesn’t really work in Blender when I import it. I had to manually set the body morph to 1 under custom morphs to trigger the correctives of vic9. Using the separate head and body morph in Daz and set both to 1 without the controller seems to work though. I’m not sure if that’s intended but it may end up really confusing for new users.

  23. Thomas Larsson repo owner

    No, that was a bug, which should be fixed now. When the plugin finds that “Victoria9_figure_ctrl_Character” is a baked morph, it must also look inside the formulas and find that “Victoria9_head_bs_Head” and “Victoria9_body_bs_Body” are also baked. Two more sliders are thus added in the Baked panel. When you move the body slider the strength of the V9 jcms change.

    Another change is that some known directories are skipped completely. So far only the G9 Base Proportion directory which caused trouble before. It is more economical to skip these morphs instead of generating them and then multiplying them with zero.

  24. Alessandro Padovani

    Commit 1fe5419. proportion bug ?

    I am not sure to follow for proportions getting skipped. I mean we can use proportions in daz studio to make the G9 figure smaller. In this case ProportionSmaller is using “body_cbs” in daz studio that are missing in blender. To tell the truth I don’t notice much difference without the ProportionSmaller correctives but I’m wondering why we don’t use them.

    This is just to point it out in case it is a bug. Let me know.

    steps:

    1. Easy import the test scene v9-small.duf with baked correctives, she’s using the ProportionSmaller morph.
    2. Import v9-pose.duf.
    3. Check the thigh shapekeys, in daz studio there’s a ProportionSmaller “body_cbs” while in blender there’s not.

  25. Thomas Larsson repo owner

    OK, now the plugin looks in the proportions folder again, and v9-small has 8 nonzero thigh shapekeys in Blender too. Questions:

    1. Where do you see the jcm values in DS? I didn’t find them in neither the Posing nor Shaping tabs, but I guess that you have to enable viewing hidden morphs somewhere.
    2. There is a discrepancy in the morph values. In your picture body_cbs_thigh_x90n_l = 92.6%, but I only get 0.834 in Blender.

    There is a known bug when loading morphs that already exist; the old driver is thrown away completely although in some cases new variables should be added to the existing driver.

  26. Alessandro Padovani

    Commit cbafa54 works with proportions now. I can confirm that some corrective values are different, no idea why.

    to see the cbs in daz studio:

    1. select the figure and pose her so to activate the correctives
    2. parameters tab > preferences > show hidden properties
    3. parameters tab > currently used, optionally with the filter as picture above

  27. Alessandro Padovani

    update. As for the different values, I see the scale for v9-small.duf is 66.4% in daz studio, while in blender it is 100% even if I don’t apply transforms. Don’t know if this may affect some morph values, especially for proportions which affect the figure scale as well.

    The correctives seem to work fine enough though, even if some values are different.

  28. Log in to comment