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 19:48:29 +0300
committerBastien Montagne <bastien@blender.org>2021-01-15 21:00:38 +0300
commitdc69ef6f3bec555b582341f2b498e40ffd5d841e (patch)
tree72c0ccea0f3013025f539a0cb6a329490782891b /source/blender/makesrna/intern/rna_rna.c
parent5cf04fe2bae0f4031245794287f1b4903436cc07 (diff)
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.
Diffstat (limited to 'source/blender/makesrna/intern/rna_rna.c')
-rw-r--r--source/blender/makesrna/intern/rna_rna.c8
1 files changed, 7 insertions, 1 deletions
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;