Search Unity

Blender 3.0 not direct importing

Discussion in 'Asset Importing & Exporting' started by Divinum-Fulmen, Dec 6, 2021.

  1. Divinum-Fulmen

    Divinum-Fulmen

    Joined:
    Jul 11, 2014
    Posts:
    8
    My .blend assets are broken, and I'm getting the error

    "Blender could not convert the .blend file to FBX file.
    You need to use Blender 2.45-2.49 or 2.58 and later versions for direct Blender import to work."


    Blender has just had a major version update. And the new version seems incompatible with Unity.
     
    mattxreality, k_dunlop and YOSSI2010 like this.
  2. YOSSI2010

    YOSSI2010

    Joined:
    Dec 26, 2016
    Posts:
    20
    Tried modifying the python script to say 3.0.0 instead of 2.80.0 to no avail.
     
    mattxreality and LagSik like this.
  3. korsynx

    korsynx

    Joined:
    Jan 2, 2021
    Posts:
    11
    i'm having issues with all my .blend files saved in v 3.0
     
    mattxreality likes this.
  4. LagSik

    LagSik

    Joined:
    Apr 6, 2020
    Posts:
    5
    That work for me. Thank a lot. Now I can edit the Blender file and it correctly update in Unity. Here is the location of the python script in case others are looking for it :
    Program Files\Unity\Hub\Editor\2021.1.13f1\Editor\Data\Tools\Unity-BlenderToFBX.py
     
  5. MoonstalkerWolf

    MoonstalkerWolf

    Joined:
    Nov 24, 2020
    Posts:
    1
    I'm having the same issue. Modifying the python script didn't help.
     
  6. Rib

    Rib

    Joined:
    Nov 7, 2013
    Posts:
    39
    I've also been hitting issues with .blend files not importing since installing Blender 3.0

    Something else I noticed though was that imports would still fail after uninstalling all versions of Blender and just installing the 2.93LTS version even though that certainly worked before. There appears to be some caching at play with this issue (at least for me).

    After I uninstalled Blender 3 and just installed 2.93LTS...

    I was able to nuke my project's Library/ folder and through doing a _full_ reimport for the whole project then .blend files started to import again.

    I also found that I could make changes to import settings (such as the scale) to trigger a re-import - but reverting the change would just put it back into a state where it would not import the file. Similarly I could rename .blend files and then they would correctly re-import. (presumably since that state is cached somehow).

    I wish I knew what minimal Library/ state could be deleted to avoid the full reimport since I'm now hitting this problem with a much larger projects that's going to take hours to reimport :/

    The simplest benign change that seems to work is to just open the .blend file, make a trivial change, then revert and re-save - anything to just change the hash for the file to bypass the cache. Obviously a naff workaround but at least for me I really don't want to do a full reimport of this project if I can help it.

    It would also be good to figure out a workaround that lets me keep Blender 3.0 installed - I guess for now I'll just use nightly Blender builds that are just unpacked without being installed.
     
    Last edited: Dec 13, 2021
  7. Mithys

    Mithys

    Joined:
    Dec 5, 2017
    Posts:
    2
    On Windows, it seems that your default opener for .blend files is the one that will be used for Unity importer (not the version on PATH).
     
  8. LuiBroDood

    LuiBroDood

    Joined:
    Mar 13, 2019
    Posts:
    84
    yeah this sucks really bad i need a fix

    wtf it like works in one project but not the other (?) idk whats going on
     
  9. WakeArray

    WakeArray

    Joined:
    Dec 24, 2016
    Posts:
    1
    Modifying the python file worked for me, I'm using Blender 3.0.0 and Unity 2020.3.22f1

    As stated above, the python file is found at:
    C:\\Program Files\Unity\Hub\Editor\{{Your Unity version number}}\Editor\Data\Tools\Unity-BlenderToFBX.py

    I changed the line at the top that says:
    blender280 = (2,80,0) <= bpy.app.version

    to read:
    blender280 = (3,0,0) <= bpy.app.version

    And that's all I needed to do, hope that helps.
     
  10. LuiBroDood

    LuiBroDood

    Joined:
    Mar 13, 2019
    Posts:
    84
    doesnt work for me
    my path is too idk
    D:\Program Files\Unity Editor\2020.3.25f1\Editor\Data\Tools
     
  11. Kurutah

    Kurutah

    Joined:
    Jul 19, 2017
    Posts:
    11
    Didn't work for me...
     
  12. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    Someone should report a bug, and in the report send a small project containing some 3.0 blender files to reproduce the issue. I don't have blender 3.0 Installed or I'd do it.
     
  13. PrecisionCats

    PrecisionCats

    Joined:
    Nov 19, 2017
    Posts:
    40
  14. Amon

    Amon

    Joined:
    Oct 18, 2009
    Posts:
    1,384
    I voted. We just need one more.
     
    Michael_Berna likes this.
  15. wyrm2525

    wyrm2525

    Joined:
    Nov 25, 2018
    Posts:
    2
    Voted as well... it missing 9 more votes :)
     
    Michael_Berna likes this.
  16. k_dunlop

    k_dunlop

    Joined:
    May 10, 2019
    Posts:
    16
    same issue here. need a patch. voted
    had to not only reinstall blender 2.93 but also had to reinstall the version i had of unity to clear whatever cache changes it made. none of the py patches people have mentioned worked.
     
    Last edited: Jan 18, 2022
  17. mediapod_uk

    mediapod_uk

    Joined:
    Jun 4, 2019
    Posts:
    6
    Yup me too! - voted!
     
  18. bobthenob

    bobthenob

    Joined:
    Sep 2, 2013
    Posts:
    26
    yes me too
     
  19. R3bornD4rth

    R3bornD4rth

    Joined:
    Jan 18, 2022
    Posts:
    1
    Damn, for me the quick fix doesn't wanna apply as well. Still 9 votes needed... Anyhow exporting inside Blender to .fbx helps in the short term I guess... Annoying cause I started questioning my process here xD
     
  20. PrecisionCats

    PrecisionCats

    Joined:
    Nov 19, 2017
    Posts:
    40
    Installing a 2.x version of blender then doing something like:

    cd C:\Program Files\Blender Foundation\Blender 2.93
    blender.exe -r

    in command prompt will register it as the default program for the .blend file, but it won't work correctly for .blend files using 3.0 features like the new geometry nodes.
     
  21. k_dunlop

    k_dunlop

    Joined:
    May 10, 2019
    Posts:
    16
    thanks that helped actually, my .blend files suddenly stopped working again but registering them with 2.93 brought them back to life in Unity. Thanks!
     
  22. George-Ing

    George-Ing

    Unity Technologies

    Joined:
    Jan 14, 2020
    Posts:
    78
    Hey folks,

    X-posting from the other Blender thread!

    I wanted to make sure we're not silent on this issue. We have heard you, and we understand the frustration around this bug.

    Right now, we're not entirely sure what's changed between Blender 2.93 & Blender 3.0, so we've reached out this morning to our friends over @ Blender to see if they can offer us any tips. To be completely transparent, the challenge for us is always supporting new integrations (e.g. Blender 3.0) whilst maintaining support for existing integrations (e.g. Blender 2.93) without disruption. I'll do my best to keep you updated on what we hear.

    Until then, I'd recommend setting Blender 2.93 (or below) as the default program on ".blend" files. PrecisionCats is absolutely spot on (thanks for doing our job for us - appreciate it! ^^), you don't need to reinstall Blender to do this. If you run Blender 2.93 from command line using "Blender.exe -r" then it will set that Blender executable as the default program for ".blend" files.

    If you need to leverage features from Blender 3.0, then right now you'd have to go the FBX export route. Hopefully, I'll have some better news soon.
     
    JBrach, LuiBroDood and PutridEx like this.
  23. unity_Etienne

    unity_Etienne

    Unity Technologies

    Joined:
    Nov 28, 2019
    Posts:
    17
    Hello!

    Just to follow up on George's post: the kind folks at Blender now have a potential fix in the pipeline. The exact landing is not clear right now but we'll add information here as we get them.

    For now I'd like to share a temporary hack / workaround if you really need to get Blender 3.0 to work in Unity.
    • First find which .exe is set by default for blender. If it was through installing Blender 3.0 it should be 'launcher-blender.exe' in Program Files\Blender Foundation\Blender 3.0, and for previous versions it would be 'blender.exe' in Program Files\Blender Foundation\Blender 2.x.

    • Change the name of this file (ex: '_launcher-blender.exe'). This will invalidate the path for both Windows and Unity.

    • Go in the Editor and re-import a .blend. You should get a ‘Blender could not be found’ error. That's what you want.

    • Now change the 'Opens with' + ‘Always Use This App to Open’ for .blend to the blender.exe that is in Program Files\Blender Foundation\Blender 3.0

    • Go back to the Editor and you can now re-import. Double clicking should open 3.0 as well. You can also change the other exe name back to its original one.
    The culprit is that Unity cannot use the 'launcher-blender.exe' as its default exe for .blend as it is right now, and that's what they will fix in newer versions of Blender. We will also look into future proofing the process on our side as well.

    Hope this helps!
     
    X28, Salazar, mattxreality and 2 others like this.
  24. LuiBroDood

    LuiBroDood

    Joined:
    Mar 13, 2019
    Posts:
    84
    oh hey it works!!
    you want to target the Blender.exe
    not launcher lol xD
     
  25. mattxreality

    mattxreality

    Joined:
    Dec 11, 2018
    Posts:
    57
    I spent an entire day troubleshooting this issue. Even uninstalling Blender and re-installing older versions didn't work after first installing Blender 3.0. @unity_Etienne 's WORKAROUND worked for me.
     
    unity_Etienne likes this.
  26. k_dunlop

    k_dunlop

    Joined:
    May 10, 2019
    Posts:
    16
    Thankyou so much.
    As long as we have a workaround everything is good, thank you so much.
     
  27. George-Ing

    George-Ing

    Unity Technologies

    Joined:
    Jan 14, 2020
    Posts:
    78
    Thanks Etienne, you're amazing as always <3

    Go, team!
     
    unity_Etienne likes this.
  28. George-Ing

    George-Ing

    Unity Technologies

    Joined:
    Jan 14, 2020
    Posts:
    78
    As a follow-up, Blender have confirmed that a fix will be in the 3.0.1 release cycle, we'll let you know once it's landed!
     
    Last edited: Jan 25, 2022
  29. unity_Etienne

    unity_Etienne

    Unity Technologies

    Joined:
    Nov 28, 2019
    Posts:
    17
    Blender 3.0.1 with the fix is now live as the main download for Blender! :D
    Any fresh installation of Blender with this version should work normally.

    If you had Blender 3.0 installed and encountered the launcher bug and are still experiencing it, you might still have to do the workaround mentioned in my previous post.
    You really have to make sure to point to the new launcher-blender.exe from 3.0.1 to get it back to normal.

    Let us know if you find anything else out of the ordinary with this update.

    Hope this helps and thank you for your patience!
     
    jameslroll, Rallix, BrightBit and 2 others like this.
  30. k_dunlop

    k_dunlop

    Joined:
    May 10, 2019
    Posts:
    16
    Thanks for that!
     
    unity_Etienne likes this.
  31. noemis

    noemis

    Joined:
    Jan 27, 2014
    Posts:
    76
    Maybe this is the right place to ask a for a feature, which is longer in my mind, due to some import problems.

    I really like the workflow, that I can directly use blendfiles in unity. Also knowing, that's just a background fbx export job. And there is also the problem: it depends on an external app, which can change. Sometimes my unity projects are longterm (> 1,5 years) and in this time it's likely that I want to update my default blender.

    But sometimes this lead to big import strugle in my projects, sometimes noticed too late and saved broken scenes.

    Here's my request: every blender version is also available as portable. I'd love to set the path to the blender app, which should be used for import. With this option, it would be possible that we can open a 3 year old unity project and next to the project lies the corresponding blender version and everything works just fine.

    In preferences we already have the option to choose editor and set andorid sdk/ndk... pathes, why not make an optional path to the blender exe? So default it uses the installed version, but you can set optional a different path.

    This you be great. And I'm sure, not only for me.
     
  32. noemis

    noemis

    Joined:
    Jan 27, 2014
    Posts:
    76
    You should also adress the issue, that someone somehow decieded to add

    bake_anim_use_nla_strips=False
    bake_anim_use_all_actions=False

    to Unity-BlenderToFBX.py

    This could fix in some cases an issue, but I think for most people it just removes all animations of the import and replaces it with "Scene"... I mean: after every update of unity I have you search the file and change it in the editor. Maybe this should also be exposed to the import inspector?
     
  33. sameng

    sameng

    Joined:
    Oct 1, 2014
    Posts:
    184
    Adding my voice to this issue, although I am actually still on Blender 2.79 and Unity 2021LTS (where everything basically works?)

    This is another thing that gives me such pause to update Unity and Blender.

    The blend workflow is amazing, please let us import animations directly from latest versions of blender. This makes me not want to update, even though 2022 fixes some other bugs (and drops support for 2.79 >.> )
     
  34. noemis

    noemis

    Joined:
    Jan 27, 2014
    Posts:
    76
    Best thing would be @Unity: expose these settings as import parametes that they are not written in import.py file but let the used decide, if bake_anim_use_nla_strips and bake_anim_use_all_actions are true or false...

    And another very anoying bug we encounter: we have a fbx (exported from blender) with 3 animations... later we increased to 30 animations. But this is not updated in unity. We have to add every single animations afterwards in the import settings.
     
  35. KUBO-Fredrik

    KUBO-Fredrik

    Joined:
    Jan 5, 2022
    Posts:
    2
    Hello!
    This still seems to be an issue!
    After upgrading my project to the latest LTS (coming from 2020.3.21), all of my .blend files are now useless inside Unity!
    I have tried all of the solutions:
    - changing python-file
    - Un-installing Blender 3.3 / Re-installing 2.82 (the version that worked before the Unity upgrade)
    - @unity_Etienne 's workaround
    But nothing makes Unity import my .blend files as it used to do in 2020.3! All of my meshes that were referenced in the .blend file are now missing...

    what is going on!?
     
  36. unity_Etienne

    unity_Etienne

    Unity Technologies

    Joined:
    Nov 28, 2019
    Posts:
    17
    Hi @KUBO-Fredrik
    Which version did you upgrade to? 2020.3 LTS or 2021.3 LTS?
    And do you get the same result with the same .blend if you put them in a fresh project?
    Thanks!
     
  37. tbg10101_

    tbg10101_

    Joined:
    Mar 13, 2011
    Posts:
    192
    Just ran into this with 2021.3.13f1 and Blender 3.2.2.

    Updated to Blender 3.3.1 and still have the same issue.

    Also tried in 2021.3.11f1 and 2021.3.12f1 with Blender 3.3.1 and see the same issue.

    I don't know what happened but I wasn't seeing this error before.

    Also, the files get successfully imported if I open the .blend file, change nothing, save it, then switch back to Unity.
     
    Last edited: Nov 8, 2022
  38. tbg10101_

    tbg10101_

    Joined:
    Mar 13, 2011
    Posts:
    192
    Also, the error shows up like this in the Unity Editor:

    It would be great if the error message could also say what file could not be imported.
     
  39. noemis

    noemis

    Joined:
    Jan 27, 2014
    Posts:
    76
    I'm sorry that user again run into this issue. Two weeks ago I met some people from unity and had an intense conversation about this. And I really hope, that we get the possibility to set the path to a specific blender version (for this project approved, which can also lay next to the project) and then it doesn't matter which version of blender we have installed... this would make sense for many long term projects with software, which develops fast and where you have mostly multiple versions in use.
     
  40. tbg10101_

    tbg10101_

    Joined:
    Mar 13, 2011
    Posts:
    192
    I found the issue: this only happens when parallel import is enabled.

    Maybe Blender doesn't like it when multiple files are being imported at the same time?

    In any case, I'll make a bug report.

    Edit - here you go: IN-22654
     
    Last edited: Nov 11, 2022
  41. sphair

    sphair

    Joined:
    Jan 22, 2014
    Posts:
    4
    This workaround does not seem to work if you install Blender from the Windows Store. The installation is then "hidden" inside the locked-down WindowsApps directory. There is no easy way to change the default application to just Blender this way. Tried with Windows 11 and Blender 3.4.1.0.
     
  42. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    Yes, disabling parallel import fixes this issue.
     
  43. bfoddy

    bfoddy

    Joined:
    Mar 27, 2012
    Posts:
    85
    Still seeing this problem with Blender 3.4.1 and Unity 2020.3.46 LTS. Very frustrating.
     
    petrknedlik3 likes this.
  44. George-Ing

    George-Ing

    Unity Technologies

    Joined:
    Jan 14, 2020
    Posts:
    78
    Thanks for reporting these issues, everyone!

    For clarity - separate from the Blender 3.0 issue, Blender parallel import is fixed from the following versions:

    2022 LTS:
    2022.2.8f1

    2023.1:
    2023.1.0b5

    2023.2:
    All releases

    if you're still having issues, if you could file a bug with a test project that would be much appreciated and we can get it fixed!
     
  45. bfoddy

    bfoddy

    Joined:
    Mar 27, 2012
    Posts:
    85
    Is this a typo? 2022 is not in LTS and 2023 is not released to public yet.
     
  46. George-Ing

    George-Ing

    Unity Technologies

    Joined:
    Jan 14, 2020
    Posts:
    78
    You're spot on - when the 2022 LTS is released it will include the fix.

    Fully appreciate this is not ideal - but from speaking to engineers on my team - the fix may cause upgrade challenges where folks have implemented custom python scripts. Performing those kinds of updates during an LTS cycle is generally a "no-go".

    Until then, as a workaround, recommend disabling parallel import when dealing with .blend files specifically.
     
  47. bfoddy

    bfoddy

    Joined:
    Mar 27, 2012
    Posts:
    85
    No worries, I was just confused because you said 'if you're still having issues', which I took to imply that these non-available versions might solve my issues.
     
  48. George-Ing

    George-Ing

    Unity Technologies

    Joined:
    Jan 14, 2020
    Posts:
    78
    I'm going to be completely honest with you Bfoddy - I hadn't actually noticed the 2022 LTS isn't live yet :D

    But it's in the 2022.2 Tech stream :)
     
  49. MohamedTun

    MohamedTun

    Joined:
    May 13, 2021
    Posts:
    39
    The same problem when trying to import blender 4 .blend to unity 2022.3.15f1 LTS:
    "Blender could not convert the .blend file to FBX file.
    You need to use Blender 2.45-2.49 or 2.58 and later versions for direct Blender import to work."
    But works ok with blender 3.5 !!
     
  50. josefgrunig

    josefgrunig

    Joined:
    Jan 23, 2017
    Posts:
    62
    tbg10101_ and MohamedTun like this.