Search Unity

Use of .blend files in Unity

Discussion in 'Formats & External Tools' started by Paulprog16, Jul 16, 2019.

  1. Paulprog16

    Paulprog16

    Joined:
    Apr 20, 2016
    Posts:
    54
    Hello,

    I read not long ago in the official Unity docs that Unity discourages the use of .blend files and recommends exporting as .fbx from Blender.

    I would like to understand why that is and why using .blend files is even possible if it is so bad.

    The thing is, I find working with .blend files WAY more comfortable than exporting to .fxb, since it saves so much time and I get the results that I want anyway.
     
  2. publiweb

    publiweb

    Joined:
    May 10, 2018
    Posts:
    14
    If you import .blend / .3ds / .ma files Unity will automatically open the software and then export the .fbx file

    The usage of these formats is not recommended because it takes more time than the usual to load 3d scene data & because maybe the conversion could result in errors or unexpected results.
     
  3. Giometric

    Giometric

    Joined:
    Dec 20, 2011
    Posts:
    170
    Also, it requires you to have the respective apps installed on your computer. So if you were collaborating with someone and they don't have Blender / 3dsmax / Maya, Unity won't be able to import those files. FBX files will work without the user needing anything special installed.
     
    ALeonidou likes this.
  4. Paulprog16

    Paulprog16

    Joined:
    Apr 20, 2016
    Posts:
    54
    Thank you for your answers.

    @publiwebhnventas I have to disagree completely here. At least in my case, eveything is much faster when I use .blend than when I export to .fbx. And I don't even have to care about exporting options because it all works perfectly.

    @Giometric Well, I don't work with a team, so that's not really a problem for me.

    So any reason for me to really switch to working with .fbx files instead of .blend files?
     
    wyckster likes this.
  5. michelhabib

    michelhabib

    Joined:
    Mar 12, 2012
    Posts:
    20
    I wish i can answer that question too, i am having hard time with doing workarounds for FBX to work correctly
    I have to use these workarounds https://blog.imphenzia.com/blender-to-unity/ for correcting scale/rotation issues, but it then messes up my blender setup, and i have to undo these steps in order to continue working in Blender. Also, it is almost impossible to export FBX when you are linking character in Blender from other .blend files.
    If you reached a good workflow, please let me know.
     
  6. DimitriX89

    DimitriX89

    Joined:
    Jun 3, 2015
    Posts:
    551
    Bloated project size. Blender files have extra data that will never transfer to Unity
     
  7. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    I've written an FBX exporter add-on for Blender that automatically performs those adjustments in the scale/rotation before exporting the FBX file. The scene is then restored so you can continue working normally.

    Here's the link:
    https://github.com/EdyJ/blender-to-unity-fbx-exporter

    I haven't tested it with animations or armatures yet, but please let me know if you encounter any issue.
     
    PutridEx and tintinlazotis like this.
  8. ster1203

    ster1203

    Joined:
    May 17, 2020
    Posts:
    4
    So after using blend files for a while and getting closer to my release date. I have found out that Unity Cloud Build does not support .blend files due to the requirement of blender to be installed, this is more of a problem for IOS than Android. Keep this in mind when using blend files as i now have to go over every blend file and change it to an fbx.

    ps, enterprise version of Unity allows you to have dedicated building agents and install whatever software you like on it, so i guess that is a solution.
     
    rlalancette and Edy like this.
  9. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    513
    I'm also using blend files directly as it is convenient for environment. However it's quite troublesome to do CI with it. Although blender is properly installed on the machine it's not imported correctly during the batch building.
    I have to manualy do the following :
    - Reimport blend files
    - Reimport all prefabs that may include a blend file mesh.

    I don't know why.
     
    PutridEx likes this.
  10. metaphysician

    metaphysician

    Joined:
    May 29, 2012
    Posts:
    190
    bit of a necropost but i'm also experiencing some rotation issues using the .blend file in the project (Unity 2019.4 LTS). i find it very convenient to not have to export to FBX and import to Unity after every change, but i did get the rotation of the armature's upper arm bone being off by 90 degrees. the rig is from mixamo so not a custom rig either.
     
  11. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
  12. Blan3X1

    Blan3X1

    Joined:
    May 29, 2019
    Posts:
    28
    Hey edy i used your addon and it succesfully exported a fbx file and got imported to unity
    I tried exporting a blender scene in which i had made camera rotating animations i wanted to import the same scene to blender.If possible in future make it to import the scene with animations

    glad to see you here!
     
    Edy likes this.
  13. metaphysician

    metaphysician

    Joined:
    May 29, 2012
    Posts:
    190
    thanks for the link! actually i did end up exporting my model as a standard FBX within Blender and the rotation issue on the arm did go away, but i'll look into your plugin if i run into any other significant issues with the process.
     
    Edy likes this.
  14. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    513
    Bananozuar likes this.
  15. Bananozuar

    Bananozuar

    Joined:
    Oct 15, 2016
    Posts:
    6
    Oh boy, that's super usefull, got any tips on how to add proper animation export as in .FBX? I'd love to skip this whole export to FBX and reimport into unity thing just to update animations

    EDIT:
    Add flags from: https://docs.blender.org/api/current/bpy.ops.export_scene.html

    I added:

    bake_anim=True,
    bake_anim_use_nla_strips=True,
    bake_anim_use_all_actions=True,

    And it works wonders!
     
    Last edited: May 21, 2023
    Edy and Whatever560 like this.
  16. SympaK

    SympaK

    Joined:
    Apr 14, 2010
    Posts:
    134
    It's able to export even animations, Edy?
     
  17. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    I think it does because nobody complained about that. There's a suggestion about adding the option to bake animations, but as I don't work with animations I can't tell if/how it is related.
     
    SympaK likes this.
  18. SympaK

    SympaK

    Joined:
    Apr 14, 2010
    Posts:
    134
    Tried and... It works. Thanks. It is a very useful script.
     
    Edy likes this.
  19. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,508
    Noted! Updating documentation... :)
     
    SympaK likes this.