Search Unity

Question Animated .fbx: from Unity to Blender, and then back to Unity without it breaking?

Discussion in 'Animation' started by BuzzKirill, Jan 10, 2023.

  1. BuzzKirill

    BuzzKirill

    Joined:
    Nov 14, 2017
    Posts:
    48
    I have a rigged and animated model in Unity. I wish to make some modifications to it which can only be done in a 3D editor, such as Blender. But the very act of importing into Blender, then exporting back into Unity messes the rigged model up in such a way that the old animations don't work properly anymore.

    I feel like I've made one successful step in solving this, which is to get rid of the incredibly annoying "armature" parent that Blender gives every .fbx skeleton on export. I.e. if it was "Root>Pelvis>..." to begin with, when exported out of Blender it's now "Armature>Root>Pelvis>...". I fixed that - with the help of Alessandro Ribeiro's Blender fbx addon. But unfortunately that alone wasn't enough to solve the problem.

    Has anyone successfuly and ultimately solved this seemingly simple problem, which I'm sure is very ubiquitous?
     
    Last edited: Sep 18, 2023
  2. Respaekt

    Respaekt

    Joined:
    Dec 11, 2018
    Posts:
    15
    Ever got this solved. Stumbled multiple times over the problem, still not solved for me....
     
  3. BuzzKirill

    BuzzKirill

    Joined:
    Nov 14, 2017
    Posts:
    48
    Yes, I think I have. Thank you for bumping this thread, I forgot I had created it.

    I recently successfully imported a rigged and animated model from Unity into Blender, deleted the mesh, made my own new mesh in its likeness and skinned it to the old rig, then exported this into Unity - and the old animations worked properly.

    The main culprit here seems to have been bone orientation. It somehow changes on import. This is a screenshot from the FBX export dialog:

    Unfortunately I don't remember the exact settings, I think it might have been as simple as flipping one of the axes to negative. I tried every possible combination (luckily there are only 12 I think), and one of them clicked.
     
  4. Respaekt

    Respaekt

    Joined:
    Dec 11, 2018
    Posts:
    15
    I think i tried every variantion now. Didnt find a version that works.
    upload_2023-9-19_9-40-33.png upload_2023-9-19_9-40-47.png
    The Version that seems to have the right orientation if i look at the amature/root bone is "primary" Y and "secondary" X....
    Till then i will do it the hard way and import the animations also...
     
  5. BuzzKirill

    BuzzKirill

    Joined:
    Nov 14, 2017
    Posts:
    48
    Wow, well, I guess your rig might have a different issue then?

    For sure I would test whether the animations work properly within Blender at least. In my case unfortunately the animations were in the .anim format I believe, no way to test in Blender.

    I forgot to add that the moment of fbx import from Unity into Blender is also important. This is the dialog that I'm talking about:
    2023-09-19 15-53-26.png

    • Ignore leaf bones - this is deleting those "nubs" at the end I believe, don't think it's actually important, but just to be safe I leave it off
    • Force connect children - this is a pretty big one, I think. In that, it might actually change the internal hierarchy of the rig and thus screw it up later down the road. If you leave if off, then bones might be floating in the air separate from each other but it doesn't mess up the rig.
    • Automatic bone orientation - honestly don't know what it does exactly but it sounds like it might be worth fiddling with
    • And obviously determining the bone axes incorrectly on import might be causing the issue.

    I remember changing some of these import settings too so might be worth checking out.

    Also try to choose "FBX all" for Apply scalings.
     
  6. feirut

    feirut

    Joined:
    Aug 20, 2022
    Posts:
    4
    How did you managed to import from Unity? I've been trying with some old models that i did but some good animations, no success on it.
     
  7. BuzzKirill

    BuzzKirill

    Joined:
    Nov 14, 2017
    Posts:
    48
    Well, what do you mean exactly? The .fbx model files are stored in the project folder. You can just go there and copy them to wherever you need, or import them from that folder directly into your 3D editor software. There's also GameObject > Export to FBX.
     
  8. feirut

    feirut

    Joined:
    Aug 20, 2022
    Posts:
    4
    The thing is i can import to Blender, but in Blender only the model and the rig comes out, the animation is still only visible in-engine, even with Export to FBX.
     
  9. BuzzKirill

    BuzzKirill

    Joined:
    Nov 14, 2017
    Posts:
    48
    Are you sure the animation is actually stored inside the model .fbx and not separate file? (separate .anim or a separate .fbx)
    When it's in Blender you have to check what Actions have been imported by going Outliner window > Blender File > Actions dropdown or Dopesheet window > switch to Action editor and there's a dropdown with all the actions currently in the file