Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <b.mont29@gmail.com>2020-03-05 18:17:14 +0300
committerBastien Montagne <b.mont29@gmail.com>2020-03-05 18:30:12 +0300
commitc43725e1891bd8534ac4b668277cddae9762d524 (patch)
tree59e26be9adb639b82305ce0f6f4dc36490052f06 /source/blender/blenkernel/BKE_lib_id.h
parent88db9a17ce70c4553be1922e3ecef091e8c1d039 (diff)
Add an session-wise uuid integer to IDs.
"session-wise" here mean while editing a same .blend file. So creating or opening a new one will reset the uuid counter. This should avoid any overflow in practice. Only IDs added to Main database get an uuid, runtime-only ones are not affected. This is intended to provide undo with a way to find IDs across several 'memory realms' (undo speedup project). No behavior change is expected from this commit itself. Part of T60695. Differential Revision: https://developer.blender.org/D7007
Diffstat (limited to 'source/blender/blenkernel/BKE_lib_id.h')
-rw-r--r--source/blender/blenkernel/BKE_lib_id.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_lib_id.h b/source/blender/blenkernel/BKE_lib_id.h
index cb86d54009b..27dd1e637f3 100644
--- a/source/blender/blenkernel/BKE_lib_id.h
+++ b/source/blender/blenkernel/BKE_lib_id.h
@@ -67,6 +67,14 @@ void *BKE_libblock_alloc(struct Main *bmain, short type, const char *name, const
ATTR_WARN_UNUSED_RESULT;
void BKE_libblock_init_empty(struct ID *id) ATTR_NONNULL(1);
+/* *** ID's session_uuid management. *** */
+
+/* When an ID's uuid is of that value, it is unset/invalid (e.g. for runtime IDs, etc.). */
+#define MAIN_ID_SESSION_UUID_UNSET 0
+
+void BKE_lib_libblock_session_uuid_reset(void);
+void BKE_lib_libblock_session_uuid_ensure(struct ID *id);
+
void *BKE_id_new(struct Main *bmain, const short type, const char *name);
void *BKE_id_new_nomain(const short type, const char *name);