diff options
author | Julian Eisel <julian@blender.org> | 2022-05-23 21:54:15 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-05-23 22:00:01 +0300 |
commit | 8f79fa9c6780dd5526dccce039c49bc7f69f47df (patch) | |
tree | 25c22e1473eb5967cf07058d22a5f49947894cf8 /source/blender/editors/object/object_relations.c | |
parent | 0d6dda4555bcae82cf581bdb23d639e9733057b5 (diff) |
Fix further issues when mixing link & append for asset drag & drop
917c096be6b9 applied to objects only, this also applies the same fix for
the general 3D View drop operations, e.g. used for dragging materials,
images, worlds, etc.
This is needed to fix T95706, but apparently something else is still
going on. Needs further investigation.
Diffstat (limited to 'source/blender/editors/object/object_relations.c')
-rw-r--r-- | source/blender/editors/object/object_relations.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 76dcfbd8d36..0a85a60eda8 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -2629,11 +2629,9 @@ static int drop_named_material_invoke(bContext *C, wmOperator *op, const wmEvent Object *ob = ED_view3d_give_material_slot_under_cursor(C, event->mval, &mat_slot); mat_slot = max_ii(mat_slot, 1); - Material *ma; - char name[MAX_ID_NAME - 2]; + Material *ma = (Material *)WM_operator_properties_id_lookup_from_name_or_session_uuid( + bmain, op, ID_MA); - RNA_string_get(op->ptr, "name", name); - ma = (Material *)BKE_libblock_find_name(bmain, ID_MA, name); if (ob == NULL || ma == NULL) { return OPERATOR_CANCELLED; } @@ -2663,7 +2661,7 @@ void OBJECT_OT_drop_named_material(wmOperatorType *ot) ot->flag = OPTYPE_UNDO | OPTYPE_INTERNAL; /* properties */ - RNA_def_string(ot->srna, "name", "Material", MAX_ID_NAME - 2, "Name", "Material name to assign"); + WM_operator_properties_id_lookup(ot, true); } /** \} */ |