Sequential model display controls bound to buttonpanel button?

Hi all, I really like the new sequential model display controls in the daily build - thank you so much for implementing these! Would it be possible to add them as a command, e.g. nextmodel and prevmodel? This way I could add them to my box of buttons, and have them in the main GUI window, without needing to switch over to the model panel. Cheers Oli

Hi Oliver, I am loathe to add a general command that no one will ever type in the command line or put in a command script, and that completely depends on the state of a running graphical tool (e.g. the check states of the model panel Skip buttons). Nonetheless, there is nothing stopping you from defining a special-purpose command for your needs. There are many examples in the Chimera Recipes pages (e.g. Connect nearby atoms | ChimeraX Recipes <https://rbvi.github.io/chimerax-recipes/connect/connect.html>). In your case, since the commands you're defining takes no arguments, the corresponding Python functions would take only a "session" argument, and you could omit the 'required' and 'keyword' arguments in their CmdDesc definitions. The actual Python functions would be pretty simple: def next_model(session): from chimera.model_panel.tool import model_panel mp = model_panel(session, "Model Panel") mp._next_model() def previous_model(session): from chimera.model_panel.tool import model_panel mp = model_panel(session, "Model Panel") mp._previous_model() --Eric Eric Pettersen UCSF Computer Graphics Lab
On Jan 19, 2024, at 8:37 AM, Oliver Clarke via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hi all,
I really like the new sequential model display controls in the daily build - thank you so much for implementing these! Would it be possible to add them as a command, e.g. nextmodel and prevmodel?
This way I could add them to my box of buttons, and have them in the main GUI window, without needing to switch over to the model panel.
Cheers Oli
<PastedGraphic-1.png>_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/

Thanks Eric! Is there any way to run a few simple python functions like this at startup, in the same way that one can add commands to the startup section of the preferences? Cheers Oli
On Jan 19, 2024, at 3:10 PM, Eric Pettersen <pett@cgl.ucsf.edu> wrote:
Hi Oliver, I am loathe to add a general command that no one will ever type in the command line or put in a command script, and that completely depends on the state of a running graphical tool (e.g. the check states of the model panel Skip buttons). Nonetheless, there is nothing stopping you from defining a special-purpose command for your needs. There are many examples in the Chimera Recipes pages (e.g. Connect nearby atoms | ChimeraX Recipes <https://rbvi.github.io/chimerax-recipes/connect/connect.html>). In your case, since the commands you're defining takes no arguments, the corresponding Python functions would take only a "session" argument, and you could omit the 'required' and 'keyword' arguments in their CmdDesc definitions. The actual Python functions would be pretty simple:
def next_model(session): from chimera.model_panel.tool import model_panel mp = model_panel(session, "Model Panel") mp._next_model()
def previous_model(session): from chimera.model_panel.tool import model_panel mp = model_panel(session, "Model Panel") mp._previous_model()
--Eric
Eric Pettersen UCSF Computer Graphics Lab
On Jan 19, 2024, at 8:37 AM, Oliver Clarke via ChimeraX-users <chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu>> wrote:
Hi all,
I really like the new sequential model display controls in the daily build - thank you so much for implementing these! Would it be possible to add them as a command, e.g. nextmodel and prevmodel?
This way I could add them to my box of buttons, and have them in the main GUI window, without needing to switch over to the model panel.
Cheers Oli
<PastedGraphic-1.png>_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu <mailto:chimerax-users-leave@cgl.ucsf.edu> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/

Yes, you put them in a .py file and open that .py file in your startup commands. --Eric
On Jan 19, 2024, at 12:13 PM, Oliver Clarke <olibclarke@gmail.com> wrote:
Thanks Eric!
Is there any way to run a few simple python functions like this at startup, in the same way that one can add commands to the startup section of the preferences?
Cheers Oli
On Jan 19, 2024, at 3:10 PM, Eric Pettersen <pett@cgl.ucsf.edu> wrote:
Hi Oliver, I am loathe to add a general command that no one will ever type in the command line or put in a command script, and that completely depends on the state of a running graphical tool (e.g. the check states of the model panel Skip buttons). Nonetheless, there is nothing stopping you from defining a special-purpose command for your needs. There are many examples in the Chimera Recipes pages (e.g. Connect nearby atoms | ChimeraX Recipes <https://rbvi.github.io/chimerax-recipes/connect/connect.html>). In your case, since the commands you're defining takes no arguments, the corresponding Python functions would take only a "session" argument, and you could omit the 'required' and 'keyword' arguments in their CmdDesc definitions. The actual Python functions would be pretty simple:
def next_model(session): from chimera.model_panel.tool import model_panel mp = model_panel(session, "Model Panel") mp._next_model()
def previous_model(session): from chimera.model_panel.tool import model_panel mp = model_panel(session, "Model Panel") mp._previous_model()
--Eric
Eric Pettersen UCSF Computer Graphics Lab
On Jan 19, 2024, at 8:37 AM, Oliver Clarke via ChimeraX-users <chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu>> wrote:
Hi all,
I really like the new sequential model display controls in the daily build - thank you so much for implementing these! Would it be possible to add them as a command, e.g. nextmodel and prevmodel?
This way I could add them to my box of buttons, and have them in the main GUI window, without needing to switch over to the model panel.
Cheers Oli
<PastedGraphic-1.png>_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu <mailto:chimerax-users-leave@cgl.ucsf.edu> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/ <https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/>
participants (2)
-
Eric Pettersen
-
Oliver Clarke