diff options
author | Bastien Montagne <b.mont29@gmail.com> | 2020-03-05 18:17:14 +0300 |
---|---|---|
committer | Bastien Montagne <b.mont29@gmail.com> | 2020-03-05 18:30:12 +0300 |
commit | c43725e1891bd8534ac4b668277cddae9762d524 (patch) | |
tree | 59e26be9adb639b82305ce0f6f4dc36490052f06 /source/blender/makesdna | |
parent | 88db9a17ce70c4553be1922e3ecef091e8c1d039 (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/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_ID.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index 89af705d5ed..3ac93a96661 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -31,6 +31,8 @@ extern "C" { #endif +#include "DNA_defs.h" + struct FileData; struct GHash; struct GPUTexture; @@ -243,7 +245,13 @@ typedef struct ID { int us; int icon_id; int recalc; - char _pad[4]; + + /** + * A session-wide unique identifier for a given ID, that remain the same across potential + * re-allocations (e.g. due to undo/redo steps). + */ + unsigned int session_uuid; + IDProperty *properties; /** Reference linked ID which this one overrides. */ |