From 398892ccc01cec724c5f4c9cdfd0fb7e746a0fa7 Mon Sep 17 00:00:00 2001 From: kobewi Date: Sun, 7 Apr 2024 23:28:52 +0200 Subject: [PATCH] Allow skipping imported resource files from export --- doc/classes/EditorExportPlugin.xml | 2 +- editor/export/editor_export_platform.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/classes/EditorExportPlugin.xml b/doc/classes/EditorExportPlugin.xml index 436f471e5d3..3e2b3ea1118 100644 --- a/doc/classes/EditorExportPlugin.xml +++ b/doc/classes/EditorExportPlugin.xml @@ -313,7 +313,7 @@ - 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. diff --git a/editor/export/editor_export_platform.cpp b/editor/export/editor_export_platform.cpp index d2a187bcfd5..509bb707823 100644 --- a/editor/export/editor_export_platform.cpp +++ b/editor/export/editor_export_platform.cpp @@ -791,6 +791,10 @@ String EditorExportPlatform::_export_customize(const String &p_path, LocalVector if (!customize_scenes_plugins.is_empty()) { for (Ref &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; @@ -824,6 +828,10 @@ String EditorExportPlatform::_export_customize(const String &p_path, LocalVector if (!customize_resources_plugins.is_empty()) { for (Ref &plugin : customize_resources_plugins) { Ref 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) { @@ -1139,6 +1147,10 @@ Error EditorExportPlatform::export_project_files(bool p_main_pack, const Ref