[chimera-dev] Re: Chimera at NCMI
Thomas Goddard
goddard at cgl.ucsf.EDU
Wed Dec 4 10:05:27 PST 2002
Hi Steve,
Each Chimera model can be active or inactive. This terminology is
a bit confusing. It really means movable or fixed. If you bring
up the the Model Panel (under Controllers menu) there is a column of
checkbuttons so you can activate or deactivate any of the models.
Then mouse actions will only move the active ones.
For interactive docking you have to switch back and forth alot
between rotating all models and rotating just one. I wrote some
Python code for another docker to make Chimera accelerators that do
this. I include the python code below. It defines keyboard accelerators
0, 1, 2, 3, 4, 5 which activate model #0, #1, ... only. It also defines
and accelerator "aa" that activates all models. To use these bring up
the accelerator dialog, menu Extensions/Keyboard/Accelerator List.
Then change the accelerator file entry field to give the path to
the code below, and press the load button. This will be remembered
for you next Chimera session so you won't have to do it again.
Then turn on the accelerators with the switch on the accelerator dialog.
You may want to use Extensions/Manager, click show start buttons, and
click the button to autostart accelerators whenever you start Chimera.
For more on Chimera accelerators press the Help button on the Accelerator
dialog. It explains how to switch between using Midas commands and
accelerators.
Tom
----
activate_accel.py follows:
# -----------------------------------------------------------------------------
#
def register_accelerators():
from Accelerators import standard_accelerators, add_accelerator
reload(standard_accelerators)
standard_accelerators.register_accelerators()
add_accelerator('0', 'Activate model 0 only', lambda: activate_model_n_only(0))
add_accelerator('1', 'Activate model 1 only', lambda: activate_model_n_only(1))
add_accelerator('2', 'Activate model 2 only', lambda: activate_model_n_only(2))
add_accelerator('3', 'Activate model 3 only', lambda: activate_model_n_only(3))
add_accelerator('4', 'Activate model 4 only', lambda: activate_model_n_only(4))
add_accelerator('5', 'Activate model 5 only', lambda: activate_model_n_only(5))
add_accelerator('aa', 'Activate all models', activate_all_models)
# -----------------------------------------------------------------------------
#
def activate_model_n_only(n):
from chimera import openModels
for m in openModels.list(all = 1):
m.openState.active = (m.id == n)
# -----------------------------------------------------------------------------
#
def activate_all_models():
from chimera import openModels
for m in openModels.list(all = 1):
m.openState.active = 1
More information about the Chimera-dev
mailing list