glTF Serializer has different results in the PG and the Codesandbox!

Hi, babylonjs forum.

I use the same code, and different results between the PG and the CodeSandbox(Or the local environment)

1. Here is the PG: KHR_materials_sheen exported

2. Here is the CodeSandBox: KHR_materials_sheen not exported


https://codesandbox.io/p/sandbox/4dstxc

cc Jedi @alexchuber

Will take a look today :slight_smile:

2 Likes

You’re very right, but I can’t place what the difference could be between the codepen and the Babylon playground. I did adjust the codepen a bit to rule out any canvas or scene timing issues, which neither seemed to be the case.

cc @RaananW At a glance, do you spot anything in the codepen that looks suspicious?
(and @JoeyKo, just to be sure: what babylon dependencies are listed in your local package.json? Are they the exact same as the one in the codepen?)

Thanks for your patience!

@alexchuber Here is the list in my dependencies in my local package.json:


截屏2025-03-01 15.23.21

My previous babylonjs version was 7.37.0, and everything was working fine.

I mentioned an issue before, and it was fine on the PG, but I’m actually having this problem locally.

Will need to debug this locally. It must be some form of init or side effects missed here, but i can’t find anything without a good debugging session :slight_smile:

I’ll try to recreate that later today or tomorrow.

2 Likes

Totally missed this one - the extensions are loaded async and are not included in the main index file, and you need to import them yourself.

Adding this right after the GLTF2Export import will solve it for all extensions:

import "@babylonjs/serializers/glTF/2.0/Extensions";

2 Likes

Ahh, makes sense. Looks like it should be exported by the serializer package. This should do it:

4 Likes