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-01-15 21:18:26 +0300
committerBastien Montagne <bastien@blender.org>2021-01-15 21:18:26 +0300
commitce317c9faa00c16437f001ac13934277de566a23 (patch)
tree12eaee5e0922d42a20e9201e16e0cef4c9479fcd
parentf1a577b38a3f6c127eb150d261ff564443fceda2 (diff)
LibOverride: fix/update/re-enable ID-related debug checks in diffing code.
We should now have the tools to ensure consistency of ID pointers diffing in `rna_property_override_diff_propptr`. As a reminder, for most ID pointers we just check the actual pointer value, but this is not possible for embedded IDs like root node trees or master collections, and for fake embedded ones like shapekeys, so those should be handled as mere sub-data of their owner IDs in override context.
-rw-r--r--source/blender/makesrna/intern/rna_rna.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
index c929e3ab1aa..826e1202efc 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -1279,12 +1279,22 @@ static int rna_property_override_diff_propptr(Main *bmain,
0);
if (is_id) {
- /* For now, once we deal with nodetrees we'll want to get rid of that one. */
- // BLI_assert(no_ownership);
+ /* Owned IDs (the ones we want to actually compare in depth, instead of just comparing pointer
+ * values) should be always properly tagged as 'virtual' overrides. */
+ ID *id = propptr_a->owner_id;
+ if (id != NULL && !ID_IS_OVERRIDE_LIBRARY(id)) {
+ id = propptr_b->owner_id;
+ if (id != NULL && !ID_IS_OVERRIDE_LIBRARY(id)) {
+ id = NULL;
+ }
+ }
+
+ BLI_assert(no_ownership || id == NULL || ID_IS_OVERRIDE_LIBRARY_VIRTUAL(id));
+ UNUSED_VARS_NDEBUG(id);
}
if (override) {
- if (no_ownership /* || is_id */ || is_null || is_type_diff || !is_valid_for_diffing) {
+ if (no_ownership || is_null || is_type_diff || !is_valid_for_diffing) {
/* In case this pointer prop does not own its data (or one is NULL), do not compare structs!
* This is a quite safe path to infinite loop, among other nasty issues.
* Instead, just compare pointers themselves. */