BKE libremap: do not assert on identity pairs.

If identity pairs (i.e. old ID pointer being same as new one) was
forbidden, then this should be asserted against in code defining
remapping, not in code applying it.

But it is actually sometimes usefull to allow/use identity pairs, so
simply early-return on these instead of asserting.
This commit is contained in:
Bastien Montagne 2023-02-06 18:52:49 +01:00
parent c7b601c79e
commit 85b2bce037
1 changed files with 4 additions and 1 deletions

View File

@ -532,13 +532,16 @@ typedef struct LibblockRemapMultipleUserData {
static void libblock_remap_foreach_idpair_cb(ID *old_id, ID *new_id, void *user_data)
{
if (old_id == new_id) {
return;
}
LibBlockRemapMultipleUserData *data = user_data;
Main *bmain = data->bmain;
const short remap_flags = data->remap_flags;
BLI_assert(old_id != NULL);
BLI_assert((new_id == NULL) || GS(old_id->name) == GS(new_id->name));
BLI_assert(old_id != new_id);
if (free_notifier_reference_cb) {
free_notifier_reference_cb(old_id);