Skip to content

Commit 398892c

Browse files
committed
Allow skipping imported resource files from export
1 parent e5b4ef8 commit 398892c

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
@@ -791,6 +791,10 @@ String EditorExportPlatform::_export_customize(const String &p_path, LocalVector
791791
if (!customize_scenes_plugins.is_empty()) {
792792
for (Ref<EditorExportPlugin> &plugin : customize_scenes_plugins) {
793793
Node *customized = plugin->_customize_scene(node, p_path);
794+
if (plugin->skipped) {
795+
plugin->_clear();
796+
return String();
797+
}
794798
if (customized != nullptr) {
795799
node = customized;
796800
modified = true;
@@ -824,6 +828,10 @@ String EditorExportPlatform::_export_customize(const String &p_path, LocalVector
824828
if (!customize_resources_plugins.is_empty()) {
825829
for (Ref<EditorExportPlugin> &plugin : customize_resources_plugins) {
826830
Ref<Resource> new_res = plugin->_customize_resource(res, p_path);
831+
if (plugin->skipped) {
832+
plugin->_clear();
833+
return String();
834+
}
827835
if (new_res.is_valid()) {
828836
modified = true;
829837
if (new_res != res) {
@@ -1139,6 +1147,10 @@ Error EditorExportPlatform::export_project_files(bool p_main_pack, const Ref<Edi
11391147
// Before doing this, try to see if it can be customized.
11401148

11411149
String export_path = _export_customize(path, customize_resources_plugins, customize_scenes_plugins, export_cache, export_base_path, false);
1150+
if (export_path.is_empty()) {
1151+
// Skipped from plugin.
1152+
continue;
1153+
}
11421154

11431155
if (export_path != path) {
11441156
// It was actually customized.

0 commit comments

Comments
 (0)