diff options
author | Bastien Montagne <bastien@blender.org> | 2022-02-22 19:20:18 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-03-29 18:58:40 +0300 |
commit | 5adcf6c85e4c28fcfda0048a9ec7cceae105046d (patch) | |
tree | ebc6b23cb3ede2cd3581371aaf6fae3f057eb511 /source/blender/makesdna | |
parent | 101308403833aedbfef1d105424867a8f787d7b6 (diff) |
LibOverride: Add initial System Override flag.
This merely adds the flag, exposes it in RMA, and uses it in some of the
most common 'is editable' checks (RNA, `BASE_EDITABLE` macro...).
Next step: do_version and defining systemoverrides at creation.
Ref: {T95707}.
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_ID.h | 5 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index c3132eeab3d..3ebf085443a 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -319,6 +319,11 @@ enum { * because it was created as an single override, outside of any hierarchy consideration). */ IDOVERRIDE_LIBRARY_FLAG_NO_HIERARCHY = 1 << 0, + /** + * The override ID is required for the system to work (because of ID dependencies), but is not + * seen as editable by the user. + */ + IDOVERRIDE_LIBRARY_FLAG_SYSTEM_DEFINED = 1 << 1, }; /* watch it: Sequence has identical beginning. */ diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index d0c23f5d452..28c2d8427a8 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -2017,7 +2017,10 @@ extern const char *RE_engine_id_CYCLES; ((v3d == NULL) || (((1 << (base)->object->type) & (v3d)->object_type_exclude_select) == 0)) && \ (((base)->flag & BASE_SELECTABLE) != 0)) #define BASE_SELECTED(v3d, base) (BASE_VISIBLE(v3d, base) && (((base)->flag & BASE_SELECTED) != 0)) -#define BASE_EDITABLE(v3d, base) (BASE_VISIBLE(v3d, base) && !ID_IS_LINKED((base)->object)) +#define BASE_EDITABLE(v3d, base) \ + (BASE_VISIBLE(v3d, base) && !ID_IS_LINKED((base)->object) && \ + (!ID_IS_OVERRIDE_LIBRARY_REAL((base)->object) || \ + ((base)->object->id.override_library->flag & IDOVERRIDE_LIBRARY_FLAG_SYSTEM_DEFINED) == 0)) #define BASE_SELECTED_EDITABLE(v3d, base) \ (BASE_EDITABLE(v3d, base) && (((base)->flag & BASE_SELECTED) != 0)) |