[Bf-blender-cvs] [6a7066c2c17] master: LibOverride: Add a 'is hierarchy root' macro check.

Bastien Montagne noreply at git.blender.org
Wed Mar 9 12:50:09 CET 2022


Commit: 6a7066c2c172421424ba4aae1b10e6f3e54f08c0
Author: Bastien Montagne
Date:   Wed Mar 9 12:46:29 2022 +0100
Branches: master
https://developer.blender.org/rB6a7066c2c172421424ba4aae1b10e6f3e54f08c0

LibOverride: Add a 'is hierarchy root' macro check.

===================================================================

M	source/blender/makesdna/DNA_ID.h

===================================================================

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)



More information about the Bf-blender-cvs mailing list