Exporting from Unity to Blender?

Discussion in 'External Tools' started by Velvety, Feb 10, 2012.

  1. Velvety

    Velvety

    Member

    Joined:
    May 4, 2009
    Messages:
    147
    Hi,

    I've created a scene in Unity using basic Unity-created meshes as placehodlers (so that I could build my camera/GUI around their placement). Now I want to export these to Blender so that I can create proper detailed models to replace them with. I want to export my current Unity meshes so that I have a reference in Blender for what sizes and locations to put the new models.

    Is it possible for me to somehow export my Unity scene meshes and then import them into Blender?

    If not, how can I determine the scaling in Blender so that it matches what I have in Unity? For instance, a cube mesh in Unity that has a scale of 1:1:1 would be what size in Blender?

    I am new to Blender so excuse me if this is really obvious. Thanks :)
  2. Catsoft-Studios

    Catsoft-Studios

    New Member

    Joined:
    Jan 15, 2011
    Messages:
    94
    I am neither an expert in Blender, but I think that you cannot export you scene objetcs into Blender, unless you have the fbx files.

    As I understand, you just created some low poly meshes in Blender and used them to create some kind of basic layout for your game. Now you want to create more detailed meshes on top of the first ones.

    If you haven't broken the prefab connection between the imported fbx models and the scene objects, then you may just want to re-write those first fbx models. They will automatically change in your scene.

    The scaling is up to you. Normally you will have to scale the objects to 50 or 100 when importing an object from Blender to Unity. And by the way, you may also want to change the coordinates system to fit Unity (where y means up and z means forward). That is: Blender->File>Export->FBX and in the left column, mark selected objects and change up: Y, forward: Z
  3. Tiles

    Tiles

    Member

    Joined:
    Feb 5, 2010
    Messages:
    2,205
    Yes it is possible. I build my scenes that way too. First i use some placeholders, then i export them to my 3D package and finish the level geometry there.There is a Obj export script for Unity around at the Unify Wiki. Have a look for the ExportObj script.

    http://www.unifycommunity.com/wiki/index.php?title=Scripts/Editor
  4. Velvety

    Velvety

    Member

    Joined:
    May 4, 2009
    Messages:
    147
    Awesome, thank you both. The Obj Exporter is just what I needed. I will also be sure to switch my axis so Blender matches up with Unity. Thanks for the tips!

    How come the unit sizing in Unity vs Blender is so different (50-100x)??? I assume it is better to create my models at a scale that is closer to 1 to 1 so that I don't need to scale it when I import to Unity. Is there a way for me to set the scaling in Blender to match that of Unity? Or is there at least some formula I can use to make sure I am making models in Blender that won't need much changing once in Unity (for instance, maybe I have to make everything in Blender at 50x normal scale, etc)?

    Thanks :)
  5. Velvety

    Velvety

    Member

    Joined:
    May 4, 2009
    Messages:
    147
    Hmm, so I've got the Obj Exporter setup in my editor and tested exporting a simple sphere mesh. But, it doesn't appear that Blender can open .obj files. How am I suppose to get this open in Blender? What programs work with .obj files? Thanks
  6. niosop2

    niosop2

    Member

    Joined:
    Jul 23, 2009
    Messages:
    1,021
    Blender opens .obj files fine. Use the File->Import menu
  7. Velvety

    Velvety

    Member

    Joined:
    May 4, 2009
    Messages:
    147
    Ah so it does, my mistake! I only tried "opening with" on the OBJ file and Blender told me it did not support the OBJ format. But importing works. :)

    Thanks for all your help!
  8. Tiles

    Tiles

    Member

    Joined:
    Feb 5, 2010
    Messages:
    2,205
    Obj scaling should be equal in Unity and Blender. It`s the Unity FBX Importer that makes jokes here. Its default import scaling is at 0.01. So you have to change this setting to 1 every time you import a fbx file into Unity. For me a Unity bug, which is unfixed since years.
  9. Velvety

    Velvety

    Member

    Joined:
    May 4, 2009
    Messages:
    147
    I see, thanks for the info :)
  10. jake-gr

    jake-gr

    Member

    Joined:
    Oct 27, 2011
    Messages:
    92
    If you use the Blender Importer (sticky in this forum), the scale is actually set to 1 :)
  11. Tiles

    Tiles

    Member

    Joined:
    Feb 5, 2010
    Messages:
    2,205
    Oh nice. I always use the newest Graphicall version of Blender though. Which would mean to reassign the file format connection again and again. That`s why i go the FBX route :)
  12. jgb143

    jgb143

    Member

    Joined:
    Jun 8, 2010
    Messages:
    102
  13. Velvety

    Velvety

    Member

    Joined:
    May 4, 2009
    Messages:
    147
    I have another question. I've unwrapped my mesh in Blender and created uv mapping for a tiled brick wall. I have scaled the image at 2x because I want the bricks to appear at half the size on the mesh. This looks fine in Blender.

    Then I export to FBX and import in Unity. The texture appears, but the scale is back to 1:1 (bricks are twice as big as I want). Is there a way to export the uv map scaling, or do I have to manually edit that in Unity's materials everytime?

    Thanks!
  14. Screenhog

    Screenhog

    Member

    Joined:
    Jul 2, 2009
    Messages:
    483
    Good news... in 3.5, the default import size is changed to 1 instead of 0.01.
  15. Tiles

    Tiles

    Member

    Joined:
    Feb 5, 2010
    Messages:
    2,205
    Yay! Finally :D

    Thanks for the tip jb143 :)
  16. Velvety

    Velvety

    Member

    Joined:
    May 4, 2009
    Messages:
    147
    It looks like the new Unity 3.5 release today might address this problem:

    - Implemented import of texture Tiling and Offset values.

    I'm assuming that fix will mean my important textures in FBX files will have their tiling values set. Still need to test it though...
  17. adaptive

    adaptive

    New Member

    Joined:
    Feb 25, 2013
    Messages:
    6
    Hi, this works to get the "level" part of e.g. Snowbox ServerWorld1,

    but it doesn't work for something like this Humpback Whale from the asset store:

    https://www.assetstore.unity3d.com/#/content/3547

    When I select the whale and do custom->export (any option) the output files are nearly empty.

    Actually, first, the export feature says I have to select an object with a mesh filter. I'm pretty new, and can get confused as to what that entails exactly, but I added, in component->mesh->mesh filter, and also tried adding mesh rendered, and then the export feature does not complain, but, ya, as stated, the output files are nearly empty, and loading them in e.g. 3DS Max, it says "nothing to import".

    Any tips? Thanks!