-
Notifications
You must be signed in to change notification settings - Fork 327
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
Comments
Hello, 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 |
Hello, thanks for your reply Describe To Reproduce .blend file/ .gltf (mandatory) Version |
Modified the example a bit to make some of the mentioned issues clearer, exported .gltf should have 3 suzanne mesh entries/copies in this case (2 from the geonode instancers and 1 for the instanced object). exporting_geometry_node_instances.zip Is this being actively worked on or is it possible to see if I can solve it? And/or are there any known complications? |
Hello, |
Yes, was trying to identify what the issue was and it seems like the ´datablock´ entry for the instanced is a copy with it's own
Yes, I don't think they are a general priority as of now. I'm trying to see if there is a way to provide decent support for exporting GN generated geometry though. Gltf export seems to be one of the better/simpler options for it so I'll continue look into it and see if can improve the current behavior. |
Sure, any help (code, analysis, test cases, investigation etc...) are always welcome! |
Created a PR with a possible fix to the issue. Important note is that the 'as instance' option must be set in ObjectInfo node (see image). Otherwise the GN instances will be of a copy of the original object and will break the relationship (there are many other ways to copy the data in GN but this one is perhaps not as obvious as other ways). This was unset in the testfiles in the thread so they still wont export correctly even with the fix! |
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:
Benefits:
Example Scenario:
Additional Notes:
The text was updated successfully, but these errors were encountered: