
Hi Eric, Oops! That is easier! What I meant by the needed change "isn't too obvious" is that I thought my code would have a line that says "rotate_bond(bond, angle)" and then I would change it to "rotate_bond(bond, angle, move_smaller = False)". But in fact the code makes something called a BondRotater in one place (when the mouse is pressed) and later when the mouse is dragged uses that BondRotater object br.angle = new_angle. This just required a bit of digging, especially to make the more useful code modification that allows you to control which side where I needed to find out how to change the BondRotater to rotate the side closest to the button click (where I don't care which side is smaller). None of that was meant as a critique of the code. I just wanted to warn anyone new to hacking ChimeraX that this isn't the simplest possible kind of change, like changing a False to a True somewhere. Tom
On Dec 6, 2019, at 3:19 PM, Eric Pettersen <pett@cgl.ucsf.edu> wrote:
On Dec 6, 2019, at 3:11 PM, Tom Goddard <goddard@sonic.net <mailto:goddard@sonic.net>> wrote:
br = self.session.bond_rotations.new_rotation(pick.bond) br.moving_side = br.bond.other_atom(br.moving_side) # Move the large side
Not sure why this was hard to find since it’s a documented arg of new_rotation, but just do this:
br = self.session.bond_rotations.new_rotation(pick_bond, move_smaller_side=False)
—Eric
Eric Pettersen UCSF Computer Graphics Lab
_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu Manage subscription: http://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users