Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClemens Barth <barth@root-1.de>2019-03-29 22:33:17 +0300
committerClemens Barth <barth@root-1.de>2019-03-29 22:33:17 +0300
commit6c87db255114aa97bc1aa105a439bfd7b11b61e6 (patch)
tree395b501b30ea68c6a25984f5e831d4dd386c0e43 /io_mesh_atomic
parent50ea2790f91788f247225be88b8e7a97c7bfb937 (diff)
Fix 1: Atomic structures based on meta spheres were not visible because the meta balls were hidden by default, T62804
Fix 2: Option 'Mesh UV spheres' for atomic structures lead to an error message, T62804 Comments ======== 1: It i strange that a representative mesh sphere or NURBS sphere in a dupliverts structure can be hidden, which is not the case for meta balls. A representative meta ball needs to be 'visible' and not hidden. By default this is now the case. 2: The 'size' option in 'bpy.ops.mesh.primitive_uv_sphere_add' does not exist anymore. Option 'size' was removed.
Diffstat (limited to 'io_mesh_atomic')
-rw-r--r--io_mesh_atomic/pdb_import.py6
-rw-r--r--io_mesh_atomic/xyz_import.py6
2 files changed, 8 insertions, 4 deletions
diff --git a/io_mesh_atomic/pdb_import.py b/io_mesh_atomic/pdb_import.py
index 06a808c0..4f0bddd8 100644
--- a/io_mesh_atomic/pdb_import.py
+++ b/io_mesh_atomic/pdb_import.py
@@ -707,7 +707,7 @@ def draw_atoms_one_type(draw_all_atoms_type,
elif Ball_type == "1":
bpy.ops.mesh.primitive_uv_sphere_add(
segments=Ball_azimuth, ring_count=Ball_zenith,
- size=1, view_align=False, enter_editmode=False,
+ view_align=False, enter_editmode=False,
location=(0,0,0), rotation=(0, 0, 0))
# Meta balls
elif Ball_type == "2":
@@ -719,7 +719,9 @@ def draw_atoms_one_type(draw_all_atoms_type,
# Hide this ball because its appearance has no meaning. It is just the
# representative ball. The ball is visible at the vertices of the mesh.
# Rememmber, this is a dupliverts construct!
- ball.hide_set(True)
+ # However, hiding does not work with meta balls!
+ if Ball_type == "0" or Ball_type == "1":
+ ball.hide_set(True)
# Scale up/down the ball radius.
ball.scale = (atom[3]*Ball_radius_factor,) * 3
diff --git a/io_mesh_atomic/xyz_import.py b/io_mesh_atomic/xyz_import.py
index fe903f4e..8f6b4c5b 100644
--- a/io_mesh_atomic/xyz_import.py
+++ b/io_mesh_atomic/xyz_import.py
@@ -679,7 +679,7 @@ def import_xyz(Ball_type,
elif Ball_type == "1":
bpy.ops.mesh.primitive_uv_sphere_add(
segments=Ball_azimuth, ring_count=Ball_zenith,
- size=1, view_align=False, enter_editmode=False,
+ view_align=False, enter_editmode=False,
location=(0,0,0), rotation=(0, 0, 0))
# Meta balls
elif Ball_type == "2":
@@ -691,7 +691,9 @@ def import_xyz(Ball_type,
# Hide this ball because its appearance has no meaning. It is just the
# representative ball. The ball is visible at the vertices of the mesh.
# Rememmber, this is a dupliverts construct!
- ball.hide_set(True)
+ # However, hiding does not work with meta balls!
+ if Ball_type == "0" or Ball_type == "1":
+ ball.hide_set(True)
# Scale up/down the ball radius.
ball.scale = (atom.radius*Ball_radius_factor,) * 3