From c1421af477700431013c49c6e24b502fedd21c6b Mon Sep 17 00:00:00 2001
From: Clemens Barth <barth@root-1.de>
Date: Wed, 18 Apr 2012 19:19:18 +0000
Subject: [PATCH] The Atomic Blender panel is loaded correctly when a blend
 file is loaded.

Blendphys.
---
 io_mesh_pdb/__init__.py   | 5 +++++
 io_mesh_pdb/export_pdb.py | 2 +-
 io_mesh_pdb/import_pdb.py | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/io_mesh_pdb/__init__.py b/io_mesh_pdb/__init__.py
index 3a479dbd1..883e99890 100644
--- a/io_mesh_pdb/__init__.py
+++ b/io_mesh_pdb/__init__.py
@@ -75,6 +75,11 @@ class CLASS_atom_pdb_panel(Panel):
 
     def draw(self, context):
         layout = self.layout
+
+        # This is for the case that a blend file is loaded. 
+        if len(context.scene.atom_pdb) == 0:
+            bpy.context.scene.atom_pdb.add()
+
         scn    = context.scene.atom_pdb[0]
 
         row = layout.row()
diff --git a/io_mesh_pdb/export_pdb.py b/io_mesh_pdb/export_pdb.py
index e47003610..ea4a761e5 100644
--- a/io_mesh_pdb/export_pdb.py
+++ b/io_mesh_pdb/export_pdb.py
@@ -25,7 +25,7 @@
 #
 #  Start of project              : 2011-08-31 by Clemens Barth
 #  First publication in Blender  : 2011-11-11
-#  Last modified                 : 2012-03-23
+#  Last modified                 : 2012-04-18
 #
 #  Acknowledgements: Thanks to ideasman, meta_androcto, truman, kilon,
 #  dairin0d, PKHG, Valter, etc
diff --git a/io_mesh_pdb/import_pdb.py b/io_mesh_pdb/import_pdb.py
index b4f52af50..e9decb0c1 100644
--- a/io_mesh_pdb/import_pdb.py
+++ b/io_mesh_pdb/import_pdb.py
@@ -25,7 +25,7 @@
 #
 #  Start of project              : 2011-08-31 by Clemens Barth
 #  First publication in Blender  : 2011-11-11
-#  Last modified                 : 2012-03-23
+#  Last modified                 : 2012-04-18
 #
 #  Acknowledgements: Thanks to ideasman, meta_androcto, truman, kilon,
 #  dairin0d, PKHG, Valter, etc
-- 
GitLab