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
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 materialDescribe 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 addedAnother 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
gather_material
fromgather_gltf_extensions_hook
but this doesn't add the material to the gltf2_plan objectAdditional context This is for the Needle Engine exporter addon