# Dead code in GLTFMaterialExporter

**URL:** <https://forum.babylonjs.com/t/dead-code-in-gltfmaterialexporter/29511>\
**Category:** Questions\
**Created:** [April 19, 2022, 3:18pm UTC](https://forum.babylonjs.com/t/dead-code-in-gltfmaterialexporter/29511 "2022-04-19T15:18:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Krenodeno](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/krenodeno/32/21016_2.png) [@Krenodeno](https://forum.babylonjs.com/u/Krenodeno)\
**Post date:** [April 19, 2022, 3:18pm UTC](https://forum.babylonjs.com/t/dead-code-in-gltfmaterialexporter/29511/1 "2022-04-19T15:18:07Z")

</div>

Hi,  
The `_convertPBRMetallicRoughnessMaterialAsync` function in `GTLFMaterialExporter` is not used anymore, as it looks like the same behavior has been applied to `PBRMaterial`s and `PBRMetallicRoughnessMaterial`s in the `_convertMaterialsToGLTFAsync` function since the 5.0 release.

Sources:

> **[Babylon.js/packages/dev/serializers/src/glTF/2.0/glTFMaterialExporter.ts at...](https://github.com/BabylonJS/Babylon.js/blame/master/packages/dev/serializers/src/glTF/2.0/glTFMaterialExporter.ts#L133)**
>
> Babylon.js is a powerful, beautiful, simple, and open game and rendering engine packed into a friendly JavaScript framework. - Babylon.js/packages/dev/serializers/src/glTF/2.0/glTFMaterialExporter....

> **[Babylon.js/packages/dev/serializers/src/glTF/2.0/glTFMaterialExporter.ts at...](https://github.com/BabylonJS/Babylon.js/blame/master/packages/dev/serializers/src/glTF/2.0/glTFMaterialExporter.ts#L420)**
>
> Babylon.js is a powerful, beautiful, simple, and open game and rendering engine packed into a friendly JavaScript framework. - Babylon.js/packages/dev/serializers/src/glTF/2.0/glTFMaterialExporter....

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [April 19, 2022, 4:12pm UTC](https://forum.babylonjs.com/t/dead-code-in-gltfmaterialexporter/29511/2 "2022-04-19T16:12:53Z")

</div>

> [@Krenodeno](#):
>
> `_convertPBRMetallicRoughnessMaterialAsync`

I totally agree. Let’s just make sure @bghgary agrees as well and I will drop that function

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [April 19, 2022, 4:48pm UTC](https://forum.babylonjs.com/t/dead-code-in-gltfmaterialexporter/29511/3 "2022-04-19T16:48:03Z")

</div>

Yup, looks dead. How did that happen? 🙂

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [April 19, 2022, 4:53pm UTC](https://forum.babylonjs.com/t/dead-code-in-gltfmaterialexporter/29511/4 "2022-04-19T16:53:50Z")

</div>

It felt between the cracks 🙂  
I’ll remove it

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [April 19, 2022, 4:55pm UTC](https://forum.babylonjs.com/t/dead-code-in-gltfmaterialexporter/29511/5 "2022-04-19T16:55:18Z")

</div>

[Remove dead code by deltakosh · Pull Request #12408 · BabylonJS/Babylon.js (github.com)](https://github.com/BabylonJS/Babylon.js/pull/12408)
