Ability to change a resource UID from API

* Works for text, binary and imported resources
* Allows better clean up of duplicate files.

TODO (future PRs):

* Use this API for assigning new UIDs to copied files.
* Use this API for UID conflict on FS scanning (if more than one file has the same UID, the newer one(s) should get assigned a different UID).
This commit is contained in:
Juan Linietsky
2022-12-05 19:01:59 +01:00
parent 964fc6e15d
commit 07a964fce3
11 changed files with 256 additions and 8 deletions

View File

@ -32,6 +32,7 @@
#define RESOURCE_IMPORTER_H
#include "core/io/resource_loader.h"
#include "core/io/resource_saver.h"
class ResourceImporter;
@ -149,4 +150,11 @@ public:
VARIANT_ENUM_CAST(ResourceImporter::ImportOrder);
class ResourceFormatImporterSaver : public ResourceFormatSaver {
GDCLASS(ResourceFormatImporterSaver, ResourceFormatSaver)
public:
virtual Error set_uid(const String &p_path, ResourceUID::ID p_uid) override;
};
#endif // RESOURCE_IMPORTER_H