Fix T51150: user_remap on itself changes users to 0.

Remapping to itself is nonsense here (was triggering an assert in
BKE_library code actually), just make it a bail out early in RNA
callback in that case.
This commit is contained in:
Bastien Montagne 2017-04-17 22:33:07 +02:00
parent 4621392353
commit 4d0d1b5936
Notes: blender-bot 2023-02-14 07:07:13 +01:00
Referenced by issue #51243, Delete Globally won't work with Datablock ID Properties
Referenced by issue #51150, user_remap on itself changes users to 0
Referenced by issue #51047, Copy Location constraint from bendy bone shows crazy jiggle behaviour in linked proxy rig.
1 changed files with 1 additions and 1 deletions

View File

@ -342,7 +342,7 @@ static void rna_ID_user_clear(ID *id)
static void rna_ID_user_remap(ID *id, Main *bmain, ID *new_id)
{
if (GS(id->name) == GS(new_id->name)) {
if ((GS(id->name) == GS(new_id->name)) && (id != new_id)) {
/* For now, do not allow remapping data in linked data from here... */
BKE_libblock_remap(bmain, id, new_id, ID_REMAP_SKIP_INDIRECT_USAGE | ID_REMAP_SKIP_NEVER_NULL_USAGE);
}