Skip to content

Commit 53bd0d5

Browse files
committed
Merge pull request godotengine#90365 from KoBeWi/export_any%_speedrun
Allow skipping imported resource files from export
2 parents 838eb5a + 398892c commit 53bd0d5

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

doc/classes/EditorExportPlugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@
313313
<method name="skip">
314314
<return type="void" />
315315
<description>
316-
To be called inside [method _export_file]. Skips the current file, so it's not included in the export.
316+
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.
317317
</description>
318318
</method>
319319
</methods>

editor/export/editor_export_platform.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,10 @@ String EditorExportPlatform::_export_customize(const String &p_path, LocalVector
797797
if (!customize_scenes_plugins.is_empty()) {
798798
for (Ref<EditorExportPlugin> &plugin : customize_scenes_plugins) {
799799
Node *customized = plugin->_customize_scene(node, p_path);
800+
if (plugin->skipped) {
801+
plugin->_clear();
802+
return String();
803+
}
800804
if (customized != nullptr) {
801805
node = customized;
802806
modified = true;
@@ -830,6 +834,10 @@ String EditorExportPlatform::_export_customize(const String &p_path, LocalVector
830834
if (!customize_resources_plugins.is_empty()) {
831835
for (Ref<EditorExportPlugin> &plugin : customize_resources_plugins) {
832836
Ref<Resource> new_res = plugin->_customize_resource(res, p_path);
837+
if (plugin->skipped) {
838+
plugin->_clear();
839+
return String();
840+
}
833841
if (new_res.is_valid()) {
834842
modified = true;
835843
if (new_res != res) {
@@ -1135,6 +1143,10 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
11351143
// Before doing this, try to see if it can be customized.
11361144

11371145
String export_path = _export_customize(path, customize_resources_plugins, customize_scenes_plugins, export_cache, export_base_path, false);
1146+
if (export_path.is_empty()) {
1147+
// Skipped from plugin.
1148+
continue;
1149+
}
11381150

11391151
if (export_path != path) {
11401152
// It was actually customized.

0 commit comments

Comments
 (0)