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 | |
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')
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 9 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_access_compare_override.c | 4 |
2 files changed, 7 insertions, 6 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)) { diff --git a/source/blender/makesrna/intern/rna_access_compare_override.c b/source/blender/makesrna/intern/rna_access_compare_override.c index 28ee5eca723..cc4daf017eb 100644 --- a/source/blender/makesrna/intern/rna_access_compare_override.c +++ b/source/blender/makesrna/intern/rna_access_compare_override.c @@ -108,7 +108,7 @@ bool RNA_property_overridden(PointerRNA *ptr, PropertyRNA *prop) char *rna_path = RNA_path_from_ID_to_property(ptr, prop); ID *id = ptr->owner_id; - if (rna_path == NULL || id == NULL || id->override_library == NULL) { + if (rna_path == NULL || id == NULL || !ID_IS_OVERRIDE_LIBRARY(id)) { return false; } @@ -1156,7 +1156,7 @@ eRNAOverrideStatus RNA_property_override_library_status(PointerRNA *ptr, return override_status; } - if (!ptr || !prop || !ptr->owner_id || !(ptr->owner_id)->override_library) { + if (!ptr || !prop || !ptr->owner_id || !ID_IS_OVERRIDE_LIBRARY(ptr->owner_id)) { return override_status; } |