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.
This commit is contained in:
Bastien Montagne 2021-01-15 17:48:29 +01:00
parent 69a7015e12
commit 319056679b
Notes: blender-bot 2023-02-14 00:37:17 +01:00
Referenced by issue #84373, Overrides : shapes keys driven by armature don't work on second instance
1 changed files with 7 additions and 1 deletions

View File

@ -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;