Fix ID copying outside of Main affecting 'directly linked' status of other IDs.
Copying an ID outside of BMain should not assume that the datablocks it uses are now directly linked. This would be wrong e.g. in case that new no-main ID is copied from a linked data-block and is supposed to remain a linked data.
This commit is contained in:
parent
3826c161ad
commit
a881b5272b
|
@ -525,7 +525,13 @@ static int id_copy_libmanagement_cb(LibraryIDLinkCallbackData *cb_data)
|
|||
|
||||
/* Increase used IDs refcount if needed and required. */
|
||||
if ((data->flag & LIB_ID_CREATE_NO_USER_REFCOUNT) == 0 && (cb_flag & IDWALK_CB_USER)) {
|
||||
id_us_plus(id);
|
||||
if ((data->flag & LIB_ID_CREATE_NO_MAIN) != 0) {
|
||||
BLI_assert(cb_data->id_self->tag & LIB_TAG_NO_MAIN);
|
||||
id_us_plus_no_lib(id);
|
||||
}
|
||||
else {
|
||||
id_us_plus(id);
|
||||
}
|
||||
}
|
||||
|
||||
return IDWALK_RET_NOP;
|
||||
|
|
Loading…
Reference in New Issue