# Export custom properties in glb metadata

**URL:** <https://forum.babylonjs.com/t/export-custom-properties-in-glb-metadata/49382>\
**Category:** Questions\
**Created:** [April 5, 2024, 2:48pm UTC](https://forum.babylonjs.com/t/export-custom-properties-in-glb-metadata/49382 "2024-04-05T14:48:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZGltYQ](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/zgltyq/32/39493_2.png) [@ZGltYQ](https://forum.babylonjs.com/u/ZGltYQ)\
**Post date:** [April 5, 2024, 2:48pm UTC](https://forum.babylonjs.com/t/export-custom-properties-in-glb-metadata/49382/1 "2024-04-05T14:48:56Z")

</div>

Hi, is there a way to add custom property to glb model in blender and import it to babylonjs ?  
Example: I want to be able to specify objects that will have shadows, would be nice to add property `withShadow: true` in blender and import object with this property to babylonjs

---

<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:** [April 5, 2024, 3:04pm UTC](https://forum.babylonjs.com/t/export-custom-properties-in-glb-metadata/49382/2 "2024-04-05T15:04:39Z")

</div>

Click mesh, then use Custom Properties tab in Blender.

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/0/c/0ca3b02202faf76611dd8dca1c68e5a3cfcbf57c.jpeg)

When exporting GLB make sure you check Custom Properties checkbox.

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/7/f/7f9a447a299fce4be490fc7ca5ca6ff549aa31b6.jpeg)

---

<div class="post-metadata">

**Author:** ![ZGltYQ](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/zgltyq/32/39493_2.png) [@ZGltYQ](https://forum.babylonjs.com/u/ZGltYQ)\
**Post date:** [April 5, 2024, 3:12pm UTC](https://forum.babylonjs.com/t/export-custom-properties-in-glb-metadata/49382/3 "2024-04-05T15:12:41Z")

</div>

Thank you as always 😀 !

---

<div class="post-metadata">

**Author:** ![ZGltYQ](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/zgltyq/32/39493_2.png) [@ZGltYQ](https://forum.babylonjs.com/u/ZGltYQ)\
**Post date:** [April 6, 2024, 3:42pm UTC](https://forum.babylonjs.com/t/export-custom-properties-in-glb-metadata/49382/4 "2024-04-06T15:42:55Z")

</div>

Faced with issue when some meshes doesn’t load extra properties, properties are definitely there because when imported into blender they are saved.

GLB example:  
[frame.zip](https://forum.babylonjs.com/uploads/short-url/2Rn0YO4BbPPFq7x7yTFquizJKXP.zip) (5.6 MB)

---

<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:** [April 6, 2024, 4:18pm UTC](https://forum.babylonjs.com/t/export-custom-properties-in-glb-metadata/49382/5 "2024-04-06T16:18:52Z")

</div>

I believe this is because of how the model is done in Blender.  
It has 1 mesh and 2 materials there.  
In GLB it has the Transform node with your extras and 2 mesh primitives without any extras.  
You may try to make separate 2 meshes in Blender and assign the relevant material and extras to those meshes.

---

<div class="post-metadata">

**Author:** ![ZGltYQ](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/zgltyq/32/39493_2.png) [@ZGltYQ](https://forum.babylonjs.com/u/ZGltYQ)\
**Post date:** [April 6, 2024, 5:29pm UTC](https://forum.babylonjs.com/t/export-custom-properties-in-glb-metadata/49382/6 "2024-04-06T17:29:47Z")

</div>

Yes, you are right, merged meshes lose properties

---

<div class="post-metadata">

**Author:** ![metabast](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/metabast/32/43926_2.png) [@metabast](https://forum.babylonjs.com/u/metabast)\
**Post date:** [November 26, 2024, 1:07pm UTC](https://forum.babylonjs.com/t/export-custom-properties-in-glb-metadata/49382/7 "2024-11-26T13:07:05Z")

</div>

Hello everyone, do you have a working code for import glb with custom properties please ?

---

<div class="post-metadata">

**Author:** ![HiGreg](https://avatars.discourse-cdn.com/v4/letter/h/c5a1d2/32.png) [@HiGreg](https://forum.babylonjs.com/u/HiGreg)\
**Post date:** [November 26, 2024, 2:21pm UTC](https://forum.babylonjs.com/t/export-custom-properties-in-glb-metadata/49382/8 "2024-11-26T14:21:33Z")

</div>

Did you try the techniques outlined in this thread?

---

<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:** [November 26, 2024, 2:37pm UTC](https://forum.babylonjs.com/t/export-custom-properties-in-glb-metadata/49382/9 "2024-11-26T14:37:19Z")

</div>

Hello and welcome!

> [@metabast](#):
>
> do you have a working code for import glb with custom properties

> [@How to Access extras Property of Loaded GLTF](https://forum.babylonjs.com/t/how-to-access-extras-property-of-loaded-gltf/22139/4):
>
> 2 ways to do it:
> 
> [https://playground.babylonjs.com/#10D6YT#398](https://playground.babylonjs.com/#10D6YT#398)
> 
> or you can directly access extras of meshes and so on via `mesh.metadata.gltf.extras` for instance

Example of GetExtrasAsMetadata class - [https://playground.babylonjs.com/#IZBAT2#0](https://playground.babylonjs.com/#IZBAT2#0)

---

<div class="post-metadata">

**Author:** ![metabast](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/metabast/32/43926_2.png) [@metabast](https://forum.babylonjs.com/u/metabast)\
**Post date:** [November 27, 2024, 9:07am UTC](https://forum.babylonjs.com/t/export-custom-properties-in-glb-metadata/49382/10 "2024-11-27T09:07:08Z")

</div>

Hello, thank you for your answers. Finally I tripped over the carpet. I was not loading the right object and indeed the metadata is present in my mesh without using “plugin.onParsedObservable”.  
Very good day to you.
