A singleton that manages the unique identifiers of all resources within a project.
Resource UIDs (Unique IDentifiers) allow the engine to keep references between resources intact, even if files are renamed or moved. They can be accessed with uid://.
ResourceUID keeps track of all registered resource UIDs in a project, generates new UIDs, and converts between their string and integer representations.
Like create_id(), but the UID is seeded with the provided path and project name. UIDs generated for that path will be always the same within the current project.
Returns a path, converting path_or_uid if necessary. Fails and returns an empty string if an invalid UID is provided.
Returns the path that the given UID value refers to.
Fails with an error if the UID does not exist, so be sure to check has_id() beforehand.
Converts the provided resource path to a UID. Returns the unchanged path if it has no associated UID.
Removes a loaded UID value from the cache.
Fails with an error if the UID does not exist, so be sure to check has_id() beforehand.