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
path: root/source
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2022-03-08 13:01:34 +0300
committerBastien Montagne <bastien@blender.org>2022-03-08 13:02:22 +0300
commit0df8c22c8a369e8dd2d7ad6653556e622f98471b (patch)
tree6d4a31cd7605e5bb5e2a953c81937b68d3875483 /source
parent1c1efe3ac605b187254377058c93fd34c94aaf9a (diff)
LibOverrides: Tweak to ensure no overrides can be created on linked data.
Was already mostly the case, but from RNA API there was no proper check.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/lib_override.c1
-rw-r--r--source/blender/makesrna/intern/rna_ID.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c
index 922c1beda38..6a0f3bb5611 100644
--- a/source/blender/blenkernel/intern/lib_override.c
+++ b/source/blender/blenkernel/intern/lib_override.c
@@ -2854,6 +2854,7 @@ bool BKE_lib_override_library_status_check_reference(Main *bmain, ID *local)
bool BKE_lib_override_library_operations_create(Main *bmain, ID *local)
{
+ BLI_assert(!ID_IS_LINKED(local));
BLI_assert(local->override_library != NULL);
const bool is_template = (local->override_library->reference == NULL);
bool created = false;
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index 94ffa330064..a9725da7841 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -744,6 +744,11 @@ static void rna_ID_override_library_operations_update(ID *id,
return;
}
+ if (ID_IS_LINKED(id)) {
+ BKE_reportf(reports, RPT_ERROR, "ID '%s' is linked, cannot edit its overrides", id->name);
+ return;
+ }
+
BKE_lib_override_library_operations_create(bmain, id);
WM_main_add_notifier(NC_WM | ND_LIB_OVERRIDE_CHANGED, NULL);