Scripts: syncregion.py

File syncregion.py, 401 bytes (added by goddard, 10 years ago)
Line 
1# Make all volumes update their region to follow the active volume.
2
3from VolumeViewer import volume_list, active_volume
4def volume_changed(v, type):
5 if type == 'region changed' and v == active_volume():
6 for v2 in volume_list():
7 if v2 != v:
8 v2.new_region(*v.region, adjust_step = False)
9
10for v in volume_list():
11 v.add_volume_change_callback(volume_changed)