From 460e0a1347e50d33f5d42235ee2d9cb7208cdc4f Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Tue, 25 Jan 2022 15:31:46 +0100 Subject: Revert "Performance: Remap multiple items in UI" This reverts commit 948211679f2a0681421160be0d3b90f507bc0be7. This commit introduced some regressions in the test suite. As this change is a core part of blender Bastien and I decided to revert it as the solution isn't clear and needs more investigation. The following tests FAILED: 62 - blendfile_liblink (SEGFAULT) 63 - blendfile_library_overrides (SEGFAULT) It fails in (id_us_ensure_real) --- source/blender/editors/space_nla/space_nla.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source/blender/editors/space_nla/space_nla.c') diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 962b5151661..0771153c5f5 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -33,7 +33,6 @@ #include "BLI_utildefines.h" #include "BKE_context.h" -#include "BKE_lib_remap.h" #include "BKE_screen.h" #include "ED_anim_api.h" @@ -578,17 +577,18 @@ static void nla_listener(const wmSpaceTypeListenerParams *params) } } -static void nla_id_remap(ScrArea *UNUSED(area), - SpaceLink *slink, - const struct IDRemapper *mappings) +static void nla_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, ID *old_id, ID *new_id) { SpaceNla *snla = (SpaceNla *)slink; - if (snla->ads == NULL) { - return; + if (snla->ads) { + if ((ID *)snla->ads->filter_grp == old_id) { + snla->ads->filter_grp = (Collection *)new_id; + } + if ((ID *)snla->ads->source == old_id) { + snla->ads->source = new_id; + } } - BKE_id_remapper_apply(mappings, (ID **)&snla->ads->filter_grp, ID_REMAP_APPLY_DEFAULT); - BKE_id_remapper_apply(mappings, (ID **)&snla->ads->source, ID_REMAP_APPLY_DEFAULT); } void ED_spacetype_nla(void) -- cgit v1.2.3