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!
This commit is contained in:
@@ -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)))));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user