[chimerax-users] Rotate bond move large/small option in VR

Tom Goddard goddard at sonic.net
Mon Dec 9 11:51:24 PST 2019


Hi Józef,

  I got your bug report.  The error happened when you click to rotate a bond in VR and you miss the bond.  The code I added last week and that I suggested in the previous email needed to check if no bond is picked.  The fix will be in tonight's ChimeraX daily build.  Here is the fix to the code I sent in a previous message (adding the lines "if br is None: return".

	Tom

Fixed VR bond rotation code.

    def vr_press(self, event):
        # Virtual reality hand controller button press.
        pick = event.picked_object(self.view)
        self._bond_rot = self._bond_rotation(pick)

        # Move the side of the bond the VR click is closest to.
        br = self._bond_rot
	if br is None:
	  return
        atom1 = br.moving_side
        atom2 = br.bond.other_atom(atom1)
        p = event.tip_position
        from chimerax.core.geometry import distance
        if distance(p, atom2.scene_coord) < distance(p, atom1.scene_coord):
            br.moving_side = atom2    # Switch to moving the atom2 side

> On Dec 9, 2019, at 9:15 AM, Tom Goddard <goddard at sonic.net> wrote:
> 
> Hi Jozef,
> 
>   Please press the report bug button on the error dialog and I will fix the problem.   I don’t think clicking in the middle of the bond is the issue and I need to see the error to fix it.  Thanks.
> 
>    Tom
> 
> On Dec 9, 2019, at 3:33 AM, Lewandowski, Jozef <J.R.Lewandowski at warwick.ac.uk <mailto:J.R.Lewandowski at warwick.ac.uk>> wrote:
> 
>> Thank you both. Works like a charm. I like the solution with the rotation being defined by which side of the bond one clicks – that is exactly the type of thing I need.
>> It gives me an error when I accidentally click at the center but I can live with that and just have to be careful with my selection.
>>  
>> Thanks again,
>> Józef
>>  
>> From: Eric Pettersen <pett at cgl.ucsf.edu <mailto:pett at cgl.ucsf.edu>>
>> Date: Friday, 6 December 2019 at 23:19
>> To: Tom Goddard <goddard at sonic.net <mailto:goddard at sonic.net>>
>> Cc: "Lewandowski, Jozef" <J.R.Lewandowski at warwick.ac.uk <mailto:J.R.Lewandowski at warwick.ac.uk>>, "chimerax-users at cgl.ucsf.edu <mailto:chimerax-users at cgl.ucsf.edu>" <chimerax-users at cgl.ucsf.edu <mailto:chimerax-users at cgl.ucsf.edu>>
>> Subject: Re: [chimerax-users] Rotate bond move large/small option in VR
>>  
>> On Dec 6, 2019, at 3:11 PM, Tom Goddard <goddard at sonic.net <mailto:goddard at 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 at cgl.ucsf.edu <mailto:ChimeraX-users at cgl.ucsf.edu>
>> Manage subscription:
>> http://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users <http://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users>
> _______________________________________________
> ChimeraX-users mailing list
> ChimeraX-users at cgl.ucsf.edu <mailto:ChimeraX-users at cgl.ucsf.edu>
> Manage subscription:
> http://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users <http://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimerax-users/attachments/20191209/2b6bb2c4/attachment.html>


More information about the ChimeraX-users mailing list