schrodinger / pymol-open-source

Open-source foundation of the user-sponsored PyMOL molecular visualization system.
https://pymol.org/
Other
1.2k stars 281 forks source link

Create selection by state #218

Open AlessioDelConte opened 2 years ago

AlessioDelConte commented 2 years ago

Hello, I was wondering if it is possible to create a selection from the python API that changes with the state of the object. In my case this will be very useful because I'm trying to select residues that are in contact (calculated with another software) in a certain state, but I would prefer not to create one selection for every state of the object.

Alessio

cyril-schroeder-ox commented 2 years ago

Hi Alessio, That's literally what I've been implementing in the last couple of days and will open an issue about it. It would be nice to have access to the internal event scheduler and update the selections based on the state directly. I worked around it by creating an update function which takes care of the proper selection for a given frame, but I need to manually call it each time I select a new frame ... Best, Cyril