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>2021-08-05 16:24:46 +0300
committerBastien Montagne <bastien@blender.org>2021-08-05 16:26:08 +0300
commit0cff7c2a228589505bd2d66e966e5e84613b2786 (patch)
treed8a861789386609cfdf77164b020529f27d065b3 /source/blender/editors
parent720ea8a67df06ba2242e7771b349cefd753f7ea5 (diff)
LibOverride: Make it reasonably impossible for users to create overrides of scenes.
This is not supported currently,doing so through RNA API remains possible, but from regular UI operations it should not be doable anymore. Ref. T90459.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index 3edb12c5503..e3aec572bd3 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -845,8 +845,20 @@ static void id_override_library_create_fn(bContext *C,
if (!ID_IS_LINKED(te->store_elem->id)) {
break;
}
+ /* If we'd need to override that arent ID, but it is not overridable, abort. */
+ if (!ID_IS_OVERRIDABLE_LIBRARY(te->store_elem->id)) {
+ BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false);
+ BKE_reportf(reports,
+ RPT_WARNING,
+ "Could not create library override from data-block '%s', one of its parents "
+ "is not overridable ('%s')",
+ id_root->name,
+ te->store_elem->id->name);
+ return;
+ }
te->store_elem->id->tag |= LIB_TAG_DOIT;
}
+
success = BKE_lib_override_library_create(
bmain, CTX_data_scene(C), CTX_data_view_layer(C), id_root, id_reference, NULL);
}