Hi Mirko,
I don't totally understand the details of what you need, but here's some info. If you rotate a selected model using the "Rotate model" mouse mode then its position matrix changes. First Python to get the list of selected models is
session.selection.models()
If it is a volume (ie map) model that got rotated then I could find the selected volumes like this
from chimerax.map import Volume
volumes = [v for v in session.selection.models() if isinstance(v, Volume)]
And if I wanted to print their 3x4 position matrices (first 3 columns are the rotation, 4th column is a translation done after rotation)
for v in volumes:
print (v.position.matrix)
Now I don't know what you mean by "update the rotation angles". Are you trying to record Euler angles? If so you could get the Euler angles in z-x-z convention like this
from chimerax.geometry.matrix import euler_angles
for v in volumes:
alpha, beta, gamma = euler_angles(v.position.matrix) # Angles in degrees
print ('Volume %s Euler angles %.2f %.2f %.2f degrees (z-x-z convention)' % (v.name_with_id(), alpha, beta, gamma)
In Chimera the openModels object holds the list of models. In ChimeraX this is session.models. For example to show the names of all models:
for m in session.models.list():
print ('#' + m.id_string + ' ' + m.name)
The programmer documentation
has info about the various ChimeraX functions, for instance for models
https://www.cgl.ucsf.edu/chimerax/docs/devel/core/models.html
There is some example Python code at the ChimeraX recipes web site that can be useful.
Back in March 2021 I was talking with Matthias Vorlander to place a subtomogram average at positions in a tomogram given by a Relion STAR file.
I've attached the code we came up with. Maybe that will be useful to you.
I am happy to answer more programming questions. Keep sending them to this list unless you want to send private data in which case you can send directly to me.
Tom