diff --git a/doc/classes/EditorImportPlugin.xml b/doc/classes/EditorImportPlugin.xml
index 28614b6631..c552139236 100644
--- a/doc/classes/EditorImportPlugin.xml
+++ b/doc/classes/EditorImportPlugin.xml
@@ -127,6 +127,12 @@
If this method is not overridden, it will return [code]true[/code] by default (i.e., safe for parallel importing).
+
+
+
+ Gets the format version of this importer. Increment this version when making incompatible changes to the format of the imported resources.
+
+
diff --git a/editor/import/editor_import_plugin.cpp b/editor/import/editor_import_plugin.cpp
index 3243dcf256..8ed9345691 100644
--- a/editor/import/editor_import_plugin.cpp
+++ b/editor/import/editor_import_plugin.cpp
@@ -112,6 +112,14 @@ int EditorImportPlugin::get_import_order() const {
ERR_FAIL_V_MSG(-1, "Unimplemented _get_import_order in add-on.");
}
+int EditorImportPlugin::get_format_version() const {
+ int ret = 0;
+ if (GDVIRTUAL_CALL(_get_format_version, ret)) {
+ return ret;
+ }
+ return 0;
+}
+
void EditorImportPlugin::get_import_options(const String &p_path, List *r_options, int p_preset) const {
Array needed;
needed.push_back("name");
@@ -220,6 +228,7 @@ void EditorImportPlugin::_bind_methods() {
GDVIRTUAL_BIND(_get_resource_type)
GDVIRTUAL_BIND(_get_priority)
GDVIRTUAL_BIND(_get_import_order)
+ GDVIRTUAL_BIND(_get_format_version)
GDVIRTUAL_BIND(_get_option_visibility, "path", "option_name", "options")
GDVIRTUAL_BIND(_import, "source_file", "save_path", "options", "platform_variants", "gen_files");
GDVIRTUAL_BIND(_can_import_threaded);
diff --git a/editor/import/editor_import_plugin.h b/editor/import/editor_import_plugin.h
index ea5cfc2682..1f88bb2fd7 100644
--- a/editor/import/editor_import_plugin.h
+++ b/editor/import/editor_import_plugin.h
@@ -50,6 +50,7 @@ protected:
GDVIRTUAL0RC(String, _get_resource_type)
GDVIRTUAL0RC(float, _get_priority)
GDVIRTUAL0RC(int, _get_import_order)
+ GDVIRTUAL0RC(int, _get_format_version)
GDVIRTUAL3RC(bool, _get_option_visibility, String, StringName, Dictionary)
GDVIRTUAL5RC(Error, _import, String, String, Dictionary, TypedArray, TypedArray)
GDVIRTUAL0RC(bool, _can_import_threaded)
@@ -67,6 +68,7 @@ public:
virtual String get_resource_type() const override;
virtual float get_priority() const override;
virtual int get_import_order() const override;
+ virtual int get_format_version() const override;
virtual void get_import_options(const String &p_path, List *r_options, int p_preset) const override;
virtual bool get_option_visibility(const String &p_path, const String &p_option, const HashMap &p_options) const override;
virtual Error import(const String &p_source_file, const String &p_save_path, const HashMap &p_options, List *r_platform_variants, List *r_gen_files, Variant *r_metadata = nullptr) override;