- Home /
Importing multiple blender objects from one .blend file
I'm just getting started with Unity3D, but I've been using Blender for a long time. Unity natively imports Blender files very well, but I can't seem to use specific objects in my hierarchy. In Blender, I make a lot of separate objects in one file, which I find to be a much more convenient workflow. Am I better off keeping each model in its own separate *.blend file, or is there a way to specify particular components or sub-objects when adding the assets to my hierarchy in Unity?
The separate objects in blender should be the same separate objects in Unity. I've been using both for a while and have never had a problem. Could you post some images or an example of this not being the case?
Answer by Nanity · Aug 14, 2013 at 11:35 AM
For everyone who wants an answer to this (incl myself): You better keep them as seperate blend files. This article gives a good briefing to blender in unity and covers this topic:
The article is very old and I'm not sure it still applies to current version of Blender and Unity.
Answer by Guillaumzed · Oct 25, 2016 at 08:48 AM
Hi, This thread is 3 years old, but It's still very boring to make 150 .blend files when you could have just one with your 150 meshes.
Is there still no way to access by script a specific mesh from a .blend file that contains multiple meshes ?
Hi, yes, this is a way I found to deal with this :
//using UnityEditor;
GameObject gameObjContainingTheSingle$$anonymous$$eshInYourBlendFile = GameObject.Find ("nameOfGameObjectSingle$$anonymous$$eshFromBlendFile_WhichIsPresentOnYourScene");
$$anonymous$$esh $$anonymous$$eshYouWishToExtract = gameObjContainingSingle$$anonymous$$esh .GetComponent<$$anonymous$$eshFilter> ().mesh;
AssetDatabase.CreateAsset ($$anonymous$$eshYouWishToExtract , "Assets/Resources/meshes/New$$anonymous$$esh" + nameOfGameObjectSingle$$anonymous$$eshFromBlendFile_OnYourScene+ ".asset");
You do that once by playing it in the editor, then you'll have all your meshes separated in Unity and you'll be able to delete your .blend file. The only repetitive problem here is na$$anonymous$$g your 150 meshes.
Answer by Jeffuk · Jan 06, 2019 at 01:36 AM
Another option is to use the built-in FBX exporter in Blender, which gives you more fine-grained control of how objects are exported. Specifically the Batch mode, in which you can select either 'Scene' or 'Group.' This will create one FBX file for each Scene or Group.
You can easily select each object that you want to make into a prefab, hit Ctrl+G, then export using the Batch->Group option.
This creates one FBX file per group, and usefully for me only exports objects that are assigned to a group, so things I use as scaffolding (meshes that get extruded along Paths for instances) are not included.
Sorry to necro, but this is still top result for this question; new information because Blender 2.79b (maybe 2.79 onwards) fixes the Batch by Group mode in the FBX exporter. It was unstable in 2.78.
Would be neat to have an 'import by group' option in Unity though!