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>2020-03-06 18:22:28 +0300
committerJulian Eisel <julian@blender.org>2020-03-06 18:27:13 +0300
commitd5572eacc5958db38ac4a4a32eddb3a2cd24bf68 (patch)
tree5252d8f509dae02bf9c137a1710c073d5bbac592 /source/blender/windowmanager/intern/wm_files_link.c
parentb242cc67928a6858a835c088e4d3ea8822c83168 (diff)
Cleanup: Reduce context usage in UI functions
Part of https://developer.blender.org/T74429. There's a chance that this causes some issues becaue in some cases we change from getting the window from context to getting it from somewhere else.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_files_link.c')
-rw-r--r--source/blender/windowmanager/intern/wm_files_link.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c
index c6d4c13c411..73c7a6209ee 100644
--- a/source/blender/windowmanager/intern/wm_files_link.c
+++ b/source/blender/windowmanager/intern/wm_files_link.c
@@ -623,13 +623,14 @@ void WM_OT_append(wmOperatorType *ot)
*
* \{ */
-ID *WM_file_append_datablock(bContext *C,
+ID *WM_file_append_datablock(Main *bmain,
+ Scene *scene,
+ ViewLayer *view_layer,
+ View3D *v3d,
const char *filepath,
const short id_code,
const char *id_name)
{
- Main *bmain = CTX_data_main(C);
-
/* Tag everything so we can make local only the new datablock. */
BKE_main_id_tag_all(bmain, LIB_TAG_PRE_EXISTING, true);
@@ -641,9 +642,6 @@ ID *WM_file_append_datablock(bContext *C,
BLI_BITMAP_ENABLE(item->libraries, 0);
/* Link datablock. */
- Scene *scene = CTX_data_scene(C);
- ViewLayer *view_layer = CTX_data_view_layer(C);
- View3D *v3d = CTX_wm_view3d(C);
wm_link_do(lapp_data, NULL, bmain, scene, view_layer, v3d);
/* Get linked datablock and free working data. */