[Bf-blender-cvs] [56854bd177a] master: Fix RNA's "editable" func regarding IDProps and override.
Bastien Montagne
noreply at git.blender.org
Mon Sep 30 11:30:28 CEST 2019
Commit: 56854bd177a2bc276d84969edfb5ec0f2220be23
Author: Bastien Montagne
Date: Mon Sep 30 10:57:48 2019 +0200
Branches: master
https://developer.blender.org/rB56854bd177a2bc276d84969edfb5ec0f2220be23
Fix RNA's "editable" func regarding IDProps and override.
`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!
===================================================================
M source/blender/makesrna/intern/rna_access.c
===================================================================
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index f412930f603..71a3be24810 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -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)))));
}
/**
More information about the Bf-blender-cvs
mailing list