Search Unity

Question Blender models broken since Unity/Blender updates

Discussion in 'Editor & General Support' started by WARdd, May 5, 2022.

  1. WARdd

    WARdd

    Joined:
    Aug 10, 2015
    Posts:
    29
    I wanted to open an old project I started back with Unity2017. I used Blender 2.78 to make 3D models for this game and put those models directly in the asset folder to work with them (something I have since learned not to do anymore)
    Anyway, I tried opening the project again, using Unity 2020.3 and Blender 3.1.2, but I found that all the prefabs and objects using blender models are completely broken.
    • Some mesh renderers will not render, no matter what settings I use. Even swapping the meshes doesn't work, I can't find any way to get it to render, except by replacing the gameobjects outright, then manually replacing all scripts and connections.
    • Blender files with animations are broken, in that every animation becomes one and the same last selected animation in Blender, it seems I can't fix this except by exporting the blend files into fbx and once again, replace gameobject and replacing all scripts and connections manually
    • Models with rigs and bones will sometimes have a rotation applied to them, as if x and -y axis have been flipped. I can sometimes fix this in Blender, but it gets very complicated when bones are at arbitrary angles. Again, replace and fix manually. Scripting changes are sometimes needed too in this case.
    I think you can understand how frustrating this is, at this rate it seems I will have weeks of work just repairing things that are arbitrarily broken. I already tried loading the project with Unity2017 or using older versions of Blender, the former makes no difference, the latter seems to break the models altogether, so no avail there.

    I also tried messing with axis conversion in FBX export, but this seems to make no difference either.

    So yes, any help to let me fix these sort of problems efficiently is very welcome

    Screenshot_1.png
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,694
    I have been through this exactly. Here is what is happening.

    If you had
    cam,
    light
    model

    in the past, the past script USED to only import model

    Now it imports all 3, and parents them to a top extra object

    It is the reparenting that throws this off.

    The way I fixed this was to hack the python import script (at the installation level) so it never imported cameras or lights.

    Now I just have to apply this hack to every new installed version of Unity... but it works.

    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


    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

    Probuilder and Probuilderize and Blender:

    https://forum.unity.com/threads/probuilder-vs-blender.462719/#post-8060462

    Some more potentially-useful info:

    https://forum.unity.com/threads/orientation-problem.1265834/#post-8037734
     
  3. WARdd

    WARdd

    Joined:
    Aug 10, 2015
    Posts:
    29
    Unfortunately what Kurt-Dekker pointed out is not the problem, most of my files didn't have cameras or anything anyway. I do notice a lot of blender files are importing differently, some names are changed such as "pitch_1" becoming "pitch 1" or "pivot.L" becoming "pivot_L". The problem is definitely related to how Unity imports blend files, I'm just shocked that reverting Unity and blender to older versions didn't fix my problem.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,694
    You would need to reimport all, which I suppose you did when you changed Unity versions...

    In any case, I strongly suspect it is actually Blender doing this "pitch 1" to "pitch_1" conversion... perhaps not, but I just tested with Blender 2.91.0 and Unity 2021.1.0f1 and "Cube is Foo" exports correctly.

    You could trivially prove it by loading Blender 3.1.2 and exporting one of your funny-named objects and seeing what comes up in the FBX in Blender.

    Another argument for sticking with A-Z and 0-9 for all identifiers. :) Spaces and other whacky characters will always cause problems with some system somewhere.