From dc69ef6f3bec555b582341f2b498e40ffd5d841e Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Fri, 15 Jan 2021 17:48:29 +0100 Subject: [PATCH] Fix T84373: Overrides : shapes keys driven by armature don't work on second instance. Code generating override operations would not deal properly with Pointer RNA properties, trying by default to use and check pointers' names properties like it does with items of a collection. However, using name property in pointer RNA property case makes no sense, so specialize the `no_prop_name` flag for each case (pointer or collection). here, since second override would generate local data-blocks with different names than the linked data ones, name matching would fail and breck handling of override diffing in shapekeys. Note that shape keys are the only one concerned by that problem, since other embedded IDs (root node trees and master collections) are fully real ones, so they always get the same names. --- source/blender/makesrna/intern/rna_rna.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 2dbf40d1278..c929e3ab1aa 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -1468,7 +1468,6 @@ int rna_property_override_diff_default(Main *bmain, rna_path != NULL; const bool no_ownership = (prop_a->rnaprop->flag & PROP_PTR_NO_OWNERSHIP) != 0; - const bool no_prop_name = (prop_a->rnaprop->flag_override & PROPOVERRIDE_NO_PROP_NAME) != 0; /* Note: we assume we only insert in ptr_a (i.e. we can only get new items in ptr_a), * and that we never remove anything. */ @@ -1724,6 +1723,11 @@ int rna_property_override_diff_default(Main *bmain, } case PROP_POINTER: { + /* Using property name check only makes sense for items of a collection, not for a single + * pointer. + * Doing this here avoids having to manually specify `PROPOVERRIDE_NO_PROP_NAME` to things + * like ShapeKey pointers. */ + const bool no_prop_name = true; if (STREQ(prop_a->identifier, "rna_type")) { /* Dummy 'pass' answer, this is a meta-data and must be ignored... */ return 0; @@ -1752,6 +1756,8 @@ int rna_property_override_diff_default(Main *bmain, } case PROP_COLLECTION: { + const bool no_prop_name = (prop_a->rnaprop->flag_override & PROPOVERRIDE_NO_PROP_NAME) != 0; + bool equals = true; bool abort = false; int idx_a = 0;