# Babylon export problem

**URL:** <https://forum.babylonjs.com/t/babylon-export-problem/30456>\
**Category:** Bugs\
**Created:** [May 17, 2022, 12:35pm UTC](https://forum.babylonjs.com/t/babylon-export-problem/30456 "2022-05-17T12:35:14Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrPeter](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mrpeter/32/22683_2.png) [@MrPeter](https://forum.babylonjs.com/u/MrPeter)\
**Post date:** [May 17, 2022, 12:35pm UTC](https://forum.babylonjs.com/t/babylon-export-problem/30456/1 "2022-05-17T12:35:14Z")

</div>

I have this code for exporting my meshes, but when i import exported .obj file its different.  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/4/d/4dbea3d4e4249d0ff2f667d177e84b4a33923106.png)  
This is what i export.  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/c/b/cb7a592d7c8a72437e125e751299db07ff3ca1d2.png)  
And this is imported in babylon sandbox. I want it is imported next each other not like on picture in sandbox.  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/e/9/e99c263abe3303e830f16c6801c0518a6cce8183.png)

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [May 17, 2022, 12:41pm UTC](https://forum.babylonjs.com/t/babylon-export-problem/30456/2 "2022-05-17T12:41:30Z")

</div>

I’m not an expert (but I do know a little about using obj files in BJS). From the little I can see here, I’d say your script is exporting only the obj files (without the scene transformation). OBJ files will next show without transformation on their axis/pivot (which is likely to be in the center of the object, displaced on the y axis) or is it?

---

<div class="post-metadata">

**Author:** ![MrPeter](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mrpeter/32/22683_2.png) [@MrPeter](https://forum.babylonjs.com/u/MrPeter)\
**Post date:** [May 17, 2022, 1:16pm UTC](https://forum.babylonjs.com/t/babylon-export-problem/30456/3 "2022-05-17T13:16:20Z")

</div>

How can i export full scene with all axis/pivot transformation? I need it really.

---

<div class="post-metadata">

**Author:** ![MrPeter](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mrpeter/32/22683_2.png) [@MrPeter](https://forum.babylonjs.com/u/MrPeter)\
**Post date:** [May 17, 2022, 1:19pm UTC](https://forum.babylonjs.com/t/babylon-export-problem/30456/4 "2022-05-17T13:19:32Z")

</div>

I will be really happy if you help me. I need it into school.

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [May 17, 2022, 1:19pm UTC](https://forum.babylonjs.com/t/babylon-export-problem/30456/5 "2022-05-17T13:19:54Z")

</div>

Yes, well… this is where I am not all too qualified sadly 😰 😉 (Fact is I never do this and never used the sceneViewer).  
I believe @labris will kindly tell you how to achieve this, Will you? Thx in advance,

---

<div class="post-metadata">

**Author:** ![MrPeter](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mrpeter/32/22683_2.png) [@MrPeter](https://forum.babylonjs.com/u/MrPeter)\
**Post date:** [May 17, 2022, 2:01pm UTC](https://forum.babylonjs.com/t/babylon-export-problem/30456/6 "2022-05-17T14:01:46Z")

</div>

Thank you, @labris can you help me?

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [May 17, 2022, 2:01pm UTC](https://forum.babylonjs.com/t/babylon-export-problem/30456/7 "2022-05-17T14:01:46Z")

</div>

To be sincere, I don’t have experience with exporters.  
First of all, I think, we need a Playground example from Peter @MrPeter in order to help in a most effective way.

---

<div class="post-metadata">

**Author:** ![MrPeter](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mrpeter/32/22683_2.png) [@MrPeter](https://forum.babylonjs.com/u/MrPeter)\
**Post date:** [May 17, 2022, 2:02pm UTC](https://forum.babylonjs.com/t/babylon-export-problem/30456/8 "2022-05-17T14:02:45Z")

</div>

Uf What do you exactly need? I have this in Angular + babylonjs and i cant share code.

---

<div class="post-metadata">

**Author:** ![MrPeter](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mrpeter/32/22683_2.png) [@MrPeter](https://forum.babylonjs.com/u/MrPeter)\
**Post date:** [May 17, 2022, 2:03pm UTC](https://forum.babylonjs.com/t/babylon-export-problem/30456/9 "2022-05-17T14:03:14Z")

</div>

Do you know somebody who could help?

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [May 17, 2022, 2:08pm UTC](https://forum.babylonjs.com/t/babylon-export-problem/30456/10 "2022-05-17T14:08:06Z")

</div>

You can try to simplify your problem in PG, otherwise here knows what is the function sceneViewer does.

> [@MrPeter](#):
>
> Do you know somebody who could help?

Sure - [Service offers and requests - Babylon.js](https://forum.babylonjs.com/c/service-offers-and-requests/10)

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [May 17, 2022, 2:26pm UTC](https://forum.babylonjs.com/t/babylon-export-problem/30456/11 "2022-05-17T14:26:35Z")

</div>

Are you sure about this link? I don’t think this is worth a paid job 😉  
In fact, I’m pretty sure the answer has been posted not long ago on this very forum.  
Sry that I did involve you in this. I thought you would know and it would take you just a sec. My apologies.

---

<div class="post-metadata">

**Author:** ![MrPeter](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mrpeter/32/22683_2.png) [@MrPeter](https://forum.babylonjs.com/u/MrPeter)\
**Post date:** [May 17, 2022, 2:33pm UTC](https://forum.babylonjs.com/t/babylon-export-problem/30456/12 "2022-05-17T14:33:06Z")

</div>

sceneViewer is class with a lot of funtionality. For this import and export i have own component. I can add 3D models from database to scene. Then i can thanks gizmo manager change their position. And i want export this scene with the function in begin of this topic.  
this.sceneViewer.getAllMeshes is my function it return all meshes from scene except lines and ground.  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/5/6/5601935378085c095a0ad287aa066c379b2d4dbc.png)  
I tried export whole scene with .glb but it show nothung in sandbox.  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/1/2/12c4e2d9d43eab4a776683c40458739352d1097a.png)  
You can try this .obj in sandbox. Should i send you same .glb file?  
[objFILE.zip](https://forum.babylonjs.com/uploads/short-url/xgosp7wMWjesZMMxfMPTYc6Sd1D.zip) (6.7 MB)

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [May 17, 2022, 2:39pm UTC](https://forum.babylonjs.com/t/babylon-export-problem/30456/13 "2022-05-17T14:39:01Z")

</div>

Well, incidentally I’ve now seen some of your other posts all about the same thing and in truth, it seems like none of us really understands the processing. I know you stated it is ‘secret’ but it will be hard to help without this understanding. Why would you re-import an exported obj from bjs in bjs? Obviously exporting your object to GLTF will do the same as exporting the OBJ == it will export the object, NOT the object transformation in BJS (BJS is simply not made for this). If you export the BJS scene to import elsewhere say in a mediaplayer, that makes sense but it seems like this is not what you want. I guess we are all a little bit lost here. Not as if we were not willing to help (if we can)…

---

<div class="post-metadata">

**Author:** ![MrPeter](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mrpeter/32/22683_2.png) [@MrPeter](https://forum.babylonjs.com/u/MrPeter)\
**Post date:** [May 17, 2022, 2:48pm UTC](https://forum.babylonjs.com/t/babylon-export-problem/30456/14 "2022-05-17T14:48:20Z")

</div>

I know its hard help me without more info but i dont know what to say more :D. Idk how simplify it in pg bcs i taking 3D models from database. I want make user can export scene, save it in the file and when he need it he can import this file into scene. Just say me what you need to see i can send it. Now i am exporting 3 bones and this is console log('Exporting ’ + this.sceneViewer.getAllMeshes()):

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/b/8/b8f51c8ff07413c3db04748f153017f91a2f6ba0.png)

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [May 17, 2022, 2:51pm UTC](https://forum.babylonjs.com/t/babylon-export-problem/30456/15 "2022-05-17T14:51:23Z")

</div>

Are there any reasons to use OBJ format?

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [May 17, 2022, 2:53pm UTC](https://forum.babylonjs.com/t/babylon-export-problem/30456/16 "2022-05-17T14:53:59Z")

</div>

> [@MrPeter](#):
>
> i taking 3D models from database

So, should I understand that you cannot edit the original file. You have files (any files, obj, gltf) in a library and you import them in BJS, correct?

> [@MrPeter](#):
>
> I want make user can export scene

OK, but so far you are only exporting objects (not the scene). Exporting to a BJS scene is easy.

> [@MrPeter](#):
>
> he can import this file into scene

Should I understand import the BJS exported scene in another BJS scene. Again, that would be easy.

Again, I have no XP with sceneViewer but I know that all the above could be achieved (fairly easily).  
If this is what you want, state it. Else, give us more details pls,

---

<div class="post-metadata">

**Author:** ![MrPeter](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mrpeter/32/22683_2.png) [@MrPeter](https://forum.babylonjs.com/u/MrPeter)\
**Post date:** [May 17, 2022, 2:57pm UTC](https://forum.babylonjs.com/t/babylon-export-problem/30456/17 "2022-05-17T14:57:51Z")

</div>

No there is not, i tried use GLTF2 but when i imported that .glb file into sandbox there is just this.  
Exported model as glb  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/5/b/5bc32794977c93469efd800178b9ac4b839522d7.png)  
This is in sandbox…

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/7/7/772ff478f526d5e4de4bc0377e7e3638068e772f.png)

> GLTF2Export.GLBAsync(this.scene, filename).then((glb) =\> {  
> glb.downloadFiles();  
> });

---

<div class="post-metadata">

**Author:** ![MrPeter](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mrpeter/32/22683_2.png) [@MrPeter](https://forum.babylonjs.com/u/MrPeter)\
**Post date:** [May 17, 2022, 2:58pm UTC](https://forum.babylonjs.com/t/babylon-export-problem/30456/18 "2022-05-17T14:58:22Z")

</div>

Yes i want export scene with all positions and later import this exported scene into scene.

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [May 17, 2022, 3:01pm UTC](https://forum.babylonjs.com/t/babylon-export-problem/30456/19 "2022-05-17T15:01:06Z")

</div>

Yes, well. But then you should have stated this long ago, because as per the above script you are exporting only GLTF (the object), not the scene.

Edit: this might help for SAVING your BJS scene (in BJS format) for later import in another BJS SCENE:

> **[Save Your Scene or Meshes | Babylon.js Documentation](https://doc.babylonjs.com/extensions/Exporters/Save_Babylon)**
>
> Using the scene serializer

---

<div class="post-metadata">

**Author:** ![MrPeter](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mrpeter/32/22683_2.png) [@MrPeter](https://forum.babylonjs.com/u/MrPeter)\
**Post date:** [May 17, 2022, 3:04pm UTC](https://forum.babylonjs.com/t/babylon-export-problem/30456/20 "2022-05-17T15:04:05Z")

</div>

Do you know how to help me? This is my console.log idk how to get object Object 😃  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/1/2/127556d1a4023055603a16dd8aa22841f0fef8c2.png)

[Next page](https://forum.babylonjs.com/t/babylon-export-problem/30456.md?page=2)
