Search Unity

Bug Unity issues with Blender 3.0, Version reading issue?

Discussion in 'Editor & General Support' started by gabrielgonzalez89, Dec 4, 2021.

  1. gabrielgonzalez89

    gabrielgonzalez89

    Joined:
    Sep 16, 2019
    Posts:
    22
    Fresh new most up to date Unity 2021 version, Fresh up to date Blender 3.0 Version. (Unity does recognize the version and opens the correct blender version using the open button)

    I'm not sure but I kinda believe there werent any changes on file hierarchy on blender... so this probably be Unity reading the version in some weird way and thinking this is an older than 2.8 version...
    UnityBlenderShenenigans.jpg
     
    hickna likes this.
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    Unity imports Blender3D objects as FBX via a little Python script:

    https://forum.unity.com/threads/from-blender-to-unity-problem.1073381/#post-6925811

    The Python script that Unity uses (substitute your Unity version number or search) to import:

    ./Hub/Editor/2020.2.1f1/Unity.app/Contents/Tools/Unity-BlenderToFBX.py


    Take a look around it to see if it's got any version stuff that might behave weird. I haven't used 3.0 yet but I know I did some tweaks to my import scripts when it went to 2.8, and now I have to do those same changes every time I update Unity, just because some of my older projects rely on it.

    More on fixing it:

    https://forum.unity.com/threads/all-my-mesh-folder-content-is-gone.1102144/#post-7094962

    Blender3D objects used as trees / detail in Unity3D terrain (See the second half of this response)

    https://forum.unity.com/threads/ter...trees-made-with-blender.1112119/#post-7155631

    https://forum.unity.com/threads/all...nging-parent-in-blender.1159283/#post-7442123
     
  3. gabrielgonzalez89

    gabrielgonzalez89

    Joined:
    Sep 16, 2019
    Posts:
    22
    Alright, I have never used py, but I'll try, one question, does Unity keep this file in loaded while the software is running or I can change it and see it's effects without restart?

    and if it is not an issue, could you show me how yours is currently?
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    Unity just invokes it at the time of import. You SHOULD be able to edit it, then right-click-reimport the file.

    I think there MIGHT be a way to get messages out of the running import script to reason about what's happening, but if it's not obvious how to do that, you could always just write output to a file if that helps you debug.

    The only thing I changed about mine was to make it NOT import the Camera or Light, which was how things worked prior to about 2018. I have bazillions of Blender files where I did not delete the default Camera or Light, so when Unity started suddenly importing Camera / Light, a ton of my existing games broke, which is why I hacked my local script. I'm not on that machine but the actual change was just to remove "CAMERA" and "LIGHT" from the types list, that's all.

    Keep in mind I know NOTHING about Blender 3.0, but you should always be able to export the Blender file as FBX yourself, then use that, even if it's an extra pain in the butt step.
     
  5. YOSSI2010

    YOSSI2010

    Joined:
    Dec 26, 2016
    Posts:
    20
    I tried modifying the python file to check for blender 3 as well.
    however it still says the same error, the file has no mention of this error so I think Unity does a precheck of the version somewhere else even before this file runs.
     
    MTZD likes this.
  6. korsynx

    korsynx

    Joined:
    Jan 2, 2021
    Posts:
    11
    my .blends saved in v3.0 won't import into unity, and they won't open in an older version of blender
     
    mattxreality likes this.
  7. gabrielgonzalez89

    gabrielgonzalez89

    Joined:
    Sep 16, 2019
    Posts:
    22
    That's what I believe it's happening.I dont think we have the power to do a workaround this one... that sucks :/
     
  8. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    Just export it from Blender3D as FBX and import that instead.

    Yes, it may be suboptimal and require more irritating clicking, but it IS a workaround.

    Actually it IS the reference 3D model workflow. Most serious Blender users do it this way to have more explicit control.

    Personally I like to live dangerously and import Blender directly into Unity, but it does have its own issues, as you can see above.
     
  9. Ozego

    Ozego

    Joined:
    Apr 26, 2015
    Posts:
    10
    I have this problem as well.
    Reinstalling 2.8 and setting it as the default for .blend files resolved issue. If someone gets the .py working with 3.0 please share it
     
    mattxreality and FlightOfOne like this.
  10. PrecisionCats

    PrecisionCats

    Joined:
    Nov 19, 2017
    Posts:
    40
  11. k_dunlop

    k_dunlop

    Joined:
    May 10, 2019
    Posts:
    16
    This is highly impractical if you have the common method of having a prefab variant of the original .blend, like my own, which contains dozens of components, such as custom colliders and rigid bodies held in the variant. To top that we cannot swap out the prefab base for an fbx version once the root prefab is corrupted or in this case, unreadable by Unity.
     
  12. PrecisionCats

    PrecisionCats

    Joined:
    Nov 19, 2017
    Posts:
    40
    In the past I have swapped a prefab root between fbx and blend by swapping the "guid" in the .meta files
     
  13. k_dunlop

    k_dunlop

    Joined:
    May 10, 2019
    Posts:
    16
    that has worked for for me too, but unfortunately that doesn't work for variants because the fbx is different from the blend and so all the id's the components use are changed..

    This problem was a nightmare and I spent my entire Sunday fixing it. In the end I had to reinstall my unity version, go back to blender 2.93 and had to overwrite my entire project with a previous version control one.

    I'm not one of those guys that points the finger at the Unity team, and I appreciate everything they do for us- but this isn't some minor bug to be ignored. It could be catastrophic for someone that has entire scenes or characters with variants based on .blend files. I know for sure the answer lies in a simple python edit in the Tools folder, along with one or two other files, which is what makes it all the more frustrating.
     
  14. George-Ing

    George-Ing

    Unity Technologies

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

    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. 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.
     
    mattxreality, MMX3VIII and spiney199 like this.
  15. 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
    MTZD likes this.
  16. unity_Etienne

    unity_Etienne

    Unity Technologies

    Joined:
    Nov 28, 2019
    Posts:
    17
    Cross posting just in case:
    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 I mentioned in this thread.
    You really have to make sure to point to the new launcher-blender.exe from 3.0.1 to get it back to normal.

    Hope this helps and thank you for your patience!
     
    REDAXE likes this.
  17. JEYAKANNANJK

    JEYAKANNANJK

    Joined:
    Nov 21, 2019
    Posts:
    2
    Blender 3.1.2 with the fix is now