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 <bastien@blender.org>2021-11-19 11:33:52 +0300
committerBastien Montagne <bastien@blender.org>2021-11-19 17:41:53 +0300
commit33c5e7bcd5e5b790ee95caaa0c4d917996341266 (patch)
tree9bce351ce98200b7313bb136fac443eb9d98c9a7 /source/blender/makesdna/DNA_ID.h
parentd6ea881a741a254b6f4e931ea25047d3f51686d0 (diff)
LibOverrides: Refactor how diffing of RNA collections is handled.
Original implementation was a quick prototype which should have never landed as-is in master. It had very limiting constraints and did not allow for any real further development. This commit fixes the internal implementation to make more sensible, maintainable and evolutive. NOTE: This commit introduces another forward-incompatibility in the Blender file format: Files saved after this commit won't open properly in older versions of blender regarding local inserted constraints or modifiers into overrides of linked data. NOTE: Technical details: The 'anchor' item name/index is now stored in `subitem_reference_` members, and the actual 'source' item name/index is stored in `subitem_local_` members of the override property operation data. Previously, only the `subitem_local_` members were used, storing the anchor item name/index, and assuming the 'source' item was always the next in the list. Milestone I of T82160. Maniphest Tasks: T82160 Differential Revision: https://developer.blender.org/D13282
Diffstat (limited to 'source/blender/makesdna/DNA_ID.h')
-rw-r--r--source/blender/makesdna/DNA_ID.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index d829d707a71..2c04d0b06ef 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -211,11 +211,15 @@ typedef struct IDOverrideLibraryPropertyOperation {
char _pad0[2];
/* Sub-item references, if needed (for arrays or collections only).
- * We need both reference and local values to allow e.g. insertion into collections
+ * We need both reference and local values to allow e.g. insertion into RNA collections
* (constraints, modifiers...).
- * In collection case, if names are defined, they are used in priority.
- * Names are pointers (instead of char[64]) to save some space, NULL when unset.
- * Indices are -1 when unset. */
+ * In RNA collection case, if names are defined, they are used in priority.
+ * Names are pointers (instead of char[64]) to save some space, NULL or empty string when unset.
+ * Indices are -1 when unset.
+ *
+ * NOTE: For insertion operations in RNA collections, reference may not actually exist in the
+ * linked reference data. It is used to identify the anchor of the insertion operation (i.e. the
+ * item after or before which the new local item should be inserted), in the local override. */
char *subitem_reference_name;
char *subitem_local_name;
int subitem_reference_index;