Open
Description
Your Godot version:
4.4 latest
Issue description:
The document states that RID doesn't support serialization, but in fact RID can be serialized and deserialized (as int64) using var_to_bytes
and bytes_to_var
, even if the corresponding resource can't be serialized and may not be valid. For example var_to_bytes(rid_from_int64(13))
returns [23,0,0,0,13,0,0,0,0,0,0,0]
deserialize:
https://github.com/godotengine/godot/blob/36d90c73a843afa2807a0b8dcbfbf52bdb8a759c/core/io/marshalls.cpp#L689-L697
URL to the documentation page:
https://docs.godotengine.org/en/latest/tutorials/io/binary_serialization_api.html#rid-unsupported