diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-11-30 17:25:54 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-11-30 17:27:59 +0300 |
commit | df63195d2a7bc374398b0b6dfa389db3b40f5a70 (patch) | |
tree | 46ebb08ce49ff609125f696467c4696abcae46b9 /source/blender/makesdna | |
parent | 2f6f75613fc0845604b205a85203134cca3b1034 (diff) |
Cleanup id->newid usage, initial work.
This aims at always ensuring that ID.newid (and relevant LIB_TAG_NEW)
stay in clean (i.e. cleared) state by default.
To achieve this, instead of clearing after all id copy call (would be
horribly noisy, and bad for performances), we try to completely remove
the setting of id->newid by default when copying a new ID.
This implies that areas actually needing that info (mainly, object editing
area (make single user...) and make local area) have to ensure they set
it themselves as needed.
This is far from simple change, many complex code paths to consider, so
will need some serious testing. :/
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_ID.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index feeb2d5e4d7..59fd0c7832c 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -290,9 +290,9 @@ typedef enum ID_Type { #endif #define GS(a) (CHECK_TYPE_ANY(a, char *, const char *, char [66], const char[66]), (*((const short *)(a)))) -#define ID_NEW(a) if ( (a) && (a)->id.newid ) (a) = (void *)(a)->id.newid -#define ID_NEW_US(a) if ( (a)->id.newid) { (a) = (void *)(a)->id.newid; (a)->id.us++; } -#define ID_NEW_US2(a) if (((ID *)a)->newid) { (a) = ((ID *)a)->newid; ((ID *)a)->us++; } +#define ID_NEW_SET(_id, _idn) \ + (((ID *)(_id))->newid = (ID *)(_idn), ((ID *)(_id))->newid->tag |= LIB_TAG_NEW, (void *)((ID *)(_id))->newid) +#define ID_NEW_REMAP(a) if ((a) && (a)->id.newid) (a) = (void *)(a)->id.newid /* id->flag (persitent). */ enum { |