Skip to content
Snippets Groups Projects
Commit 2829c040 authored by Clemens Barth's avatar Clemens Barth
Browse files

T94008, T94292

Check before, if the user is in the 'EDIT_MESH' mode. If so, change to 'OBJECT' mode.
parent 8372ef96
Branches
Tags
No related merge requests found
...@@ -203,8 +203,9 @@ class IMPORT_OT_pdb(Operator, ImportHelper): ...@@ -203,8 +203,9 @@ class IMPORT_OT_pdb(Operator, ImportHelper):
def execute(self, context): def execute(self, context):
# To be on the safe side, we switch to the 'OBJECT' mode. # Switch to 'OBJECT' mode when in 'EDIT' mode.
bpy.ops.object.mode_set(mode='OBJECT', toggle=False) if bpy.context.mode == 'EDIT_MESH':
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
# This is in order to solve this strange 'relative path' thing. # This is in order to solve this strange 'relative path' thing.
filepath_pdb = bpy.path.abspath(self.filepath) filepath_pdb = bpy.path.abspath(self.filepath)
......
...@@ -153,8 +153,9 @@ class IMPORT_OT_xyz(Operator, ImportHelper): ...@@ -153,8 +153,9 @@ class IMPORT_OT_xyz(Operator, ImportHelper):
col.prop(self, "images_per_key") col.prop(self, "images_per_key")
def execute(self, context): def execute(self, context):
# To be on the safe side, we switch to the 'OBJECT' mode. # Switch to 'OBJECT' mode when in 'EDIT' mode.
bpy.ops.object.mode_set(mode='OBJECT', toggle=False) if bpy.context.mode == 'EDIT_MESH':
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
del ALL_FRAMES[:] del ALL_FRAMES[:]
del ELEMENTS[:] del ELEMENTS[:]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment