[Bf-extensions-cvs] [8372ef96] master: 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.

Clemens Barth noreply at git.blender.org
Thu Jan 13 18:04:01 CET 2022


Commit: 8372ef96ade7a6ec64ef328c0c84c89f9352d493
Author: Clemens Barth
Date:   Thu Jan 13 18:03:14 2022 +0100
Branches: master
https://developer.blender.org/rBA8372ef96ade7a6ec64ef328c0c84c89f9352d493

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.

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

M	io_mesh_atomic/xyz_gui.py

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

diff --git a/io_mesh_atomic/xyz_gui.py b/io_mesh_atomic/xyz_gui.py
index 2b452a61..18df0063 100644
--- a/io_mesh_atomic/xyz_gui.py
+++ b/io_mesh_atomic/xyz_gui.py
@@ -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[:]



More information about the Bf-extensions-cvs mailing list