Fix RNA's "editable" func regarding IDProps and override.
authorBastien Montagne <montagne29@wanadoo.fr>
Mon, 30 Sep 2019 08:57:48 +0000 (10:57 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Mon, 30 Sep 2019 09:01:29 +0000 (11:01 +0200)
`RNA_property_overridable_get()` need the original RNA property (i.e.
the actual IDProp in case it is one), not the 'proxy' type property
returned by `rna_ensure_property()` for IDProps.

Makes custom properties of library overrides editable at last, now we
only have to keep them overridden values!

source/blender/makesrna/intern/rna_access.c

index f412930f60347b2f1ec693cd08ddfb1401bc9bf5..71a3be248100716cd0b6a44cf09b79d1ce1eea4c 100644 (file)
@@ -2058,18 +2058,18 @@ int RNA_property_ui_icon(PropertyRNA *prop)
   return rna_ensure_property(prop)->icon;
 }
 
-bool RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop)
+bool RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop_orig)
 {
   ID *id = ptr->owner_id;
   int flag;
   const char *dummy_info;
 
-  prop = rna_ensure_property(prop);
+  PropertyRNA *prop = rna_ensure_property(prop_orig);
   flag = prop->editable ? prop->editable(ptr, &dummy_info) : prop->flag;
 
   return ((flag & PROP_EDITABLE) && (flag & PROP_REGISTER) == 0 &&
           (!id || ((!ID_IS_LINKED(id) || (prop->flag & PROP_LIB_EXCEPTION)) &&
-                   (!id->override_library || RNA_property_overridable_get(ptr, prop)))));
+                   (!id->override_library || RNA_property_overridable_get(ptr, prop_orig)))));
 }
 
 /**