# \[Mesh\] how import meshes and saving file size? (Possible .obj?)

**URL:** <https://forum.babylonjs.com/t/mesh-how-import-meshes-and-saving-file-size-possible-obj/5916>\
**Category:** Questions\
**Tags:** tutorial\
**Created:** [September 27, 2019, 2:14am UTC](https://forum.babylonjs.com/t/mesh-how-import-meshes-and-saving-file-size-possible-obj/5916 "2019-09-27T02:14:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nedcrow](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/nedcrow/32/2663_2.png) [@nedcrow](https://forum.babylonjs.com/u/nedcrow)\
**Post date:** [September 27, 2019, 2:14am UTC](https://forum.babylonjs.com/t/mesh-how-import-meshes-and-saving-file-size-possible-obj/5916/1 "2019-09-27T02:14:08Z")

</div>

Now i’m used ‘SceneLoader.ImportMesh( )’. but ‘.babylon’ file size is bigger than ‘.obj’ file.

How import .obj file?

else,

How export only selected meshes in Blender3D’s scene?

Plz tutorial PG or documents. 🙏

---

<div class="post-metadata">

**Author:** ![DisownedWheat](https://avatars.discourse-cdn.com/v4/letter/d/3be4f8/32.png) [@DisownedWheat](https://forum.babylonjs.com/u/DisownedWheat)\
**Post date:** [September 27, 2019, 3:22am UTC](https://forum.babylonjs.com/t/mesh-how-import-meshes-and-saving-file-size-possible-obj/5916/2 "2019-09-27T03:22:07Z")

</div>

Hi Ned,  
You’ll need to add the `babylonjs-loaders` package and import it.  
See here: [Load from any file type - glTF, OBJ, STL, etc. - Babylon.js Documentation](https://doc.babylonjs.com/how_to/load_from_any_file_type)

Edit: Also consider that your `.babylon` file will be gzipped when being transferred from your server (hopefully) so they can be quite compact.

---

<div class="post-metadata">

**Author:** ![nedcrow](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/nedcrow/32/2663_2.png) [@nedcrow](https://forum.babylonjs.com/u/nedcrow)\
**Post date:** [September 27, 2019, 3:55am UTC](https://forum.babylonjs.com/t/mesh-how-import-meshes-and-saving-file-size-possible-obj/5916/3 "2019-09-27T03:55:49Z")

</div>

First, thank you!

I saw this document.

I’m wrote ‘import { OBJFileLoader } from ‘babylonjs-loaders’;’  
But, i don’t know next.

If example has ‘abc.obj’. and meshes is [‘apple, banana’].  
How import this .obj file?

plz & thank you again. 🙏

---

<div class="post-metadata">

**Author:** ![DisownedWheat](https://avatars.discourse-cdn.com/v4/letter/d/3be4f8/32.png) [@DisownedWheat](https://forum.babylonjs.com/u/DisownedWheat)\
**Post date:** [September 27, 2019, 4:12am UTC](https://forum.babylonjs.com/t/mesh-how-import-meshes-and-saving-file-size-possible-obj/5916/4 "2019-09-27T04:12:42Z")

</div>

No need for the qualified import, just put `import 'babylonjs-loaders'` at the top of your file and then just use the same import you did before, but change the file name from `x.babylon` to `x.obj`.

For instance, this is how I loaded a `.glb` file in a project:

```auto
BABYLON.SceneLoader.ImportMesh('', 'assets/', 'terrain.glb', this.scene, (meshes) => {
			for (let mesh of meshes) {
				mesh.position = new BABYLON.Vector3(0, -10, 0);
				mesh.checkCollisions = true;
				mesh.setEnabled(true);
			}
		});

```

Notice I have the empty mesh names as the first parameter so I’m importing all meshes in this file. If you want the `['apple', 'banana']` meshes specifically then replace the empty string with that array.

Also consider that all the meshes are returned as an array in the first argument in the callback, so you can filter the meshes in there as well.

---

<div class="post-metadata">

**Author:** ![nedcrow](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/nedcrow/32/2663_2.png) [@nedcrow](https://forum.babylonjs.com/u/nedcrow)\
**Post date:** [September 30, 2019, 5:24am UTC](https://forum.babylonjs.com/t/mesh-how-import-meshes-and-saving-file-size-possible-obj/5916/5 "2019-09-30T05:24:17Z")

</div>

Thank you!!  
I’m success import .obj file.  
But need to setting that triangle of meshes, when exporting from blender.  
if not then broken meshes.

I love your answer! 👍
