From 86c5d1f4aa07551b289619da501889a172a39e03 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sat, 19 Sep 2020 12:13:04 +0200 Subject: LibOverride: add checks to RNA collections editing utils. Collections of liboverride data only support insertion of new items (and deleting or moving those around). No operation on existing items from linked data is allowed. Reflect that in RNA functions used to edit py-defined RNA collections. Note that this is not ideal currently, it does the job but feedback to user is rather poor. Ideally add-ons should implement higher-level checks for override cases in their operators. --- source/blender/makesdna/DNA_ID.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index 1e24ec24dc2..ea1e1d7ee0e 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -130,6 +130,11 @@ enum { * Should only be used/be relevant for custom properties. */ IDP_FLAG_OVERRIDABLE_LIBRARY = 1 << 0, + /** This collection item IDProp has been inserted in a local override. + * This is used by internal code to distinguish between library-originated items and + * local-insterted ones, as many operations are not allowed on the former. */ + IDP_FLAG_OVERRIDELIBRARY_LOCAL = 1 << 1, + /** This means the property is set but RNA will return false when checking * 'RNA_property_is_set', currently this is a runtime flag */ IDP_FLAG_GHOST = 1 << 7, -- cgit v1.2.3