From 32278b79a8de225a0edefa3d07693a098611a412 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 12 Jan 2022 10:43:42 +0100 Subject: LibOverride: Add 'hierarchy root ID' info. This change will make handling of liboverrides hierarchies (especially resyncing) much easier and efficient. It should also make it more resilient to 'degenerate' cases, and allow proper support of things like parenting an override to another override of the same linked data (e.g. a override character parented to another override of the same character). NOTE: this commit only implements minimal changes to add that data and generate it for existing files on load. Actual refactor of resync code to take advantage of this new info will happen separately. --- source/blender/makesdna/DNA_ID.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index 4f479abe2b0..cfee35e147a 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -310,6 +310,13 @@ typedef struct IDOverrideLibrary { /** List of IDOverrideLibraryProperty structs. */ ListBase properties; + /** Override hierarchy root ID. Usually the actual root of the hierarchy, but not always + * in degenerated cases. + * + * All liboverrides of a same hierarchy (e.g. a character collection) share the same root. + */ + struct ID *hierarchy_root; + /* Read/write data. */ /* Temp ID storing extra override data (used for differential operations only currently). * Always NULL outside of read/write context. */ @@ -317,8 +324,6 @@ typedef struct IDOverrideLibrary { IDOverrideLibraryRuntime *runtime; - void *_pad_0; - unsigned int flag; char _pad_1[4]; } IDOverrideLibrary; -- cgit v1.2.3