diff options
author | Bastien Montagne <bastien@blender.org> | 2020-06-30 11:52:02 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-06-30 13:19:11 +0300 |
commit | 0b3313e53230914e79dd5c8f02b90fbaf6a8874b (patch) | |
tree | c9e439e67a8de2f01edbdeb2f73c4b3d057301a7 /source/blender/makesrna/intern/rna_access.c | |
parent | 4783520bfad43b643f9e88dd2386c89c35c52f5f (diff) |
Cleanup: LibOverride: Replace raw pointers checks by proper macros.
This is cleaner, but also crucial to avoid weird issues when behaviors
of those checks are modified...
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index b7090f4fb56..cb9679ad925 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -2064,9 +2064,10 @@ bool RNA_property_editable(PointerRNA *ptr, PropertyRNA *prop_orig) 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_orig))))); + return ( + (flag & PROP_EDITABLE) && (flag & PROP_REGISTER) == 0 && + (!id || ((!ID_IS_LINKED(id) || (prop->flag & PROP_LIB_EXCEPTION)) && + (!ID_IS_OVERRIDE_LIBRARY(id) || RNA_property_overridable_get(ptr, prop_orig))))); } /** @@ -2100,7 +2101,7 @@ bool RNA_property_editable_info(PointerRNA *ptr, PropertyRNA *prop, const char * } return false; } - if (id->override_library != NULL) { + if (ID_IS_OVERRIDE_LIBRARY(id)) { /* We need the real data property in case of IDProperty here... */ PropertyRNA *real_prop = rna_ensure_property_realdata(&prop, ptr); if (real_prop == NULL || !RNA_property_overridable_get(ptr, real_prop)) { |