Fix T63042: Grease pencil and armature will sometimes copy successfully because of the put in Collection order, sometimes fail.

Remove remapping to new IDs from `BKE_object_duplicate()` itself, doing
it here will break later remapping done after all desired objects have
been duplicated, preventing complete remap of ID pointers used in obdata
and other sub-data of duplicated objects.

Checked, the only two usages of this function were already doing
separated later step for this anyway.
This commit is contained in:
Bastien Montagne 2019-03-29 14:54:50 +01:00
parent d9829efb0a
commit d66ed7d540
Notes: blender-bot 2024-01-31 11:35:08 +01:00
Referenced by issue #63042, Grease pencil and armature will sometimes copy successfully because of the put in Collection order, sometimes fail.
1 changed files with 1 additions and 2 deletions

View File

@ -1431,6 +1431,7 @@ Object *BKE_object_copy(Main *bmain, const Object *ob)
*
* \param dupflag Controls which sub-data are also duplicated (see \a eDupli_ID_Flags in \a DNA_userdef_types.h).
*
* \note This function does not do any remapping to new IDs, caller must do it (\a BKE_libblock_relink_to_newid()).
* \note Caller MUST free \a newid pointers itself (\a BKE_main_id_clear_newpoins()) and call updates of DEG too
* (\a DAG_relations_tag_update()).
*/
@ -1657,8 +1658,6 @@ Object *BKE_object_duplicate(Main *bmain, const Object *ob, const int dupflag)
#undef ID_NEW_REMAP_US
#undef ID_NEW_REMAP_US2
BKE_libblock_relink_to_newid(&obn->id);
if (ob->data != NULL) {
DEG_id_tag_update_ex(bmain, (ID *)obn->data, ID_RECALC_EDITORS);
}