diff options
author | Bastien Montagne <bastien@blender.org> | 2022-08-24 18:12:01 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2022-08-24 18:12:01 +0300 |
commit | 5d4d5a216271e22ed9775402dedff33cdf420e30 (patch) | |
tree | 6ef6e3f20fac05e50ebaba3da5c5c9a283154a9f /source/blender/editors/interface/interface_templates.c | |
parent | 61896947d4b75829d4275043e1554bd5eb4d8abb (diff) | |
parent | 8b7293eb4168908945d562fdd1c3f8cd4d4944e5 (diff) |
Merge branch 'blender-v3.3-release'
Diffstat (limited to 'source/blender/editors/interface/interface_templates.c')
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 4eee9927264..86857d784dc 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -653,7 +653,7 @@ static void template_id_liboverride_hierarchy_collections_tag_recursive( } } -ID *ui_template_id_liboverride_hierarchy_create( +ID *ui_template_id_liboverride_hierarchy_make( bContext *C, Main *bmain, ID *owner_id, ID *id, const char **r_undo_push_label) { const char *undo_push_label; @@ -872,27 +872,27 @@ ID *ui_template_id_liboverride_hierarchy_create( return id_override; } -static void template_id_liboverride_hierarchy_create(bContext *C, - Main *bmain, - TemplateID *template_ui, - PointerRNA *idptr, - const char **r_undo_push_label) +static void template_id_liboverride_hierarchy_make(bContext *C, + Main *bmain, + TemplateID *template_ui, + PointerRNA *idptr, + const char **r_undo_push_label) { ID *id = idptr->data; ID *owner_id = template_ui->ptr.owner_id; - ID *id_override = ui_template_id_liboverride_hierarchy_create( + ID *id_override = ui_template_id_liboverride_hierarchy_make( 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); } } @@ -950,8 +950,7 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event) if (id) { Main *bmain = CTX_data_main(C); if (CTX_wm_window(C)->eventstate->modifier & KM_SHIFT) { - template_id_liboverride_hierarchy_create( - C, bmain, template_ui, &idptr, &undo_push_label); + template_id_liboverride_hierarchy_make(C, bmain, template_ui, &idptr, &undo_push_label); } else { if (BKE_lib_id_make_local(bmain, id, 0)) { @@ -972,8 +971,7 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event) if (id && ID_IS_OVERRIDE_LIBRARY(id)) { Main *bmain = CTX_data_main(C); if (CTX_wm_window(C)->eventstate->modifier & KM_SHIFT) { - template_id_liboverride_hierarchy_create( - C, bmain, template_ui, &idptr, &undo_push_label); + template_id_liboverride_hierarchy_make(C, bmain, template_ui, &idptr, &undo_push_label); } else { BKE_lib_override_library_make_local(id); |