-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobj_arrows.py
34 lines (33 loc) · 1.09 KB
/
obj_arrows.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
from pymol import cmd
def move_down():
enabled_objs = cmd.get_names("objects",enabled_only=1)
all_objs = cmd.get_names("objects",enabled_only=0)
for obj in enabled_objs:
cmd.disable(obj)
last_obj=obj
for i in range(0,len(all_objs)):
if all_objs[i] == obj:
if i+1 >= len(all_objs):
cmd.enable( all_objs[0] )
else:
cmd.enable( all_objs[i+1] )
cmd.orient
def move_up():
enabled_objs = cmd.get_names("objects",enabled_only=1)
all_objs = cmd.get_names("objects",enabled_only=0)
for obj in enabled_objs:
cmd.disable(obj)
last_obj=obj
for i in range(0,len(all_objs)):
if all_objs[i] == obj:
if i-1 < 0:
cmd.enable( all_objs[-1] )
else:
cmd.enable( all_objs[i-1] )
cmd.orient
cmd.set_key('pgup', move_up)
cmd.set_key('pgdn', move_down)
#cmd.set_key('up', move_up)
#cmd.set_key('down', move_down)
#cmd.set_key('left', move_up)
#cmd.set_key('right', move_down)