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>2012-11-04 04:53:55 +0400
committerClemens Barth <barth@root-1.de>2012-11-04 04:53:55 +0400
commitbbad0a24d9361dcd2cfd37b68426f87b3921ccb8 (patch)
treeed89ec71373f3ad0926e426e060ffaa9dd44a642 /io_mesh_pdb/import_pdb.py
parent4a26b71a377679c0f5ff0ed7e5ee01db71446454 (diff)
Also here: rotation of camera fixed.
Blendphys
Diffstat (limited to 'io_mesh_pdb/import_pdb.py')
-rw-r--r--io_mesh_pdb/import_pdb.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/io_mesh_pdb/import_pdb.py b/io_mesh_pdb/import_pdb.py
index f033b531..eb0e2668 100644
--- a/io_mesh_pdb/import_pdb.py
+++ b/io_mesh_pdb/import_pdb.py
@@ -711,7 +711,7 @@ def DEF_atom_pdb_main(use_mesh,
camera = bpy.data.objects.new("A_camera", camera_data)
camera.location = camera_xyz_vec
camera.layers = current_layers
- bpy.context.scene.objects.link(camera)
+ bpy.context.scene.objects.link(camera)
# Here the camera is rotated such it looks towards the center of
# the object. The [0.0, 0.0, 1.0] vector along the z axis
@@ -722,11 +722,12 @@ def DEF_atom_pdb_main(use_mesh,
axis_vec = z_axis_vec.cross(object_camera_vec)
# Rotate 'axis_vec' by 'angle' and convert this to euler parameters.
# 4 is the size of the matrix.
- euler = Matrix.Rotation(angle, 4, axis_vec).to_euler()
- camera.rotation_euler = euler
+ camera.rotation_euler = Matrix.Rotation(angle, 4, axis_vec).to_euler()
# Rotate the camera around its axis by 90° such that we have a nice
# camera position and view onto the object.
+ bpy.ops.object.select_all(action='DESELECT')
+ camera.select = True
bpy.ops.transform.rotate(value=(90.0*2*math.pi/360.0),
axis=object_camera_vec,
constraint_axis=(False, False, False),