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:
authorSybren A. Stüvel <sybren@stuvel.eu>2018-12-28 18:40:08 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2018-12-28 18:47:58 +0300
commitda7a3424786043ae799fc6915347021872f5216b (patch)
treeb5e4ccc7c77afaf75ccc6156a1c0727b3790c52f /source/blender/alembic
parentc5095077148549b16d9eb72d56faa0427d51828e (diff)
Alembic import: lock interface while importing
This prevents crashes caused by the viewport evaluating the depsgraph while the import is still running.
Diffstat (limited to 'source/blender/alembic')
-rw-r--r--source/blender/alembic/intern/alembic_capi.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/alembic/intern/alembic_capi.cc b/source/blender/alembic/intern/alembic_capi.cc
index fbbfb4e7605..d5431d13d0a 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -632,6 +632,7 @@ struct ImportJobData {
Main *bmain;
Scene *scene;
ViewLayer *view_layer;
+ wmWindowManager *wm;
char filename[1024];
ImportSettings settings;
@@ -657,6 +658,8 @@ static void import_startjob(void *user_data, short *stop, short *do_update, floa
data->do_update = do_update;
data->progress = progress;
+ WM_set_locked_interface(data->wm, true);
+
ArchiveReader *archive = new ArchiveReader(data->filename);
if (!archive->valid()) {
@@ -836,6 +839,8 @@ static void import_endjob(void *user_data)
}
}
+ WM_set_locked_interface(data->wm, false);
+
switch (data->error_code) {
default:
case ABC_NO_ERROR:
@@ -868,6 +873,7 @@ bool ABC_import(bContext *C, const char *filepath, float scale, bool is_sequence
job->bmain = CTX_data_main(C);
job->scene = CTX_data_scene(C);
job->view_layer = CTX_data_view_layer(C);
+ job->wm = CTX_wm_manager(C);
job->import_ok = false;
BLI_strncpy(job->filename, filepath, 1024);