Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Blender FBX: Why are only some actions being imported/exported?

Discussion in 'Animation' started by Nanako, Mar 21, 2015.

  1. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    So i have these actions in blender


    I export as fbx using these settings



    And this is my result in unity:


    The walk/run/sprint animations are missing

    what's going on?
     
  2. medhue

    medhue

    Joined:
    Aug 24, 2014
    Posts:
    176
    Hey Nanako, I have no idea why, but I would try exporting it with ASCII rather than binary.
     
    Nanako likes this.
  3. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    oh hello you <3
     
  4. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    ASCII export seems to fix it, but also introduces another problem in that the model now appears at 1% size

    and to be clear, it's not importing at the wrong scale. My import scale is 1.0
    it's 1% of the size it should be, AT scale 1
     
  5. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    this is screwing up all kinds of stuff :/ i can't make my additional bones work now. poke me on skype?
     
  6. Fab4

    Fab4

    Joined:
    Sep 30, 2012
    Posts:
    114
    Are you using the newest version of blender? I exported animation several times this week and never had any problem.

    When you change the animation in your action editor (the list in your first picture) does the animation actually change?
     
  7. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    That's a Unity bug since version 2. And they never fixed it. They just made it even worse in version 5 ^^

    You have to set the import scale to 100 now.
     
  8. medhue

    medhue

    Joined:
    Aug 24, 2014
    Posts:
    176
    I do see the scale issue, but I really have no idea why scale is an issue. Just scale the character up in Unity.
     
  9. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    Because you have to scale it again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and again and ...

    So it becomes an annoying issue over the years. And the "invisible" mesh traps me eve nowadays here and there :)
     
    steve-thud, theANMATOR2b and Nanako like this.
  10. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    wtf, whyyy ;-;

    does UT know about this? please tell me you've reported it and they're totally working on fixing it
     
  11. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    okay, here are the problems i have

    With Binary Export:
    Not all of the animations are imported. Why ?

    With ASCII export:
    The scale problem as mentioned above
    My hammer animations stop working
    If i tick Optimise Game Objects in the import window, EVERYTHING stops working and my guy just floats around in T pose.

    honestly, binary is newer, and has least problems. i'd prefer to just get that working, than use the obviously problematic ascii. help!
     
  12. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    Yes they know about it. Yes it's reported since version 2 regularly. And no, they don't fix it. Mail them and ask them why. I have long given up at it. Unity is strange when it comes to bugs :)

    Hm, the Blender pipeline becomes more and more problematic with FBX. The problem here is that the developers always reverse engineer every new FBX version while other companies simply grab the official FBX SDK from Autodesk, and have a working version. The fun of GPL licensing. And from now and then they break some things.

    What you could try is to use this script for rotation issues: https://gist.github.com/FlaShG/a82ae94d5789e92f2bec

    And you could try to use the newest Blender developer version, which can be found here: https://builder.blender.org/download/

    You could also try to use external tools to export proper FBX. I use for example Ultimate Unwrap 3D. But this tool costs a bit money. Autodesk has also a free FBX converter. Never tested though ...

    Ascii is by the way the older FBX version, which could explain your trouble. I think it is still one version behind. Binary is the newer FBX version.
     
  13. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    Is there any other format i could use to transfer models and animations between unity and blender?

    Are you saying i wouldn't have these problems if i used a commercial suite, like maya or 3DS ?

    has anything changed in fbx recently? i'm using blender 2.72, and fbx version 7.4

    would love anymore information about external exporters and converters, i will look into these x
     
  14. medhue

    medhue

    Joined:
    Aug 24, 2014
    Posts:
    176
    Blender has been working on FBX, and DAE exports for the last few release. Personally, I always use ASCII because of blend shapes, as they won't work with Binary.
     
  15. vvaris

    vvaris

    Joined:
    May 23, 2013
    Posts:
    26
    Your animations are there already there. They are just hidden. What you need is more "animation clips" in Unity.
    -You need to push the + under the "maro_armature|TPose" in the picture, to add "animation clip"
    -Then select the "animation clip" and above the "clamp range" there reads "source take" select your animation from there.
    -Add as many "animation clip" slots as you need and assing animation there.
     
  16. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    i'm 90% sure i already did this, and the only things in the source take menu were the same things that were already in clips. The missing animations weren't there. ill repeat it just to be sure though
     
  17. Fab4

    Fab4

    Joined:
    Sep 30, 2012
    Posts:
    114
  18. vvaris

    vvaris

    Joined:
    May 23, 2013
    Posts:
    26
    Uncheck NLA strips from the exporter unless you use them in Blender.
     
  19. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    i was right about the source take. All the missing actions are also missing from there

    @Fab4 someone in that thread seems to have found a solution, but i can't quite understand their explanation of it, nor for that matter am i certain its the same problem. Do you have any insight?

    @vvaris done now, doesn't make a difference to the problem sadly.
     
  20. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    I haven't been into making graphics the last few months, and my last full rigged character is from a year back. So i am not of real good concrete help at the moment. Have to catch up first and have a look how things are now. Just noticed a few oddities out of my eyewrinkles with newer Blender versions.

    No, FBX is the way to go. Blender can read Obj to some degree and as long as the mesh is just with one material. But Obj does not allow animation. Unity also reads Collada to some degree. But here the oddities are even worse. Not worth the try. What remains is the official supported FBX format.

    Not these kind of problems, yes. But maybe others ^^

    Yes, there were some fixes and changes since Blender 2.72, even when it's still FBX 7.4 binary and 6.1 ascii. Current version is Blender 2.73a. And 2.74 is in the Release Candidate state at the moment. You will download 2.74 from the above linked buildbot page. It's definitely worth the update. And may even fix your problems.
     
    Nanako likes this.
  21. Fab4

    Fab4

    Joined:
    Sep 30, 2012
    Posts:
    114
    As far as I have understood it is not a Unity problem, but the problem is caused by Blender.

    When you make some animations, you can set keys to deform and non-deform bones. e.g. an IK-Target or a pole for non-deform and the head rotation for a deform bone.

    Plese try the following (which I highly recommend anyway forexporting animations in blender):

    At the beginning of an animation, select all bones set a rotation and location key (Keybord--> I Menupoint --> LocRot). Do this for every single animation in your list and retry to export again.

    Please let me know if it helps (this normally gets you out of the issue of strange starting poses of your animation).
     
    Nanako likes this.
  22. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    now done. This did not affect the problem, most animations are still missing. I found that quite a few of my anims didn't have data on frame zero, but putting a keyframe there in all channels hasn't changed anything
    i am using some deform bones, and some not, i export with only deform bones checked. I'm using a ton of IK bones and such
     
  23. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    now running blender 2.74 RC2
    missing animations are still not showing up ;-;
     
  24. vvaris

    vvaris

    Joined:
    May 23, 2013
    Posts:
    26
    If you post Blend maybe I can sort it out. I'm using FBX 6.1 exporter in Blender and not 7.4, 6.1 is more reliable at the moment in my opinion.
     
  25. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    Fab4 messaged me, here's a relevant excerpt

     
  26. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    I would pass this example also to the Blender devs. They can just fix what they know of.
     
  27. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    is it perhaps possible to use NLA strips in unity? (not that i know what they are yet)
     
  28. vvaris

    vvaris

    Joined:
    May 23, 2013
    Posts:
    26
    At least FBX 6.1 works for me with these settings:
    https://dl.dropboxusercontent.com/u/2988574/NanakoSettings.PNG
    For some reason Sprint doesn't appear at all if I export using FBX 7.4.
    You have two scripts in your Blend file, are they part of some add on or what? They might interfere with the export process. I suggest you get rid of them unless you need them.

    -You are using decimater modifier to cut down vertex count, hate to break it to you but thats not optimal solution. Optimal would be doing a low poly using retopo tools and baking normal maps. Chech out tutorial for that from blendercookie.com or somewhere else.
    -I would apply mirror modifier before skinning the character, but thats just me.
    -your UI layout is bit diffucult to use, here is my layout suggestion: https://dl.dropboxusercontent.com/u/2988574/My UI.png
     
    Last edited: Mar 23, 2015
  29. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    i didnt consciously add any scripts. Do you have any idea what they are? maybe i can remove them

    re decimate: I'm a perfectionist and i have no idea when to call the model done, for now he's not really finished. decimate gives me a quick way to export a low poly copy for testing, without any kind of finalizing procedure
    what do you mean skinning? Again, model isn't finished, so applying mirror seems like a bad idea
     
  30. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    also, does that imply that you managed to get jog and walk exported?
     
  31. Tiles

    Tiles

    Joined:
    Feb 5, 2010
    Posts:
    2,481
    Always apply all modifiers, and always apply all rotations, transforms and scales before exporting.
     
  32. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    no, that's dumb and destructive to workflow.
    That's what this checkbox at the bottom is for:

     
  33. Fab4

    Fab4

    Joined:
    Sep 30, 2012
    Posts:
    114
    I agree that its bad for Workflow but sometimes this realy helps
    The armature modifier should stay unapplied
     
    Last edited: Mar 24, 2015
  34. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    it doesn't apply the armature modifier. just all others
     
  35. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    As per Fab4's recommendation, i've tried recreating the apparently bugged walk/jog/sprint animations. Here's what i've found:

    Manually copying, pasting and keyframing poses into a new action:
    works. and the result exports successfully.

    Selecting all keyframes, copying them, creating a new action, keyframing all channels in frame 0, and then pasting all keyframes:
    Works, and the result exports successfully (this is pretty quick and easy)

    Pressing the + button to create a new action which is a copy of the current one:
    does NOT work properly. If i do that with an action, and then keep it selected/active on the armature while exporting, then that one, and only that one, will export fine. But the other two (of walk/jog/sprint) treated with this method will not export properly if they aren't the currently selected action.

    Looking at this, the obvious conclusion is that there's something screwed up about my actions, and whatever that is, it's carried over when copying the action wholesale, but not when copying its keyframe content (which suggests it's not the keyframe data which is at fault)

    Does anyone have any thoughts or speculation on this? could someone replicate my results to confirm?
     
  36. vvaris

    vvaris

    Joined:
    May 23, 2013
    Posts:
    26
    Yes, I ended up in a same conclusion. Your sprint action is corrupted in some way, that corruption only appears if you use 7.4 exporter. Using 6.1 exporter it works.

    Just use 6.1 exporter for the time being, it way more predictable and stable. The 7.4 is a bit rough around the edges, you get more problems along the line if you stick with the 7.4.
    (Blender FBX 7.4 exporter is improving rapidly but its not there yet for stable production.)

    Create a clean Blend file, disable all the add-ons that you don't need and append you character there to get rid of the unnessary scripts.
     
  37. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    6.1 had problems too./ Notably the 1% scaling issue, and also the issue of my hammer not animating, which i've yet to really investigate. when both states are bugged it makes more sense imo, to try to focus on the newest version. but i could try 6.1 again

    do you have any thoughts on the hammer issue?
     
  38. vvaris

    vvaris

    Joined:
    May 23, 2013
    Posts:
    26
    In my export setting I use scale 100, that fixes the scaling issue. With these setting the hammer animation works too as far as I can tell. https://dl.dropboxusercontent.com/u/2988574/NanakoSettings.PNG

    EDIT: If you use "Mechanim Human" make sure you have all bones checked from animation > animation masks.
     
  39. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    this really, really annoys me. I have a problem with doing this on principle.

    I've gotten 7.4 working now, by copying and pasting the keyframe data of those animations which didn't work, For now i plan/hope to just continue like this, i'm loathe to go back to an older version of the exporter, especially since it's proven to be less than perfect

    if 6.1 was utterly perfect and stable in every way, then i'd probably use it as long as it fitted my needs featurewise. But if it has one problem, it might have more. And if it's not the newest version, it's probably not recieving updates or fixes.
     
  40. vvaris

    vvaris

    Joined:
    May 23, 2013
    Posts:
    26
    True, but there is few small problems related to 7.4, even if you use the current release candidate of Blender 2.74. You have been warned. :)
     
  41. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    any chance you could list those you're aware of? i saw that one about the duplication issue
     
  42. ChrisSch

    ChrisSch

    Joined:
    Feb 15, 2013
    Posts:
    763
    You're lucky you got that far, most my issues start with Blender not even saving the animations I made. Thankfully they ended up in the backup blend file. As for your problem, you can also try just renaming the animations, and turning that F button off and back on, then saving and exporting again. But if your actions are corrupted for some reason (as they do appear) that probably won't make any difference.

    Just be careful, I feel like I'm walking on egg shells when I'm painting or animating in Blender, just waiting for it to explode in my face.
     
    theANMATOR2b likes this.
  43. KrayonZA

    KrayonZA

    Joined:
    Mar 5, 2013
    Posts:
    52
    This seems to happen when you delete an object from the scene which has animation data on it.

    @Nanako thanks for the fix it helped me.
     
    The-Peaceful likes this.
  44. Exploder1010

    Exploder1010

    Joined:
    Jul 19, 2014
    Posts:
    6
    hey if anyone is still having this problem check your action editor for these red underlined keyframe title things

    if you have these its bad and it means you changed the name of something wrong at some point or something. so just delete them and then press "a" on the keypad and put a locrotscale keyframe for everything at the beginning to be safe. They are supposed to look like these white colored titles: upload_2016-3-8_21-1-45.png

    it turned out for me at least that all of the animations that didn't export in the 7.4 binary fbx exporter had these red underlined things and when i deleted them it fixed it.

    hopefully this helps someone
     
    Jaah-Kii, Senshi and deab like this.
  45. Exploder1010

    Exploder1010

    Joined:
    Jul 19, 2014
    Posts:
    6
    theres also a way to fix the broken keyframe title things but its harder and it involves manual copy/pasting so just let me know if you want to know how i fixed it.
     
    Y_car likes this.
  46. VengeanceDesign

    VengeanceDesign

    Joined:
    Sep 7, 2014
    Posts:
    84
    Thank you so much Exploder. That fixed my animations.
     
  47. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    324
    Thanks Exploder, this helped us a lot.

    We deleted a bone that had been used in an Action, that seems to cause the animations to be corrupted and they do not import into unity. Find and delete the offending bones keyframes, and everything begins working again.
     
    Bob1011941 likes this.
  48. deab

    deab

    Joined:
    Aug 11, 2013
    Posts:
    91
    Nice work Exploder, fixed for me!
     
  49. BuzzKirill

    BuzzKirill

    Joined:
    Nov 14, 2017
    Posts:
    44
    Also, guys, there's an easy way to select all channels underlined red - unselect everything, then select every bone in your current rig (in the 3D viewport). In the dopesheet, it will select the same bones/channels, with only the deleted (missing/underlined) ones being still unselected. Then, simply press Ctrl + I to invert the selection, thus selecting every unwanted channel, and delete by pressing X.
     
    Davex6 likes this.
  50. Bob1011941

    Bob1011941

    Joined:
    Mar 23, 2018
    Posts:
    2
    To what ShawnBlais said. I deleted a bone not needed for animation but the animation for it stayed in the dope sheet. After deleting it from the dope sheet the animation exported correctly.