[Bf-blender-cvs] [3de3c3c23a9] master: Fix (unreported) LibOverride diffing generating operations for non-editable properties.

Bastien Montagne noreply at git.blender.org
Wed Jul 14 14:48:01 CEST 2021


Commit: 3de3c3c23a930943086ab9719f0abe5c069cc4b5
Author: Bastien Montagne
Date:   Wed Jul 14 12:52:14 2021 +0200
Branches: master
https://developer.blender.org/rB3de3c3c23a930943086ab9719f0abe5c069cc4b5

Fix (unreported) LibOverride diffing generating operations for non-editable properties.

Non-pointer-like properties that are not editable should never generate
override operations.

While harmless (those would never be applied back anyway), better not
clutter override operations list, and also enjoy the symbolic
performances improvement here.

NOTE: Pointer-like properties (pointers and collections) remain
processed as usual here since they usually imply recursivity. We could
make an exception to the exception for ID pointers, but for now I don't
think this is worth it.

===================================================================

M	source/blender/makesrna/intern/rna_access_compare_override.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_access_compare_override.c b/source/blender/makesrna/intern/rna_access_compare_override.c
index 816fc68195f..c4d35140423 100644
--- a/source/blender/makesrna/intern/rna_access_compare_override.c
+++ b/source/blender/makesrna/intern/rna_access_compare_override.c
@@ -422,7 +422,9 @@ static int rna_property_override_diff(Main *bmain,
 
   bool override_changed = false;
   eRNAOverrideMatch diff_flags = flags;
-  if (!RNA_property_overridable_get(&prop_a->ptr, prop_a->rawprop)) {
+  if (!RNA_property_overridable_get(&prop_a->ptr, prop_a->rawprop) ||
+      (!ELEM(RNA_property_type(prop_a->rawprop), PROP_POINTER, PROP_COLLECTION) &&
+       !RNA_property_editable_flag(&prop_a->ptr, prop_a->rawprop))) {
     diff_flags &= ~RNA_OVERRIDE_COMPARE_CREATE;
   }
   const int diff = override_diff(bmain,



More information about the Bf-blender-cvs mailing list