Commit: da7a3424786043ae799fc6915347021872f5216b
Author: Sybren A. Stüvel
Date:   Fri Dec 28 16:40:08 2018 +0100
Branches: master
https://developer.blender.org/rBda7a3424786043ae799fc6915347021872f5216b

Alembic import: lock interface while importing

This prevents crashes caused by the viewport evaluating the depsgraph while
the import is still running.

===================================================================

M       source/blender/alembic/intern/alembic_capi.cc

===================================================================

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);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to