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>2022-08-24 18:07:43 +0300
committerBastien Montagne <bastien@blender.org>2022-08-24 18:11:36 +0300
commit8b7293eb4168908945d562fdd1c3f8cd4d4944e5 (patch)
treec3ace31427895a2602a51a1c928cffa64e5e5c45 /source/blender/editors/interface/interface_templates.c
parent24dc84f15668129c7a7fe0a284f6b2376a473e15 (diff)
LibOverride: Fix (unreported) crashes in some cases, preserve active object on Clear, general cleanup.
Inconsistencies in update/tagging code between different code doing the same 'Clear. liboverride operation lead to crashes in some cases. Unify deg tagging and WM notifiers accross the three editor-level codepaths performing the common Make/Reset/Clear operations. Preserve if possible the active object accross Clear operation. Several cleanup/rename/re-arangement of code to make it more consistent.
Diffstat (limited to 'source/blender/editors/interface/interface_templates.c')
-rw-r--r--source/blender/editors/interface/interface_templates.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 95952b6e8c8..7d27af7220e 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -885,14 +885,14 @@ static void template_id_liboverride_hierarchy_make(bContext *C,
C, bmain, owner_id, id, r_undo_push_label);
if (id_override != NULL) {
- /* Given `idptr` is re-assigned to owner property by caller to ensure proper updates etc. Here
- * we also use it to ensure remapping of the owner property from the linked data to the newly
- * created liboverride (note that in theory this remapping has already been done by code
- * above), but only in case owner ID was already an existing liboverride.
+ /* `idptr` is re-assigned to owner property to ensure proper updates etc. Here we also use it
+ * to ensure remapping of the owner property from the linked data to the newly created
+ * liboverride (note that in theory this remapping has already been done by code above), but
+ * only in case owner ID was already local ID (override or pure local data).
*
- * Otherwise, owner ID will also have been overridden, and remapped already to use
- * it's override of the data too. */
- if (ID_IS_OVERRIDE_LIBRARY_REAL(owner_id)) {
+ * Otherwise, owner ID will also have been overridden, and remapped already to use it's
+ * override of the data too. */
+ if (!ID_IS_LINKED(owner_id)) {
RNA_id_pointer_create(id_override, idptr);
}
}