Question: is there a way to bake a figure? (Removing Diffeomorphic dependency)

Issue #1573 wontfix
NORN 3D created an issue

Hello. It would be great to have an option to bake figure entirely, i.e. remove diffeomorphic dependency.
If I understand correctly, the only thing that makes figures unusable without diffeomorphic are custom properties, that are driven by either bones or UI. So, to make model standalone, bone drivers should be moved directly to JCMs and FACS (if present), and all the other drivers can be removed.

I have a script that does something similar to that, but it’s broken since blender 3.0 release. Can share it, if it may help in any way.

Comments (18)

  1. Alessandro Padovani

    Never tried it before, but I was expecting mhx to work fine without the plugin. Instead if I disable the plugin then the whole morphs section is gone and morphs are not available in mhx. Unless I miss something. Wasn’t mhx supposed to work without the plugin ?

  2. Thomas Larsson repo owner

    Bone drivers are simple expressions that should work without the plugin. All custom properties can not be eliminated because some drive other properties, but some can. The Setup > Finishing > Optimize Drivers button does that.

    MHX should work fine with the daz importer disabled. However, you still need the MHX RTS plugin, because it defines necessary properties. Those are rna properties rather than id properties and need the plugin. Bake MHX changes them to id properties and then the mhx rig doesn’t need the mhx rts plugin either, but the UI will stop working.

    Morphing armatures need that a script is included in the blend file, see http://diffeomorphic.blogspot.com/2021/09/morphing-armatures.html.

  3. Alessandro Padovani

    Sorry I don’t get it. It seems to me that the importer is needed for morphs to work. That is, morphs don’t work with mhx alone. Unless I miss something.

    steps:

    1. import G8F with some expressions and visemes
    2. convert to mhx
    3. disable the diffeomorphic addon
    4. now mhx works, but no expressions and visemes (aka morphs) are available

  4. Thomas Larsson repo owner

    The UI is gone but the properties are still there. If you animate the morphs, the animation still works without the plugin. This is useful if you want to render the animation on a computer without the plugin, e.g. a render farm. OTOH, an mhx animation does not work without the mhx rts, unless you bake mhx first.

    You can still edit the morphs without the UI, in the Custom Morphs panel in the object context. However, the morph names here are not user friendly.

  5. Alessandro Padovani

    Ok thank you for the explanation. Then everything works as intended. I was under the impression that mhx was supposed to work without the importer, but it is not.

    One possible workaround is to bake morphs to shapekeys, that as a side effect will also speedup the viewport, I mean a lot, because drivers can then be removed. This way we get the morphs in any rig, daz or mhx or rigify, even with the importer disabled.

    https://bitbucket.org/Diffeomorphic/import_daz/wiki/Advanced/Morphs/Convert Morphs To Shapekeys

  6. Thomas Larsson repo owner

    As I explained above, you can still use the morphs without the plugin. The UI is gone so you have to work with the long list of custom properties directly. That a nuisance but it works.

  7. Alessandro Padovani

    Unless I miss something. What Norn is reporting, and I agree, is that diffeomorphic is “strange“ since it requires both the importer and the rig addons to be active to be able to use the rig as intended.

    It is a “design oddity” that the importer is needed to animate. Ideally the importer addon should just import the scene then the rig addon should generate the rig. Once the rig is generated not the importer nor the rig addon should be necessary anymore. That is, the generated rig should work standalone in blender. This is how things are usually expected to work, for example rigify is no more needed after we generate the rig, we can disable the rigify addon and the rigify rig works fine. Same for other common rigs the addon is just needed to generate the rig, not to use it.

    If I understand correctly, the culprit here is the daz morphs need drivers then the interface needs rna properties thus the addon needs to be active. May be using id properties instead, the rig interface could be generated with the addon disabled, same as rigify and other addons do. Then I don’t know if this is possible or too complex to do, personally I suck at rigging, but this is the idea.

    Let us know so we can eventually close as “won't fix“.

  8. NORN 3D reporter

    There is a possibility to “remap“ drivers from custom properties directly to shapekeys. In fact, the script I’ve sent before did exactly that, and there was no reason to use long custom properties list at all. Unfortunately it does not anymore due to blender’s API changes.
    Please, see if it’s possible to fix that script and implement it as “finalizing“ function in diffeomorphic. If not - close that issue. I’ll just spend a week or two to fix it myself.

  9. Thomas Larsson repo owner

    JCMs work fine with the addon disabled. Facs work too but then you need to look at the properties, since facs are driven by the UI and the UI is gone. The Optimize Drivers tool removes some unnecessary drivers, but it could be more effective and assign the JCM drivers directly to the shapekeys. I tried that but something went wrong so that optimization was retracted. Might try it later.

    However, custom properties can not be eliminated for all facs morphs. For one thing, facs morphs are not only shapekeys, but driven bone rotations as well. E.g. Jaw Open rotates the jaw bone. Moreover, the properties are set up to mimic the behaviour of sliders in DS. E.g., Eye Blink drives Eye Blink Left and Right, but the left and right sliders can also be changed independently. Several custom properties are needed to reproduce that in Blender, cf https://diffeomorphic.blogspot.com/2021/05/on-raw-and-final-slider-values.html.

  10. Thomas Larsson repo owner

    As for animating without the addon. The only part that you need for animation is the Morphs panel, and that could be split off as a separate addon, analogous to mhx. That would be rather easy and would certainly reduce the footprint. I use the tools in the posing panel as well, but they are strictly speaking importers as well, and are unnecessary if you animate from scratch.

    Rigify does something strange, because the Rigify UI seems to work even with the addon disabled. I think they are storing the UI in the armature somehow, because Blender sometimes asks me to allow script execution when I load a blend file with a rigify character in it.

  11. Alessandro Padovani

    As I understand it, that is not “strange“, but it is how things are expected work. Other popular rigs work the same way. That is, the rig addon generates the rig then it is no more needed, the rig itself includes a script to generate the rig interface and it is standalone in blender with no addons needed to get it work.

    When I do my simple rigs they have no interface because I don’t use ik-fk snapping but only ik, then I use the shapekey editor directly to animate shapekeys. But my rigs are very basic just for me I don’t expect anyone else would be happy with them.

  12. Thomas Larsson repo owner

    If you include the face control rig the facs morphs will work too without a UI. And that is all facs morphs, not only shapekeys but also bone rotations. You can of course not import animations without the plugin, but that is normal; if you want to import bvh files you need a plugin for that, too. Anyway, storing the UI inside the armature in some way is too much work, and not something that I want to spend time on.

  13. Alessandro Padovani

    @Thomas Larsson That’s fine for me, I was helping to explain the point here. Let us know if you want to work on some of the requested features as “remap drivers“, also eventually in the future, otherwise we can close as “won’t fix“ if you’re not interested.

  14. NORN 3D reporter

    Rigify UI is not bound to rigify addon itself, it’s a separate script that automatically generates when you create a rig from rigify’s metarig. You can find that script in text editor → rig_ui.py
    I think the best way to deal with custom properties remapping will be something like this:
    1. Filter custom properties that are not controlled by bones, delete them and remove drivers from their respective shapekeys.
    2. Filter custom properties that are controlled by bones, remap drivers from them directly to shapekeys, then delete those custom properties.

    Of course it’s a rough explanation, and there are lots of factors that should be taken into account, like newly added “optimize drivers“ function and correct eyelids behaviour mentioned above. But I still would like to have this remapping feature under the user’s responsibility, i.e. if user clearly understands what it does and why they would need that.

    Tell me what you think about this, and if it is possible to implement this feature.

  15. Alessandro Padovani

    The request was to make the rig standalone, that is, independent from the plugin. The latest commits split the interface but didn’t fulfill the requested feature. I understand because it is too much work and Thomas is not interested. If there’s nothing to add I’ll close as won't fix.

    You can always bake to shapekeys then remove drivers as suggested above.

  16. Log in to comment