diff options
author | Jacques Lucke <mail@jlucke.com> | 2018-10-22 18:18:42 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2018-10-22 18:18:42 +0300 |
commit | 650cdc6b2d91b12a80d7c8e680224c4713cfeb5e (patch) | |
tree | 0a568ce7f9f097ee2817e3d6c069f392e8366418 /source/blender/windowmanager/intern | |
parent | 0628fe7a6cf33bec370a4db53bb9d5980fa40162 (diff) |
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
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files_link.c | 11 |
1 files changed, 4 insertions, 7 deletions
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) |