Skip to content
Snippets Groups Projects
Commit e5327afc authored by Kévin Dietrich's avatar Kévin Dietrich
Browse files

Fix T54326: Import Alembic stuck in edit mode

Switch to object mode before doing the import.
parent 07b07e53
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,8 @@
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "ED_object.h"
#include "UI_interface.h"
#include "UI_resources.h"
......@@ -543,6 +545,22 @@ static int wm_alembic_import_exec(bContext *C, wmOperator *op)
}
}
/* Switch to object mode to avoid being stuck in other modes (T54326). */
if (CTX_data_mode_enum(C) != CTX_MODE_OBJECT) {
Object *obedit = CTX_data_edit_object(C);
if (obedit != NULL) {
ED_object_mode_toggle(C, obedit->mode);
}
else {
Object *ob = CTX_data_active_object(C);
if (ob) {
ED_object_mode_toggle(C, ob->mode);
}
}
}
bool ok = ABC_import(C, filename, scale, is_sequence, set_frame_range,
sequence_len, offset, validate_meshes,
as_background_job);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment