New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
glTF2Exporter includes materials used by excluded meshes. #10009
Comments
Hi @sebavan and @Drigax, I have a local fix to exclude unused materials when exporting a gltf file. But, I am aware another issue in glTFExporter.ts that is regarding to the mesh's sideOrientation. Maybe I can file another issue to follow it up. Per glTFExporter.ts#L1586, I notice due to IIUC, gltf file should be right-handed coordinate system according to its spec. In https://www.babylonjs-playground.com/#YBEKDT#4 demo, we are using left-handed. It supposes to reorder the gltf model's index data while loading, but we didn't. So, I am wondering if we choose counterclockwise frontface instead of clockwise which is supposed to be chosen in left-handed system backface culling. |
The loader compensates for handedness change with a root transform with a negative scale. Loaders need to be as fast as possible, so updating the winding order of indices on load is not an option. |
Thanks a lot Gary I completely missed the ping somehow... @daoshengmu sorry for the delay |
I agree updating the winding order of indices on load is too slow. It looks like we did something wrong with _convertToRightHandedSystemMap that is supposed for a root transform with a negative scale. |
See:
https://forum.babylonjs.com/t/can-gltf-export-a-specific-mesh-from-scene/10641/3
Repro:
https://www.babylonjs-playground.com/#YBEKDT#4
Expected result:
Fan materials and textures should not be included in exported glTF from this playground.
The text was updated successfully, but these errors were encountered: