Face Units, Expressions, Visemes, and Bone driven morphs aren't working

Issue #169 resolved
Chuki Cicha created an issue

I don’t know exactly what was the commit I was using, but it was a few months ago, I’d say 2 months ago, I was abscent doing other works, but when I returned, I updated the addon, and now the Face Units, Expressions, Visemes, and bone driven morphs (like hair and hand moving) aren’t working, the thing is that I have the body and genitalia merged, so I can’t import these things again, I should re-import them from daz, and then transfer my animations and all my work.

I tried with a backup file, when I open it, I can use the bone driven morphs, but the Face Units and all those things aren’t appearing because I didn’t click on the “Update morphs to 1.5” button, when I click it, the bone driven morphs stop working, and the face units and other things appear, but they aren’t working. Also when I press the Update morphs to 1.5, face gets deformations like this one:

Comments (25)

  1. Eder Rogerio Deana Juliette

    I experienced the same problem. But in my case, I was able to update my models with the commit 9f28bf0 and after saving them, then they started to work smoothly with the last commit.

  2. Alessandro Padovani

    Commit 9f28bf0 is especially important also because it is the last one with the old materials setup, that is, without the double eevee cycles output (that I personally don’t agree with). Since not everyone may keep backups I attach the commit here.

  3. Thomas Larsson repo owner

    Could you upload a blend file so I can look at it. It is difficult to tell exactly what went wrong, since it may depend on the version when the morphs were originally loaded. I have tried with some of my own old files, but here updating to version 1.5 works.

  4. Alessandro Padovani

    Also I read #158 and I’m a bit lost here. I use my own rigs so I don’t get those issues, but ideally the old imported figures and scenes should be usable without the plugin. I mean, once the rig is generated you should be able to use it without the plugin installed. Or do you need the plugin installed to use them ?

    If you mean to load an old figure then modify it with a new plugin then I understand there may be issues and this is quite normal. I mean this is true even with blender versions. For this it is required to keep an archive of previous stable versions and when the current dev is no more compatible then make a new stable.

    edit. I just did a quick test with mhx and I see the plugin must be installed to pose the expressions, while it is not needed to pose the bones. The expressions are not even listed in the shape keys so I suppose the plugin uses some internal code to handle them.

    Ideally the imported morphs should be available in the shape keys. Then the standard shape key editor can be used to animate them. Or drivers can be added to the mhx rig when necessary to drive the morphs so that the plugin is not needed to use the rig. At least this is what I do in my simple rigs then I'm not a rig expert at all so may be I miss something. But I don't see why the plugin should be required to use the generated rigs.

    edit. In #43 there’s a fast method by Zack to import morphs as regular shape keys. Also #71 means we can use the shape key editor for linked files, that’s useful especially for animation projects where scenes and characters are kept in separate files then the shot files only contain the animation data.

  5. Thomas Larsson repo owner

    Alessandro, face morphs are only shapekeys in Genesis and G2. In G3 and G8 they are driven poses of the face rig. This is a good thing in Blender, because shapekeys are very wasteful and a driven pose automatically extends to other meshes, like beards and masks.

    However, the length of a driving expression can only be at most 256 character; this is a hard limit in Blender. Even if you use a shoehorn and describe the influence of each morph with only six characters (sign + 3 digits + '*' + one-letter variable), you can only drive a face bone with at most 43 morphs. Given that there are more than 100 standard face morphs for G8, this is a problem.

    To evade this limit, the morphs are stored in a collection property, which allows for arbitrary many morphs that drive each channel. The driving expression calls a function called evalMorphs or evalMorphs2, which returns the sum of the contributions from all stored morphs. So if the plugin is not enabled, the evaluation function is undefined and the morphs do not work.

    There is a way to use the morphs without having the add-on enabled, cf http://diffeomorphic.blogspot.com/2018/07/stripped-runtime-system.html. Or at least there was, I had forgotten all about it so it has not been checked with the new morph system.

  6. Alessandro Padovani

    I completely skipped that G8 gets bones for the face, so of course there are no morphs there. Thank you Thomas for the nice explanation about expressions. I see this was fixed then reverted. I also tried the runtime script but it doesn’t seem to work.

    https://developer.blender.org/T47896

    edit. In my opinion it would be nice to include in the runtime script a mini interface to use the rig without the plugin, including face expressions. This way one saves the script in the project folders or make it internal, and the rig will always work independently from the plugin.

  7. Thomas Larsson repo owner

    The stripped RTS (which defines the evalMorphs(2) functions and nothing else) has now been updated to the new morph system. This will probably not improve things for old characters, but at least it works for new characters now.

    Auto-running the stripped RTS doesn’t work anymore, though, because Blender seems to have removed the Register checkbox.

  8. Alessandro Padovani

    As for commit bd39de7 the runtime script seems to work fine here. The register checkbox is now in the text menu.

    Also out of couriosity I gave a look at the actual blender 2.83.4 sources and the 256 characters limit for expressions seems to be there yet. It would also be an easy fix since it is enough to expand an array in the ChannelDriver. But I guess we have to deal with the official limits.

    edit. Any chance to get a mini interface in the runtime script to animate expressions without the plugin ?

  9. Thomas Larsson repo owner

    Yes, I agree that it would be nice to include an animation-only interface, and it should not much code. The reason it was created in the first place was that somebody sent away his files to a render farm, and only needed the existing animation to work but did need to add anything new.

  10. Eder Rogerio Deana Juliette

    I did some tests and for this specific model, I wasn't able to update it even trough the commit 9f28bf0. But I tested to update other old models with the last commit and all worked fine. The previous file I've sent, it was edited in blender 2.90. So here is a version edited only in version 2.83.4.

  11. Chuki Cicha reporter

    I’m trying to upload a blend file but my connection is really poor and it semms I won’t be able to upload it, its size is 70mb and it takes about 12 minutes to upload it, but Bitbucket throws an error and I can’t upload it… I’ll try to update the morphs with commit 9f28bf0 and tell what happens. Also, any way to reduce file size? Even if I delete everything, the size is 45mb, I also deleted everything under Orphan Data

    edit. I tried Updating morphs with commit 9f28bf0 but it still breaks the face and the face units and other things don’t work anymore.
    edit. The blender files I’m being unable to update the morphs are both from blender 2.80, though I’m using 2.82 now

  12. Chuki Cicha reporter

    I think I had attached the Test2.blend file, the one I’ve described on the issue, the backup one, face units and morphs aren’t accessible until you hit Update Morphs, and when you do that, if you hit Update All, or change the value of something, the face gets updated and deformed.

  13. engetudouiti

    The file Eder Rogerio Deana Juliette attached is same what I had seen. then now I got these error logs in my console.

    Traceback (most recent call last):
    File "<bpy driver>", line 1, in <module>
    File "C:\Users\TAKE\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\import_daz\daz.py", line 147, in evalMorphs2
    return sum([pg.eval(rig) for pg in pgs if pg.index == idx])
    File "C:\Users\TAKE\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\import_daz\daz.py", line 147, in <listcomp>
    return sum([pg.eval(rig) for pg in pgs if pg.index == idx])
    File "C:\Users\TAKE\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\import_daz\daz.py", line 109, in eval
    return self.factor*(rig[self.name]-self.default)
    KeyError: 'bpy_struct[key]: key "" not found'

    Error in Driver: The following Python expression failed:
    '(-22_A+8_C)*1e-3+evalMorphs2(self, 2, "Rot")'

  14. engetudouiti

    I suppose almost same log seems generated about all morph drivers. so the error log becom very huge, but it show same error for each morphs.

  15. engetudouiti

    So I suppose some commit versions have problem, then user (we) make scene with it or overwrite old scene.

    Then Thomas up-date and offer new commits which solve or improve issue.

    Though I hope Chuki Cicha problem will be solved, but these things may happen when we make scene with beta version .

    I had a few scene which show same error, then I delete them. (I supposed it may not be solved)

    Because those scene are made and overwite with version which have issue. (So I think it is my fault)

    but most of scene which I made with old release version work with recent commits, even though it was made 2 years ago.

  16. Thomas Larsson repo owner

    The issue should be resolved now. The update code was overwriting the name of the driving property with the empty string for morphs loaded with some versions of the plugin (but only some), hence the error key ““ not found. Here is what happens now:

    1. If the morphs have not yet been updated (G8MaleBasic2), the name of the driving property is not overwritten unless it is the empty string. The new update should then work correctly for morphs loaded in all old versions.
    2. If the morphs have already been updated and are corrupt (G8MaleBasic4-..), the name of the driving properties have been lost and cannot be retrieved. The update button, which now is also found at the bottom of the Advanced Morphs section, then removes all drivers and the corresponding rig properties.
    3. The female file (Test2) doesn’t have any shapekey so I’m not sure what to do with it.

  17. engetudouiti

    I test recent-commit with G8MaleBasic4, then click up-date button in advance tab, now it seems remove all drivers (facail pose controllers) then now return usual face (no destortion)

    But I see some HD related shape keys remain with driver which start prefix DzU.

    all controller have been removed from plug-in UI. so to return those shape key and driver what process may need? or at first delete those shape keys, then re-import each morphs (pose controllers, or shape keys with driver) again may work?

    (though if mesh have been merged, unfortuantelly we can not return them I suppose)

  18. Alessandro Padovani

    Honestly I believe there’s a ground “issue” here. One can’t generally expect to load old projects with a new plugin version. This isn’t true even for blender itself. If you start a project with a specific plugin and blender version then stick to them for that project.

    This is why blender now goes for LTS. This is why in my opinion it is not good to provide support for blender betas. Also may be the plugin should follow the LTS idea, that is, provide updates and bug fixes to the official stable release regularly. Then when a new commit is no more backward compatible and/or there are major changes then start a new stable release.

    Then of course provide to the users an archive of stable releases so they can download them anytime if they lose backups.

    edit. This would also simplify the plugin code and maintenance. For example now the plugin supports both blender 2.79 and 2.8x versions. With the LTS idea there would be an old stable for 2.79 and a new stable for 2.8x, then a new stable again for 2.9x. Also leaving the old stables alone wouldn’t risk to break compatibility with previous blender versions, instead of trying to always support all of them that also affects the code complexity.

  19. engetudouiti

    Yes as Alessandro said, I do not expect ,scene which saved in different beta commits version may work with another beta commits.

    At same time, I hope to help or offer workflow, when user can not solve private issue with this add ons.

    At current I just think if there is way to solve Chuki Cicha problem if we can (or she may need to start scene from scratch)

    (though I recommended, anyway keep default meshes without merge of same scene. and we should not expect beta version saved scene work for another beta versions. or you only use for test with our responsibility.

    So Thomas can keep up-date things as beta commits, and make this plug-in more better.

  20. engetudouiti

    When I see these issue, I may try old technic for merged mesh which some morphs or drivers corrupted.

    I use add on offer transfer shape keys, (with driver option) then correct current merged actor driver and shape keys.

    Actually I sometimes use it, for merged actor to import new morphs (eg import new shape morphs for rigi-fy merged actor)

    And I confirm most of case it work. but if you have already keyed animation etc,, I do not expect it work with keys. I need to remove them once. then try transfer morphs from non mearged mesh then set driver.

    if you need to return bone controller, I do not know if it work or not. (basically I feel, even though mesh have merged, bone controlelr can be imported, if bone name is same.

    (many options Thomas have already offered for the prupose . so you need to check each option how work)

    (but to work it stable we need to keep default mesh which used for same scene or transfered morph change hard)

  21. Chuki Cicha reporter

    Although my file (Test2) doesn’t have any shapekey, under the custom morphs tab, it has driven morphs, that are hand poses for the left hand, If I updated the morphs they’ll stop working, same as with Face units. But with commit 7e1c23d it’s working perfectly, now the face units and driven morphs are working as they should after Updating Morphs, thank you!

  22. Log in to comment