forked from Pymol-Scripts/Pymol-script-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stereo_ray.py
39 lines (28 loc) · 1011 Bytes
/
stereo_ray.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'''
See more here: http://www.pymolwiki.org/index.php/stereo_ray
'''
from pymol import cmd
def stereo_ray(filename, width=0, height=0, quiet=1):
'''
DESCRIPTION
"stereo_ray" ray-traces the current scene twice (separated by
a six-degree rotation around the y axis)
and saves a pair of images that can be combined in any image
manipulation software to form a stereoimage.
The first argument, the output file name, is mandatory.
The second and third arguments, the size of the image, are not.
If the width is given, the height will be calculated.
USAGE
stereo_ray filename [, width [, height]]
EXAMPLE
stereo_ray output, 1000, 600
stereo_ray secondImage.png
'''
if filename.lower().endswith('.png'):
filename = filename[:-4]
cmd.ray(width, height, angle=-3)
cmd.png(filename + "_r", quiet=quiet)
cmd.ray(width, height, angle=3)
cmd.png(filename + "_l", quiet=quiet)
cmd.extend('stereo_ray', stereo_ray)
# vi:expandtab:sw=3