JCM breaking on fbx export

Issue #1200 invalid
Petermaxd created an issue

Hello,
First of all, I hope that I’m at the right place to ask about the problem I have with Diffeo, and if not, please forgive me.

I’m trying to import a Daz animation into Unity on my Daz model.
With Diffeomorphic I’ve imported all the JCMs, Flexions and Custom Morphs needed, but when exported it looks nothing like in the Blender import.

First I thought it was missing JCMs but I verified all hidden JCMs in DAZ and everything was imported in Blender. Also, in Unity, JCMs are driven by the animation just fine but the result doesn’t look anything like what we see in the blender import. I then thought it was some sort of import/export problem between Blender and Unity, but then I realised that the issue was present in the FBX file (like you can see in the picture above, I’ve imported the exported FBX into Blender).

It’s been several days now that I am trying to make this work and I just can’t find a solution.
If someone could help me that would be wonderful, I may be missing an information somewhere.
Thanks for your help!

Comments (9)

  1. Thomas Larsson repo owner

    In Blender (and in DS) the JCM shapekeys are driven by bone rotations. The FBX file probably contains the shapekeys themselves, but the drivers are not included. So I don’t think this can work.

    If DS has a dedicated Unity exporter that could perhaps work. Drivers are application specific to in order to transfer them from one program to another you need an exporter that works with the native files. A general-purpose format like FBX is unlikely to work.

  2. Petermaxd reporter

    In Blender (and in DS) the JCM shapekeys are driven by bone rotations. The FBX file probably contains the shapekeys themselves, but the drivers are not included. So I don’t think this can work.

    By exporting an animation as a FBX file you can export the value of each shapekey in each frame. You just have to both export and import “Animated Custom Properties”, I don’t need any procedural pose for the character, only baked one so that wouldn’t be a problem (and even if I needed something procedural, like a head turn for example, I can write a script to drive morphs depending on the bone rotation).

    My problem here is that the FBX doesn’t look like what I have in Blender, despite the fact I tried every exportation checkbox possible. Even when imported back into Blender (like you can see in the picture of my OP), the FBX doesn’t look right. It’s like something is breaking when exporting.

    In Unity, I can still see the JCM moving and drive them with animation files, that’s not the problem. The problem is that the fbx (in Unity, Blender, an fbx viewer, etc.) turns out like in the right of my picture. So I thought it was something to do with JCMs but I can’t tell exactly what’s happening/what is breaking.

    If DS has a dedicated Unity exporter that could perhaps work. Drivers are application specific to in order to transfer them from one program to another you need an exporter that works with the native files. A general-purpose format like FBX is unlikely to work.

    I was working with the Unity Bridge prior to finding the biggest flow : the animation exporter is BAD, like very very BAD (you need to bake the transforms prior to the exportation and then have to manually rotate every bones to get them where they were: horror). Exporting poses and animations with diffeo works perfectly. But I can’t use both Unity exporter and Diffeo since it doesn’t create the same sekeleton hierarchy (so animation from Diffeo are not compatible with the skeleton created from the DS Unity Bridge). Also DS Unity Bridge works with an FBX file too.

    Also, even if the drivers could work, there may be differences in the deformations because daz studio and blender use dual quaternion, while a game engine may not.

    The drivers (baked in animation files) work just fine, and I know those 3D principles don’t worry, but my problem doesn’t concern Unity but the fbx export. Like I said, even importing back the FBX into Blender show this problem.

    Thanks a lot for your fast answers, I really appreciate it!

  3. Petermaxd reporter

    I’m going to describe my problem again, hoping it will make it clearer!

    So, when I export the model with animation as an FBX file, I export the shapekeys informations with it, so that JCMs and flexions informations are contained inside each animation’s frame. Here is an example with the FBX imported inside Blender:

    If I modify the value of one of those shapekeys (which are correctly driven by the animation) I get the expected result!

    For example if I put “pJCMShldrUp_90_L” to 0, the left shoulder gets low and if I put it to 1, left shoulder goes up, etc. I’m used to work with exported JCMs, that part is working great.

    BUT, it’s like there is JCMs missing or something else happening during the FBX export causing something bad to happen. For example, the pelvis comes out and both knees look broken:

    To sum it all up:

    • I can export an fbx with animation
    • every exported JCM/Flexion/Morph can be driven by the animation
    • Despite the right JCMs and Flexions, the result is not good

    After so many days searching a solution to my problem, I got the funny idea that it would look exactly like that if I didn’t have all the JCMs exported (for example, if I don’t export the JCMs smoothing the wrist, I would get a bumpy wrist in many positions, logic since the vertex would stay the same despite big rotations).

    And after trying every JCM one by one, I didn’t find any that was modifying the knee shape or the pelvis transition to the thigh. Are these not managed by JCM in DS?

  4. Alessandro Padovani

    Again, dual quaternion is not handled by fbx so you have to deal with it, either in unity or blender. Did you check “preserve volume“ after importing the fbx ?

  5. Petermaxd reporter

    Again, dual quaternion is not handled by fbx so you have to deal with it, either in unity or blender. Did you check “preserve volume“ after importing the fbx ?

    Hahaha yes you are right! Sorry for overlooking your first answer, when I first read the start of your sentence “even if the drivers could work” I was still in the answer mindset as for Thomas Larsson (feeling like I had to explain that JCMs baked inside an animation work great).

    You are absolutely correct, “preserve volume” wasn’t checked and that’s the only difference between my before and after. Importing the FBX and activating dual quaternion gave me a 1:1 result compared to the .blend file from Diffeo (and even unchecking it while in the blend file give the prior fbx result, it works both way, it’s really THE problem).

    Well now I will do everything I can to make dual quaternion skinning work with Unity or I will have to switch to O3DE (since having a perfect 1:1 is all I’m in for).

    Thank you a very lot Alessandro Padovani, again, sorry to have missed the most important part of your first answer, thank you and have a beautiful week! 😊

  6. Log in to comment