Commit: 0df8c22c8a369e8dd2d7ad6653556e622f98471b
Author: Bastien Montagne
Date: Tue Mar 8 11:01:34 2022 +0100
Branches: master
https://developer.blender.org/rB0df8c22c8a369e8dd2d7ad6653556e622f98471b
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.
===================================================================
M source/blender/blenkernel/intern/lib_override.c
M source/blender/makesrna/intern/rna_ID.c
===================================================================
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);
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs