Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClemens Barth <barth@root-1.de>2022-01-13 19:59:01 +0300
committerClemens Barth <barth@root-1.de>2022-01-13 19:59:01 +0300
commit158b85876a0e8410db2e009f4fc324bb049089aa (patch)
treecfe54844f5188028082ba62848a1a4b1f28aa8b0 /io_mesh_atomic
parent880efe429a65eb33f731dc72a9a14ee25fae7c03 (diff)
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.
Diffstat (limited to 'io_mesh_atomic')
-rw-r--r--io_mesh_atomic/pdb_gui.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/io_mesh_atomic/pdb_gui.py b/io_mesh_atomic/pdb_gui.py
index 00a4ca97..f77e2ef4 100644
--- a/io_mesh_atomic/pdb_gui.py
+++ b/io_mesh_atomic/pdb_gui.py
@@ -203,6 +203,9 @@ class IMPORT_OT_pdb(Operator, ImportHelper):
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)
+
# This is in order to solve this strange 'relative path' thing.
filepath_pdb = bpy.path.abspath(self.filepath)