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

Request for post_gather_gltf_hook #2284

Open
marwie opened this issue Jul 17, 2024 · 0 comments
Open

Request for post_gather_gltf_hook #2284

marwie opened this issue Jul 17, 2024 · 0 comments
Labels

Comments

@marwie
Copy link

marwie commented Jul 17, 2024

Is your feature request related to a problem? Please describe.
I'd like to be able to add extra materials to the exported glTF only if a material was not already exported.
For this I need a hook that runs after all scenes have been exported to be able to call gather_material from my extension.

Calling gather_material earlier during the export process will possibly result in a material being exported multiple times if any other object in the scene is using the material

Describe the solution you'd like
An extra hook (post_gather_gltf_hook) that would run at the end of __gather_gltf after all materials, images, nodes etc have been added

Another option/question: should maybe gather_materials keep track of the blender materials that have been exported before and return the already created gltf_material if it's called again? Is this not also an issue in the KHR_variants extension?

Describe alternatives you've considered

  • I've tried calling gather_material from gather_gltf_extensions_hook but this doesn't add the material to the gltf2_plan object

Additional context
This is for the Needle Engine exporter addon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants