From 650cdc6b2d91b12a80d7c8e680224c4713cfeb5e Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Mon, 22 Oct 2018 17:18:42 +0200 Subject: Drag & Drop: Support Open/Link/Append when dropping .blend file When a .blend file is dropped into Blender a small menu opens. In that menu the user can choose between three options: Open, Link and Append. Reviewers: brecht Differential Revision: https://developer.blender.org/D3801 --- source/blender/windowmanager/intern/wm_files_link.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'source/blender/windowmanager/intern/wm_files_link.c') diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c index f8beb2ef80b..a1e298b91d0 100644 --- a/source/blender/windowmanager/intern/wm_files_link.c +++ b/source/blender/windowmanager/intern/wm_files_link.c @@ -106,11 +106,7 @@ static bool wm_link_append_poll(bContext *C) static int wm_link_append_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { - if (RNA_struct_property_is_set(op->ptr, "filepath")) { - return WM_operator_call_notest(C, op); - } - else { - /* XXX TODO solve where to get last linked library from */ + if (!RNA_struct_property_is_set(op->ptr, "filepath")) { if (G.lib[0] != '\0') { RNA_string_set(op->ptr, "filepath", G.lib); } @@ -120,9 +116,10 @@ static int wm_link_append_invoke(bContext *C, wmOperator *op, const wmEvent *UNU BLI_parent_dir(path); RNA_string_set(op->ptr, "filepath", path); } - WM_event_add_fileselect(C, op); - return OPERATOR_RUNNING_MODAL; } + + WM_event_add_fileselect(C, op); + return OPERATOR_RUNNING_MODAL; } static short wm_link_append_flag(wmOperator *op) -- cgit v1.2.3