[Bf-blender-cvs] [e15591a1d79] blender2.8: Fix (unreported) a broken 'RNA diff collection' case.
Bastien Montagne
noreply at git.blender.org
Fri Mar 16 17:50:26 CET 2018
Commit: e15591a1d79b439fe539e627bb7331da093214cc
Author: Bastien Montagne
Date: Fri Mar 16 15:15:29 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBe15591a1d79b439fe539e627bb7331da093214cc
Fix (unreported) a broken 'RNA diff collection' case.
When a name property is defined for collection's struct, but no name is
actually set, we want to also fallback to index case. We cannot handle
empty names to address items of a collection!
===================================================================
M source/blender/makesrna/intern/rna_rna.c
===================================================================
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
index 8cf9bc7d39c..9c043c3563a 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -1458,6 +1458,10 @@ int rna_property_override_diff_default(PointerRNA *ptr_a, PointerRNA *ptr_b,
if (propname != NULL) {
propname_a = RNA_property_string_get_alloc(&iter_a.ptr, propname, propname_buff_a, sizeof(propname_buff_a), NULL);
propname_b = RNA_property_string_get_alloc(&iter_b.ptr, propname, propname_buff_b, sizeof(propname_buff_b), NULL);
+ }
+ /* There may be a propname defined in some cases, while no actual name set
+ * (e.g. happens with point cache), in that case too we want to fall back to index. */
+ if ((propname_a != NULL && propname_a[0] != '\0') || (propname_b != NULL && propname_b[0] != '\0')) {
if (!STREQ(propname_a, propname_b)) {
/* Same as above, not same structs. */
equals = false;
More information about the Bf-blender-cvs
mailing list