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>2022-03-09 14:46:29 +0300
committerBastien Montagne <bastien@blender.org>2022-03-09 14:50:04 +0300
commit6a7066c2c172421424ba4aae1b10e6f3e54f08c0 (patch)
tree4ab6370548b85c43b85f1bf17d616e6c1b20c2ee /source/blender/makesdna
parent4da282a1615d23ffcdfdc43998dce5091455078b (diff)
LibOverride: Add a 'is hierarchy root' macro check.
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_ID.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 011f3618e15..e3be31d3afe 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -573,6 +573,10 @@ typedef struct PreviewImage {
#define ID_IS_OVERRIDE_LIBRARY(_id) \
(ID_IS_OVERRIDE_LIBRARY_REAL(_id) || ID_IS_OVERRIDE_LIBRARY_VIRTUAL(_id))
+#define ID_IS_OVERRIDE_LIBRARY_HIERARCHY_ROOT(_id) \
+ (!ID_IS_OVERRIDE_LIBRARY_REAL(_id) || \
+ ((ID *)(_id))->override_library->hierarchy_root == ((ID *)(_id)))
+
#define ID_IS_OVERRIDE_LIBRARY_TEMPLATE(_id) \
(((ID *)(_id))->override_library != NULL && ((ID *)(_id))->override_library->reference == NULL)