diff --git a/io_mesh_pdb/__init__.py b/io_mesh_pdb/__init__.py index bed41f996463b3d564500fadfc57491b43a1f9a0..54df0827315fc340dfb6bc85eea604f4724985b9 100644 --- a/io_mesh_pdb/__init__.py +++ b/io_mesh_pdb/__init__.py @@ -113,6 +113,7 @@ class CLASS_atom_pdb_panel(Panel): col = row.column(align=True) col.prop(scn, "atom_pdb_sticks_sectors") col.prop(scn, "atom_pdb_sticks_radius") + col.prop(scn, "atom_pdb_sticks_unit_length") col = row.column(align=True) col.prop(scn, "use_atom_pdb_sticks_color") col.prop(scn, "use_atom_pdb_sticks_smooth") @@ -229,6 +230,9 @@ class CLASS_atom_pdb_IO(bpy.types.PropertyGroup): scn.atom_pdb_sticks_radius = FloatProperty( name = "Radius", default=0.1, min=0.0, description ="Radius of a stick") + scn.atom_pdb_sticks_unit_length = FloatProperty( + name = "Unit", default=0.2, min=0, + description = "Length of the unit of a stick in Angstrom") scn.use_atom_pdb_sticks_color = BoolProperty( name="Color", default=True, description="The sticks appear in the color of the atoms") @@ -499,6 +503,7 @@ class CLASS_atom_pdb_load_button(Operator): sradius = scn.atom_pdb_sticks_radius stick_bond = scn.use_atom_pdb_sticks_bonds stick_dist = scn.atom_pdb_sticks_dist + stick_unit = scn.atom_pdb_sticks_unit_length cam = scn.use_atom_pdb_cam lamp = scn.use_atom_pdb_lamp @@ -508,7 +513,7 @@ class CLASS_atom_pdb_load_button(Operator): # Execute main routine an other time ... from the panel atom_number = import_pdb.DEF_atom_pdb_main( mesh, azimuth, zenith, bradius, radiustype, bdistance, - sticks, sticks_col, sticks_sm, stick_bond, + sticks, sticks_col, sticks_sm, stick_bond, stick_unit, stick_dist, ssector, sradius, center, cam, lamp, datafile) scn.atom_pdb_number_atoms = str(atom_number) + " atoms" @@ -549,9 +554,10 @@ class ImportPDB(Operator, ImportHelper): col.prop(scn, "use_atom_pdb_sticks") row = layout.row() row.active = scn.use_atom_pdb_sticks - col = row.column(align=True) + col = row.column() col.prop(scn, "atom_pdb_sticks_sectors") col.prop(scn, "atom_pdb_sticks_radius") + col.prop(scn, "atom_pdb_sticks_unit_length") col = row.column(align=True) col.prop(scn, "use_atom_pdb_sticks_color") col.prop(scn, "use_atom_pdb_sticks_smooth") @@ -590,6 +596,7 @@ class ImportPDB(Operator, ImportHelper): sradius = scn.atom_pdb_sticks_radius stick_bond = scn.use_atom_pdb_sticks_bonds stick_dist = scn.atom_pdb_sticks_dist + stick_unit = scn.atom_pdb_sticks_unit_length cam = scn.use_atom_pdb_cam lamp = scn.use_atom_pdb_lamp @@ -599,7 +606,7 @@ class ImportPDB(Operator, ImportHelper): # Execute main routine atom_number = import_pdb.DEF_atom_pdb_main( mesh, azimuth, zenith, bradius, radiustype, bdistance, - sticks, sticks_col, sticks_sm, stick_bond, + sticks, sticks_col, sticks_sm, stick_bond, stick_unit, stick_dist, ssector, sradius, center, cam, lamp, datafile) scn.atom_pdb_number_atoms = str(atom_number) + " atoms" diff --git a/io_mesh_pdb/import_pdb.py b/io_mesh_pdb/import_pdb.py index 1c2abe0506b4181bbf664594799624d6f818c8e5..9b90d78b08764f39491714d1665d71c67dc84907 100644 --- a/io_mesh_pdb/import_pdb.py +++ b/io_mesh_pdb/import_pdb.py @@ -567,7 +567,7 @@ def DEF_atom_pdb_custom_datafile(path_datafile): def DEF_atom_pdb_main(use_mesh,Ball_azimuth,Ball_zenith, Ball_radius_factor,radiustype,Ball_distance_factor, use_sticks,use_sticks_color,use_sticks_smooth, - use_sticks_bonds,Stick_dist, + use_sticks_bonds, Stick_unit, Stick_dist, Stick_sectors,Stick_diameter,put_to_center, use_camera,use_lamp,path_datafile): @@ -1186,7 +1186,7 @@ def DEF_atom_pdb_main(use_mesh,Ball_azimuth,Ball_zenith, if use_sticks == True and all_sticks != []: - dl = 0.05 + dl = Stick_unit if use_sticks_color == False: bpy.ops.object.material_slot_add()