diff options
author | Clemens Barth <barth@root-1.de> | 2011-12-26 21:20:44 +0400 |
---|---|---|
committer | Clemens Barth <barth@root-1.de> | 2011-12-26 21:20:44 +0400 |
commit | 910a5a70960aabded7145bff67b276a8b8ae9b27 (patch) | |
tree | ac4b80c85a82ab5108fcb1ed7bb7b1fdc1068715 /io_mesh_pdb/import_pdb.py | |
parent | da8002f8aca1071a73fe1e4e6c98f7c5e24b5884 (diff) |
... only small changes, that's it ...
Cheers,
Blendphys
Diffstat (limited to 'io_mesh_pdb/import_pdb.py')
-rw-r--r-- | io_mesh_pdb/import_pdb.py | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/io_mesh_pdb/import_pdb.py b/io_mesh_pdb/import_pdb.py index 78ec2f74..d007603f 100644 --- a/io_mesh_pdb/import_pdb.py +++ b/io_mesh_pdb/import_pdb.py @@ -415,6 +415,45 @@ def DEF_atom_pdb_radius_all(scale, how): # for showing the sticks. def DEF_atom_pdb_radius_sticks(radius, how): + # Are there any sticks? + Found = False + if how == "ALL_IN_LAYER": + + layers = [] + for i in range(20): + if bpy.context.scene.layers[i] == True: + layers.append(i) + + change_objects = [] + for obj in bpy.context.scene.objects: + for layer in layers: + if obj.layers[layer] == True: + change_objects.append(obj) + + for obj in change_objects: + if len(obj.children) != 0: + if obj.children[0].type == "SURFACE" or obj.children[0].type == "MESH": + if "Stick" in obj.name: + Found = True + else: + if obj.type == "SURFACE" or obj.type == "MESH": + if "Stick" in obj.name: + Found = True + + if how == "ALL_ACTIVE": + for obj in bpy.context.selected_objects: + if len(obj.children) != 0: + if obj.children[0].type == "SURFACE" or obj.children[0].type == "MESH": + if "Stick" in obj.name: + Found = True + else: + if obj.type == "SURFACE" or obj.type == "MESH": + if "Stick" in obj.name: + Found = True + + if Found == False: + return False + if how == "ALL_IN_LAYER": layers = [] @@ -450,6 +489,7 @@ def DEF_atom_pdb_radius_sticks(radius, how): if "Stick" not in obj.name: obj.scale = (radius,) * 3 + return True # This reads a custom data file. |