Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2022-05-23 21:00:33 +0300
committerJulian Eisel <julian@blender.org>2022-05-23 21:11:37 +0300
commit917c096be6b93ce5ad1eb284d344da10000ab896 (patch)
tree732619bb3d84e8626381cd0853bd26467f159273 /source/blender/editors/space_view3d
parentffa262c9f8c43498293a9f45876bad9214b283dc (diff)
Fix possible issues when mixing link & append for asset drag & drop
The operators to handle object drag and drop (from the asset browser, outliner, etc.) used the object name to find the object to add and place. This is problematic with linking and/or library overrides, since this may lead to multiple objects with the same name. So the wrong object would be used by the drop operators. Partially fixes T97320. T95706 probably needs the same fix but for materials. As a side-effect, the "Name" button won't show up in the Adjust Last Operation panel anymore. This isn't really useful, and I doubt this was ever intentionally exposed in the UI.
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index a02058fde6b..5ddfc4fe3cc 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -716,7 +716,7 @@ static void view3d_ob_drop_copy_local_id(bContext *UNUSED(C), wmDrag *drag, wmDr
{
ID *id = WM_drag_get_local_ID(drag, ID_OB);
- RNA_string_set(drop->ptr, "name", id->name + 2);
+ RNA_int_set(drop->ptr, "session_uuid", id->session_uuid);
/* Don't duplicate ID's which were just imported. Only do that for existing, local IDs. */
BLI_assert(drag->type != WM_DRAG_ASSET);
@@ -751,7 +751,7 @@ static void view3d_ob_drop_copy_external_asset(bContext *UNUSED(C), wmDrag *drag
DEG_relations_tag_update(CTX_data_main(C));
WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, scene);
- RNA_string_set(drop->ptr, "name", id->name + 2);
+ RNA_int_set(drop->ptr, "session_uuid", id->session_uuid);
Base *base = BKE_view_layer_base_find(view_layer, (Object *)id);
if (base != NULL) {