diff options
author | Bastien Montagne <bastien@blender.org> | 2021-11-01 17:19:17 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-11-01 17:46:28 +0300 |
commit | 8fbbd699467885c89920524be39dee50ae42bf80 (patch) | |
tree | 0f6a4e51d0f1ffee558ec7fd1142e3532b3f1574 /source/blender/editors/object/object_relations.c | |
parent | e85e126e3f52723da62b258cc9b196a9f15e34fd (diff) |
Fix T92629: Crash on mesh separate after rB43bc494892c3.
rB43bc494892c3 switched `BKE_libblock_relink_to_newid` to use new ID
remapping and libquery code.
However, that new code does protect by default against remapping an
objects's data pointer when that object is in Edit mode, since this is
not a behavior that generic BKE code can handle (due to required editing
data for most obdata types when in edit mode).
So specific code that does create new IDs and need remapping in Edit
mode has to pass specific exception flags to remaping code.
This commit adds those remapping flags to `BKE_libblock_relink_to_newid`
and add said exception flag to the remapping call from
`ED_object_add_duplicate` when the object is in edit mode.
Diffstat (limited to 'source/blender/editors/object/object_relations.c')
-rw-r--r-- | source/blender/editors/object/object_relations.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index acd3f058554..556ddb78653 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1690,11 +1690,11 @@ static void libblock_relink_collection(Main *bmain, const bool do_collection) { if (do_collection) { - BKE_libblock_relink_to_newid(bmain, &collection->id); + BKE_libblock_relink_to_newid(bmain, &collection->id, 0); } for (CollectionObject *cob = collection->gobject.first; cob != NULL; cob = cob->next) { - BKE_libblock_relink_to_newid(bmain, &cob->ob->id); + BKE_libblock_relink_to_newid(bmain, &cob->ob->id, 0); } LISTBASE_FOREACH (CollectionChild *, child, &collection->children) { @@ -1768,7 +1768,7 @@ static void single_object_users( single_object_users_collection(bmain, scene, master_collection, flag, copy_collections, true); /* Will also handle the master collection. */ - BKE_libblock_relink_to_newid(bmain, &scene->id); + BKE_libblock_relink_to_newid(bmain, &scene->id, 0); /* Collection and object pointers in collections */ libblock_relink_collection(bmain, scene->master_collection, false); |