[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3923] trunk/py/scripts/addons/ io_mesh_pdb: As discussed a couple of times in the IRC chat, we decided to separate the
Clemens Barth
barth at root-1.de
Sat Nov 3 20:38:28 CET 2012
Revision: 3923
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3923
Author: blendphys
Date: 2012-11-03 19:38:28 +0000 (Sat, 03 Nov 2012)
Log Message:
-----------
As discussed a couple of times in the IRC chat, we decided to separate the
panel from the import/export addons. This means that the panel has had to be
removed also from the PDB importer/exporter. This is what I have done.
Attention, this is a major change of the Atomic Blender PDB importer/exporter!
A lot of test today have shown, that the new version of the PDB
importer/exporter has not lost its stability. In the next days, I will perform
other stability tests.
Blendphys
Modified Paths:
--------------
trunk/py/scripts/addons/io_mesh_pdb/__init__.py
trunk/py/scripts/addons/io_mesh_pdb/import_pdb.py
Modified: trunk/py/scripts/addons/io_mesh_pdb/__init__.py
===================================================================
--- trunk/py/scripts/addons/io_mesh_pdb/__init__.py 2012-11-03 19:32:07 UTC (rev 3922)
+++ trunk/py/scripts/addons/io_mesh_pdb/__init__.py 2012-11-03 19:38:28 UTC (rev 3923)
@@ -21,23 +21,26 @@
# Authors : Clemens Barth (Blendphys at root-1.de), ...
#
# Homepage(Wiki) : http://development.root-1.de/Atomic_Blender.php
-# Tracker : http://projects.blender.org/tracker/index.php?func=detail&aid=29226&group_id=153&atid=467
#
# Start of project : 2011-08-31 by Clemens Barth
# First publication in Blender : 2011-11-11
-# Last modified : 2012-10-14
+# Last modified : 2012-11-03
#
-# Acknowledgements: Thanks to ideasman, meta_androcto, truman, kilon,
-# dairin0d, PKHG, Valter, etc
+# Acknowledgements
+# ================
#
+# Blender: ideasman, meta_androcto, truman, kilon, CoDEmanX, dairin0d, PKHG,
+# Valter, ...
+# Other: Frank Palmino
+#
bl_info = {
- "name": "PDB Atomic Blender",
+ "name": "Atomic Blender - PDB",
"description": "Loading and manipulating atoms from PDB files",
"author": "Clemens Barth",
- "version": (1,3),
+ "version": (1,5),
"blender": (2,6),
- "location": "File -> Import -> PDB (.pdb), Panel: View 3D - Tools",
+ "location": "File -> Import -> PDB (.pdb)",
"warning": "",
"wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/"
"Py/Scripts/Import-Export/PDB",
@@ -61,502 +64,10 @@
from . import import_pdb
from . import export_pdb
-ATOM_PDB_ERROR = ""
-ATOM_PDB_PANEL = ""
-
# -----------------------------------------------------------------------------
# GUI
-# The panel, which is loaded after the file has been
-# chosen via the menu 'File -> Import'
-class CLASS_atom_pdb_panel(Panel):
- bl_label = "PDB - Atomic Blender"
- bl_space_type = "VIEW_3D"
- bl_region_type = "TOOL_PROPS"
- @classmethod
- def poll(self, context):
- global ATOM_PDB_PANEL
-
- if ATOM_PDB_PANEL == "0" and import_pdb.ATOM_PDB_FILEPATH == "":
- return False
- if ATOM_PDB_PANEL == "0" and import_pdb.ATOM_PDB_FILEPATH != "":
- return True
- if ATOM_PDB_PANEL == "1":
- return True
- if ATOM_PDB_PANEL == "2":
- return False
-
- return True
-
- 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()
- row.label(text="Outputs and custom data file")
- box = layout.box()
- row = box.row()
- row.label(text="Custom data file")
- row = box.row()
- col = row.column()
- col.prop(scn, "datafile")
- col.operator("atom_pdb.datafile_apply")
- row = box.row()
- col = row.column(align=True)
- col.prop(scn, "PDB_file")
- row = layout.row()
- row.label(text="Reload structure")
- box = layout.box()
- row = box.row()
- col = row.column()
- col.prop(scn, "use_mesh")
- col = row.column()
- col.label(text="Scaling factors")
- row = box.row()
- col = row.column(align=True)
- col.active = scn.use_mesh
- col.prop(scn, "mesh_azimuth")
- col.prop(scn, "mesh_zenith")
- col = row.column(align=True)
- col.prop(scn, "scale_ballradius")
- col.prop(scn, "scale_distances")
- row = box.row()
- col = row.column()
- col.prop(scn, "use_sticks")
- row = box.row()
- row.active = scn.use_sticks
- col = row.column(align=True)
- col.prop(scn, "sticks_sectors")
- col.prop(scn, "sticks_radius")
- col.prop(scn, "sticks_unit_length")
- col = row.column(align=True)
- col.prop(scn, "use_sticks_color")
- col.prop(scn, "use_sticks_smooth")
- col.prop(scn, "use_sticks_bonds")
- row = box.row()
- row.active = scn.use_sticks
- col = row.column(align=True)
- col = row.column(align=True)
- col.active = scn.use_sticks and scn.use_sticks_bonds
- col.prop(scn, "sticks_dist")
- row = box.row()
- row.prop(scn, "use_center")
- row = box.row()
- col = row.column()
- col.prop(scn, "use_camera")
- col.prop(scn, "use_lamp")
- col = row.column()
- col.operator("atom_pdb.button_reload")
- col.prop(scn, "number_atoms")
- row = box.row()
- row.operator("atom_pdb.button_distance")
- row.prop(scn, "distance")
- row = layout.row()
- row.label(text="Modify atom radii")
- box = layout.box()
- row = box.row()
- row.label(text="All changes concern:")
- row = box.row()
- row.prop(scn, "radius_how")
- row = box.row()
- row.label(text="1. Change type of radii")
- row = box.row()
- row.prop(scn, "radius_type")
- row = box.row()
- row.label(text="2. Change atom radii in pm")
- row = box.row()
- row.prop(scn, "radius_pm_name")
- row = box.row()
- row.prop(scn, "radius_pm")
- row = box.row()
- row.label(text="3. Change atom radii by scale")
- row = box.row()
- col = row.column()
- col.prop(scn, "radius_all")
- col = row.column(align=True)
- col.operator( "atom_pdb.radius_all_bigger" )
- col.operator( "atom_pdb.radius_all_smaller" )
- row = box.row()
- row.label(text="4. Show sticks only")
- row = box.row()
- col = row.column()
- col.operator( "atom_pdb.radius_sticks" )
-
- if bpy.context.mode == 'EDIT_MESH':
- row = layout.row()
- row.label(text="Separate atom")
- box = layout.box()
- row = box.row()
- row.operator( "atom_pdb.separate_atom" )
-
-
-# The properties (gadgets) in the panel. They all go to scene
-# during initialization (see end)
-class CLASS_atom_pdb_Properties(bpy.types.PropertyGroup):
-
- def Callback_radius_type(self, context):
- scn = bpy.context.scene.atom_pdb[0]
- import_pdb.DEF_atom_pdb_radius_type(
- scn.radius_type,
- scn.radius_how,)
-
- def Callback_radius_pm(self, context):
- scn = bpy.context.scene.atom_pdb[0]
- import_pdb.DEF_atom_pdb_radius_pm(
- scn.radius_pm_name,
- scn.radius_pm,
- scn.radius_how,)
-
- # In the file dialog window - Import
- use_camera = BoolProperty(
- name="Camera", default=False,
- description="Do you need a camera?")
- use_lamp = BoolProperty(
- name="Lamp", default=False,
- description = "Do you need a lamp?")
- use_mesh = BoolProperty(
- name = "Mesh balls", default=False,
- description = "Use mesh balls instead of NURBS")
- mesh_azimuth = IntProperty(
- name = "Azimuth", default=32, min=1,
- description = "Number of sectors (azimuth)")
- mesh_zenith = IntProperty(
- name = "Zenith", default=32, min=1,
- description = "Number of sectors (zenith)")
- scale_ballradius = FloatProperty(
- name = "Balls", default=1.0, min=0.0001,
- description = "Scale factor for all atom radii")
- scale_distances = FloatProperty (
- name = "Distances", default=1.0, min=0.0001,
- description = "Scale factor for all distances")
- use_center = BoolProperty(
- name = "Object to origin", default=True,
- description = "Put the object into the global origin")
- use_sticks = BoolProperty(
- name="Use sticks", default=True,
- description="Do you want to display the sticks?")
- sticks_sectors = IntProperty(
- name = "Sector", default=20, min=1,
- description="Number of sectors of a stick")
- sticks_radius = FloatProperty(
- name = "Radius", default=0.1, min=0.0001,
- description ="Radius of a stick")
- sticks_unit_length = FloatProperty(
- name = "Unit", default=0.05, min=0.0001,
- description = "Length of the unit of a stick in Angstrom")
- use_sticks_color = BoolProperty(
- name="Color", default=True,
- description="The sticks appear in the color of the atoms")
- use_sticks_smooth = BoolProperty(
- name="Smooth", default=False,
- description="The sticks are round (sectors are not visible)")
- use_sticks_bonds = BoolProperty(
- name="Bonds", default=False,
- description="Show double and tripple bonds.")
- sticks_dist = FloatProperty(
- name="Distance", default = 1.1, min=1.0, max=3.0,
- description="Distance between sticks measured in stick diameter")
- atomradius = EnumProperty(
- name="Type of radius",
- description="Choose type of atom radius",
- items=(('0', "Pre-defined", "Use pre-defined radius"),
- ('1', "Atomic", "Use atomic radius"),
- ('2', "van der Waals", "Use van der Waals radius")),
- default='0',)
- # In the panel
- datafile = StringProperty(
- name = "", description="Path to your custom data file",
- maxlen = 256, default = "", subtype='FILE_PATH')
- PDB_file = StringProperty(
- name = "PDB file", default="",
- description = "Path of the PDB file")
- number_atoms = StringProperty(name="",
- default="Number", description = "This output shows "
- "the number of atoms which have been loaded")
- distance = StringProperty(
- name="", default="Distance (A)",
- description="Distance of 2 objects in Angstrom")
- radius_how = EnumProperty(
- name="",
- description="Which objects shall be modified?",
- items=(('ALL_ACTIVE',"all active objects", "in the current layer"),
- ('ALL_IN_LAYER',"all"," in active layer(s)")),
- default='ALL_ACTIVE',)
- radius_type = EnumProperty(
- name="Type",
- description="Which type of atom radii?",
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list