diff options
author | Jeroen Bakker <jeroen@blender.org> | 2021-03-29 10:53:12 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-03-29 10:54:34 +0300 |
commit | 87f9405c9aedb4b23c3400780db42ddda0cc4c2b (patch) | |
tree | 1930b6bbf9ea418849f31685e3e1b2077acbe1a6 /source/blender/blenkernel/intern/lib_override.c | |
parent | 27fa2507a15b37a57420ff9b900c9d4a15dd29c4 (diff) |
Overrides: API to create an override template.
This is functionality that isn't accessible via the user interface. The
API allows the creation and modification of an override template that
holds rules that needs to be checked when overriding the asset.
The API is setup that it cannot be changed after creation. Later on when
the system is more mature we will allow changing overrides operations.
NOTE: This is an experimental feature and should not be used in productions.
Reviewed By: mont29, sebbas
Differential Revision: https://developer.blender.org/D10792
Diffstat (limited to 'source/blender/blenkernel/intern/lib_override.c')
-rw-r--r-- | source/blender/blenkernel/intern/lib_override.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c index c755d153100..dbb46aa5780 100644 --- a/source/blender/blenkernel/intern/lib_override.c +++ b/source/blender/blenkernel/intern/lib_override.c @@ -823,6 +823,22 @@ bool BKE_lib_override_library_create( } /** + * Create a library override template. + */ +bool BKE_lib_override_library_template_create(struct ID *id) +{ + if (ID_IS_LINKED(id)) { + return false; + } + if (ID_IS_OVERRIDE_LIBRARY(id)) { + return false; + } + + BKE_lib_override_library_init(id, NULL); + return true; +} + +/** * Convert a given proxy object into a library override. * * \note This is a thin wrapper around \a BKE_lib_override_library_create, only extra work is to |