T94008, T94292

When importing a PDB file, the user has to be in the 'OBJECT' mode. With the changes
in the code, this mode is automatically set before the PDB import. No error message should
appear when the 'EDIT' mode is still active.
This commit is contained in:
Clemens Barth 2022-01-13 18:03:14 +01:00
parent 158b85876a
commit 8372ef96ad
1 changed files with 2 additions and 0 deletions

View File

@ -153,6 +153,8 @@ class IMPORT_OT_xyz(Operator, ImportHelper):
col.prop(self, "images_per_key")
def execute(self, context):
# To be on the safe side, we switch to the 'OBJECT' mode.
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
del ALL_FRAMES[:]
del ELEMENTS[:]