Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2020-06-30 12:33:36 +0300
committerBastien Montagne <bastien@blender.org>2020-06-30 13:19:11 +0300
commitdeb01eb1991e49fb912ede1ef036710e51b25fc5 (patch)
tree31c0eb4afd9cd940070e68b95f1421c5c0bfefc7 /source/blender/makesdna
parent34027506f855ff506151953311d762235122b66d (diff)
LibOverride: Add concept of 'embedded'/'virtual' override.
IDs like embedded ones (master collections, root node trees) cannot be linked, and thus cannot be real override themselves. Since they are managed by their owner ID, that one will also have the overrides for their locally edited properties. We still need a way to mark them as overridden though, for various UI and override-internal purposes, this is done using a new ID flag. Note that since Shae Keys are not linkable, and their pointers are not editable in RNA, they are also considered as embedded from override point of view.
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_ID.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index ed2d3671b6b..60cedfe3c8a 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -470,8 +470,15 @@ typedef enum ID_Type {
#define ID_IS_OVERRIDABLE_LIBRARY(_id) \
(ID_IS_LINKED(_id) && !ID_MISSING(_id) && (((const ID *)(_id))->tag & LIB_TAG_EXTERN) != 0)
+#define ID_IS_OVERRIDE_LIBRARY_REAL(_id) \
+ (((const ID *)(_id))->override_library != NULL && \
+ ((const ID *)(_id))->override_library->reference != NULL)
+
+#define ID_IS_OVERRIDE_LIBRARY_VIRTUAL(_id) \
+ ((((const ID *)(_id))->flag & LIB_EMBEDDED_DATA_LIB_OVERRIDE) != 0)
+
#define ID_IS_OVERRIDE_LIBRARY(_id) \
- (((const ID *)(_id))->override_library != NULL && ((const ID *)(_id))->override_library->reference != NULL)
+ (ID_IS_OVERRIDE_LIBRARY_REAL(_id) || ID_IS_OVERRIDE_LIBRARY_VIRTUAL(_id))
#define ID_IS_OVERRIDE_LIBRARY_TEMPLATE(_id) \
(((ID *)(_id))->override_library != NULL && ((ID *)(_id))->override_library->reference == NULL)
@@ -509,6 +516,11 @@ enum {
* we want to restore if possible, and silently drop if it's missing.
*/
LIB_INDIRECT_WEAK_LINK = 1 << 11,
+ /**
+ * The data-block is a sub-data of another one, which is an override.
+ * Note that this also applies to shapekeys, even though they are not 100% embedded data...
+ */
+ LIB_EMBEDDED_DATA_LIB_OVERRIDE = 1 << 12,
};
/**