Skip to content
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

Avoid Redundant Mesh Exports for Multiple Geometry Modifiers #2446

Open
PMZeroSkyline opened this issue Dec 18, 2024 · 1 comment
Open

Avoid Redundant Mesh Exports for Multiple Geometry Modifiers #2446

PMZeroSkyline opened this issue Dec 18, 2024 · 1 comment
Labels
question Further information is requested

Comments

@PMZeroSkyline
Copy link

Summary: When exporting to GLTF 2.0 format, if multiple geometry node modifiers reference the same mesh through properties, the current exporter generates multiple copies of the same mesh, one for each modifier. This results in redundant meshes being included in the exported GLTF file. The requested feature is to optimize the export process so that the referenced mesh is only exported once, and subsequent references in different geometry node modifiers simply point to the original mesh.

Detailed Description: In scenarios where a single mesh is referenced multiple times through different geometry node modifiers (e.g., in a procedural setup or instances), the current exporter exports multiple identical copies of the same mesh for each reference. This redundancy can lead to larger file sizes and unnecessary duplication in the GLTF output.

It would be more efficient if the exporter could recognize when multiple geometry node modifiers refer to the same mesh (via properties), and instead of exporting the mesh multiple times, it would export it once and reference it in the node hierarchy. This would reduce the size of the exported GLTF file and improve the performance when loading the model in a 3D viewer or engine.

Expected Behavior:

If a mesh is referenced by multiple geometry node modifiers (via property references), the exporter should export the mesh once.
In the GLTF file, the mesh should be defined only once, and each reference to it (from different geometry node modifiers) should point to the original mesh.
The exporter should handle this optimization automatically without requiring manual adjustments from the user.

Benefits:

Smaller GLTF file sizes.
Faster export times due to reduced duplication.
Better memory management when the GLTF file is loaded into a 3D engine or viewer.

Example Scenario:

Mesh Mesh_A is referenced by geometry modifier 1 and geometry modifier 2 through a property link.
Current exporter generates two separate copies of Mesh_A in the GLTF file.
With the requested feature, the exporter would only include Mesh_A once, and both geometry modifiers would reference the same mesh.

Additional Notes:

This feature would be especially helpful for complex procedural node setups or instances that reuse the same geometry multiple times.
The GLTF format already supports referencing objects such as meshes via their ID or URI, so this optimization should be straightforward to implement.
@julienduroure
Copy link
Collaborator

Hello,
Please provide an example of .blend file, with your export settings saved inside the file.

Note that exporting Geometry Node instances is experimental. The GN node datamodel is far from being compatible with glTF Specification, so we will not be able to fully support all Blender features

@julienduroure julienduroure added the question Further information is requested label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants