<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pymol.org/index.php?action=history&amp;feed=atom&amp;title=Leap_Motion</id>
	<title>Leap Motion - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pymol.org/index.php?action=history&amp;feed=atom&amp;title=Leap_Motion"/>
	<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Leap_Motion&amp;action=history"/>
	<updated>2026-05-27T02:17:41Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Leap_Motion&amp;diff=14196&amp;oldid=prev</id>
		<title>Cchem: 1 revision</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Leap_Motion&amp;diff=14196&amp;oldid=prev"/>
		<updated>2017-12-11T04:50:14Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 04:50, 11 December 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Cchem</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Leap_Motion&amp;diff=14195&amp;oldid=prev</id>
		<title>Speleo3: Anaconda</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Leap_Motion&amp;diff=14195&amp;oldid=prev"/>
		<updated>2017-12-06T13:29:39Z</updated>

		<summary type="html">&lt;p&gt;Anaconda&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:29, 6 December 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This page describes how to get the [https://www.leapmotion.com Leap Motion Controller] working in PyMOL, using the Leap Python API. The script was tested on Gentoo Linux and &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;OSX&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This page describes how to get the [https://www.leapmotion.com Leap Motion Controller] working in PyMOL, using the Leap Python API.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The script was tested &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;with PyMOL 2.0 on all platforms, with MacPyMOL &amp;quot;syspython&amp;quot;, and with Open-Source PyMOL &lt;/ins&gt;on Gentoo Linux and &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;MacOS&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Experienced Issues &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;on OSX &lt;/del&gt;==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;== Using PyMOL 2.0 (Anaconda Python) ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Install the driver from https://www.leapmotion.com/setup/desktop/&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Install PyMOL and the Leap Python module from Anaconda Cloud:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; conda install -c schrodinger pymol&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt; conda install -c speleo3 leap-motion-python&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;== Using Open-Source PyMOL on MacOS ==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/ins&gt;== Experienced Issues &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;=&lt;/ins&gt;==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* must use /usr/bin/python2.7, the macports or fink python does not work&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* must use /usr/bin/python2.7, the macports or fink python does not work&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Speleo3</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Leap_Motion&amp;diff=6241&amp;oldid=prev</id>
		<title>Pyadmin: 1 revision</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Leap_Motion&amp;diff=6241&amp;oldid=prev"/>
		<updated>2014-03-28T01:47:13Z</updated>

		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 01:47, 28 March 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Pyadmin</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Leap_Motion&amp;diff=6240&amp;oldid=prev</id>
		<title>Speleo3: created</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Leap_Motion&amp;diff=6240&amp;oldid=prev"/>
		<updated>2013-07-30T16:04:33Z</updated>

		<summary type="html">&lt;p&gt;created&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This page describes how to get the [https://www.leapmotion.com Leap Motion Controller] working in PyMOL, using the Leap Python API. The script was tested on Gentoo Linux and OSX.&lt;br /&gt;
&lt;br /&gt;
== Experienced Issues on OSX ==&lt;br /&gt;
&lt;br /&gt;
* must use /usr/bin/python2.7, the macports or fink python does not work&lt;br /&gt;
* must use GLUT framework, macports or fink X11 glut will not work&lt;br /&gt;
* the GLUT framework will change the current directory on startup&lt;br /&gt;
* no Tk (external window)&lt;br /&gt;
&lt;br /&gt;
=== Compiling and Running PyMOL on OSX ===&lt;br /&gt;
&lt;br /&gt;
In SVN rev 4037 there was a --osx-frameworks argument added to use OpenGL and GLUT frameworks. See also [[Linux Install]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/usr/bin/python2.7 setup.py build install \&lt;br /&gt;
    --prefix=/tmp/pymol-for-leapmotion \&lt;br /&gt;
    --osx-frameworks&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Run PyMOL without the external GUI and provide absolute paths for arguments:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/tmp/pymol-for-leapmotion/bin/pymol -xqr $PWD/LeapExampleScript.py&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example Script ==&lt;br /&gt;
&lt;br /&gt;
The script below demostrates proof-of-concept by implementing camera rotation and zooming with multiple fingers. It's not supposed to provide real production functionality.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
'''&lt;br /&gt;
Minimal example for PyMOL + LEAP Motion&lt;br /&gt;
&lt;br /&gt;
(c) 2013 Schrödinger, Inc.&lt;br /&gt;
&lt;br /&gt;
License: BSD-2-Clause&lt;br /&gt;
'''&lt;br /&gt;
&lt;br /&gt;
import sys&lt;br /&gt;
import math&lt;br /&gt;
from pymol import cmd&lt;br /&gt;
&lt;br /&gt;
if sys.platform.startswith('linux'):&lt;br /&gt;
    sys.path.append('/usr/share/Leap/LeapSDK/lib')&lt;br /&gt;
    sys.path.append('/usr/share/Leap/LeapSDK/lib/x64')&lt;br /&gt;
else:&lt;br /&gt;
    # TODO: ADJUST THIS&lt;br /&gt;
    sys.path.append('/path/to/LeapSDK/lib')&lt;br /&gt;
&lt;br /&gt;
import Leap&lt;br /&gt;
from Leap import Matrix, Vector&lt;br /&gt;
&lt;br /&gt;
class PymolListener(Leap.Listener):&lt;br /&gt;
    def __init__(self, *args, **kwargs):&lt;br /&gt;
        super(PymolListener, self).__init__(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
        self.prev_frame = None&lt;br /&gt;
&lt;br /&gt;
        self.controller = Leap.Controller()&lt;br /&gt;
        self.controller.add_listener(self)&lt;br /&gt;
&lt;br /&gt;
    def __del__(self):&lt;br /&gt;
        self.controller.remove_listener(self)&lt;br /&gt;
&lt;br /&gt;
        super(PymolListener, self).__del__()&lt;br /&gt;
&lt;br /&gt;
    def update_view(self, frame):&lt;br /&gt;
        if not self.prev_frame:&lt;br /&gt;
            return&lt;br /&gt;
&lt;br /&gt;
        view = list(cmd.get_view())&lt;br /&gt;
&lt;br /&gt;
        if frame.rotation_probability(self.prev_frame) &amp;gt; 0.1:&lt;br /&gt;
            m = frame.rotation_matrix(self.prev_frame)&lt;br /&gt;
            m *= Matrix(Vector(*view[0:3]),&lt;br /&gt;
                        Vector(*view[3:6]),&lt;br /&gt;
                        Vector(*view[6:9]))&lt;br /&gt;
            view[:9] = m.to_array_3x3()&lt;br /&gt;
&lt;br /&gt;
        if frame.scale_probability(self.prev_frame) &amp;gt; 0.1:&lt;br /&gt;
            s = frame.scale_factor(self.prev_frame)&lt;br /&gt;
            delta_z = math.log(s) * 100.0&lt;br /&gt;
            view[11] += delta_z&lt;br /&gt;
            view[15] -= delta_z&lt;br /&gt;
            view[16] -= delta_z&lt;br /&gt;
&lt;br /&gt;
        cmd.set_view(view)&lt;br /&gt;
&lt;br /&gt;
    def on_frame(self, controller):&lt;br /&gt;
        frame = controller.frame()&lt;br /&gt;
&lt;br /&gt;
        self.update_view(frame)&lt;br /&gt;
&lt;br /&gt;
        self.prev_frame = frame&lt;br /&gt;
&lt;br /&gt;
listener = PymolListener()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* https://www.leapmotion.com&lt;br /&gt;
* http://www.mail-archive.com/pymol-users@lists.sourceforge.net/msg11572.html&lt;/div&gt;</summary>
		<author><name>Speleo3</name></author>
	</entry>
</feed>