summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-05-30 11:47:34 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-05-30 11:47:34 +0200
commit53bd0d5acfcf9a58fb2e4f1d770f87bbb189f07f (patch)
tree6af905ca6e189d936a2f17d976b343b77f96ff44
parent838eb5a0fdcfa0e0f368a6d33a0f712db90c9719 (diff)
parent398892ccc01cec724c5f4c9cdfd0fb7e746a0fa7 (diff)
downloadredot-engine-53bd0d5acfcf9a58fb2e4f1d770f87bbb189f07f.tar.gz
Merge pull request #90365 from KoBeWi/export_any%_speedrun
Allow skipping imported resource files from export
-rw-r--r--doc/classes/EditorExportPlugin.xml2
-rw-r--r--editor/export/editor_export_platform.cpp12
2 files changed, 13 insertions, 1 deletions
diff --git a/doc/classes/EditorExportPlugin.xml b/doc/classes/EditorExportPlugin.xml
index 436f471e5d..3e2b3ea111 100644
--- a/doc/classes/EditorExportPlugin.xml
+++ b/doc/classes/EditorExportPlugin.xml
@@ -313,7 +313,7 @@
<method name="skip">
<return type="void" />
<description>
- To be called inside [method _export_file]. Skips the current file, so it's not included in the export.
+ To be called inside [method _export_file], [method _customize_resource], or [method _customize_scene]. Skips the current file, so it's not included in the export.
</description>
</method>
</methods>
diff --git a/editor/export/editor_export_platform.cpp b/editor/export/editor_export_platform.cpp
index aa44189782..5a95b553e9 100644
--- a/editor/export/editor_export_platform.cpp
+++ b/editor/export/editor_export_platform.cpp
@@ -797,6 +797,10 @@ String EditorExportPlatform::_export_customize(const String &p_path, LocalVector
if (!customize_scenes_plugins.is_empty()) {
for (Ref<EditorExportPlugin> &plugin : customize_scenes_plugins) {
Node *customized = plugin->_customize_scene(node, p_path);
+ if (plugin->skipped) {
+ plugin->_clear();
+ return String();
+ }
if (customized != nullptr) {
node = customized;
modified = true;
@@ -830,6 +834,10 @@ String EditorExportPlatform::_export_customize(const String &p_path, LocalVector
if (!customize_resources_plugins.is_empty()) {
for (Ref<EditorExportPlugin> &plugin : customize_resources_plugins) {
Ref<Resource> new_res = plugin->_customize_resource(res, p_path);
+ if (plugin->skipped) {
+ plugin->_clear();
+ return String();
+ }
if (new_res.is_valid()) {
modified = true;
if (new_res != res) {
@@ -1135,6 +1143,10 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
// Before doing this, try to see if it can be customized.
String export_path = _export_customize(path, customize_resources_plugins, customize_scenes_plugins, export_cache, export_base_path, false);
+ if (export_path.is_empty()) {
+ // Skipped from plugin.
+ continue;
+ }
if (export_path != path) {
// It was actually customized.