summaryrefslogtreecommitdiff
path: root/core/io/resource_importer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/io/resource_importer.cpp')
-rw-r--r--core/io/resource_importer.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/io/resource_importer.cpp b/core/io/resource_importer.cpp
index f612b84404..6819511eb9 100644
--- a/core/io/resource_importer.cpp
+++ b/core/io/resource_importer.cpp
@@ -93,6 +93,8 @@ Error ResourceFormatImporter::_get_path_and_type(const String &p_path, PathAndTy
r_path_and_type.type = ClassDB::get_compatibility_remapped_class(value);
} else if (assign == "importer") {
r_path_and_type.importer = value;
+ } else if (assign == "uid") {
+ r_path_and_type.uid = ResourceUID::get_singleton()->text_to_id(value);
} else if (assign == "group_file") {
r_path_and_type.group_file = value;
} else if (assign == "metadata") {
@@ -336,6 +338,17 @@ String ResourceFormatImporter::get_resource_type(const String &p_path) const {
return pat.type;
}
+ResourceUID::ID ResourceFormatImporter::get_resource_uid(const String &p_path) const {
+ PathAndType pat;
+ Error err = _get_path_and_type(p_path, pat);
+
+ if (err != OK) {
+ return ResourceUID::INVALID_ID;
+ }
+
+ return pat.uid;
+}
+
Variant ResourceFormatImporter::get_resource_metadata(const String &p_path) const {
PathAndType pat;
Error err = _get_path_and_type(p_path, pat);