Inheritance #
- AudioServer
- CameraServer
- ClassDB
- DisplayServer
- EditorFileSystemDirectory
- EditorInterface
- EditorPaths
- EditorSelection
- EditorUndoRedoManager
- EditorVCSInterface
- Engine
- EngineDebugger
- FramebufferCacheRD
- GDExtensionManager
- Geometry2D
- Geometry3D
- IP
- Input
- InputMap
- JNISingleton
- JSONRPC
- JavaClassWrapper
- JavaScriptBridge
- MainLoop (1)
- Marshalls
- MovieWriter
- NativeMenu
- NavigationMeshGenerator
- NavigationServer2D
- NavigationServer3D
- Node (21)
- OS
- OpenXRExtensionWrapperExtension
- OpenXRInteractionProfileMetadata
- Performance
- PhysicsDirectBodyState2D (1)
- PhysicsDirectBodyState3D (1)
- PhysicsDirectSpaceState2D (1)
- PhysicsDirectSpaceState3D (1)
- PhysicsServer2D (1)
- PhysicsServer2DManager
- PhysicsServer3D (1)
- PhysicsServer3DManager
- PhysicsServer3DRendering
ServerHandler
- ProjectSettings
- RefCounted (121)
- RenderData (2)
- RenderSceneData (2)
- RenderingDevice
- RenderingServer
- ResourceLoader
- ResourceSaver
- ResourceUID
- ScriptLanguage (1)
- ShaderIncludeDB
- TextServerManager
- ThemeDB
- TileData
- Time
- TranslationServer
- TreeItem
- UndoRedo
- UniformSetCacheRD
- WorkerThreadPool
- XRServer
- XRVRS
Table of contents
-
func add_id(path: String) -> void -
func create_id() -> int -
const func get_id_path(id: int) -> String -
const func has_id(id: int) -> bool -
const func id_to_text(id: int) -> String -
func remove_id(id: int) -> void -
func set_id(path: String) -> void -
const func text_to_id(text_id: String) -> int -
const INVALID_ID = -1
ResourceUID #
resource, core, not_builtin_classes, singleton
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.
Members #
Methods #
func add_id(path: String) -> void#
Adds a new UID value which is mapped to the given resource path.
Fails with an error if the UID already exists, so be sure to check has_id beforehand, or use set_id instead.
func create_id() -> int#
Generates a random resource UID which is guaranteed to be unique within the list of currently loaded UIDs.
In order for this UID to be registered, you must call add_id or set_id.
const func get_id_path(id: int) -> String#
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.
const func has_id(id: int) -> bool#
Returns whether the given UID value is known to the cache.
const func id_to_text(id: int) -> String#
Converts the given UID to a uid:// string value.
func remove_id(id: int) -> void#
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.
func set_id(path: String) -> void#
Updates the resource path of an existing UID.
Fails with an error if the UID does not exist, so be sure to check has_id beforehand, or use add_id instead.
const func text_to_id(text_id: String) -> int#
Extracts the UID value from the given uid:// string.
Annotations #
Constants #
const INVALID_ID = -1#
The value to use for an invalid UID, for example if the resource could not be loaded.
Its text representation is uid://.
Constructors #
Enums #
Notifications#
enum {
INVALID_ID = -1,
}