A project with various procedural and generated resources that are customized or baked during the export process.
Describe the problem or limitation you are having in your project
I want features like the shader baker or the GDScript binary tokenizer to process my customized resources when I export the project.
The issue is that EditorExportPlugin._customize_resource() only works once. If I customize materials using an EditorExportPlugin, for example, these materials are not included in the shader baker processing, which is another EditorExportPlugin.
Addons like https://github.com/dalexeev/gdscript-preprocessor process GDScript when exporting, but since the script binary tokenizer is an export plugin too, it can't be processed again, so the output is limited to always being in text format.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Some options:
Allow customized resources to keep being customized in the plugin execution chain.
add _pre_customize_resource/scene() to EditorExportPlugin
Make export plugins like the shader baker and script tokenizer a different category that runs after the others.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Each plugin could run for all resources in sequence instead. A method add_resource/scene() to add to the next process will help with cases like a material cache resource that creates and holds material variations.
for (Ref<EditorExportPlugin> &plugin : customize_resources_plugins) {
for (Ref<Resource> &res : resource_array) {
plugin->_customize_resource(res, "");
}
// List of new resources created by calling add_resource()
resource_array.append(plugin->get_new_resources());
}
If this enhancement will not be used often, can it be worked around with a few lines of script?
No.
Is there a reason why this should be core and not an add-on in the asset library?
Can't change the internal exporting process with an addon.
Describe the project you are working on
A project with various procedural and generated resources that are customized or baked during the export process.
Describe the problem or limitation you are having in your project
I want features like the shader baker or the GDScript binary tokenizer to process my customized resources when I export the project. The issue is that
EditorExportPlugin._customize_resource()
only works once. If I customize materials using anEditorExportPlugin
, for example, these materials are not included in the shader baker processing, which is anotherEditorExportPlugin
.More use case examples:
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Some options:
_pre_customize_resource/scene()
toEditorExportPlugin
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Currently, the processing loop breaks when a resource is modified once. https://github.com/godotengine/godot/blob/51b0379e5502402d44818a4b6f301f544a5754f3/editor/export/editor_export_platform.cpp#L745-L755
Each plugin could run for all resources in sequence instead. A method
add_resource/scene()
to add to the next process will help with cases like a material cache resource that creates and holds material variations.If this enhancement will not be used often, can it be worked around with a few lines of script?
No.
Is there a reason why this should be core and not an add-on in the asset library?
Can't change the internal exporting process with an addon.