Skip to main content

outleap

codecov

A Python library using asyncio to control a Second Life viewer over the LEAP protocol.

See https://bitbucket.org/lindenlab/leap/src/main/ for more details on LEAP.

Installing

pip install outleap, or pip install -e . to install from source.

If you want to use the LEAP REPL or UI inspector, do pip install outleap[tools], or pip install -e .[tools].

Usage

Look in the "examples" directory.

You can run a LEAP script with your_viewer --leap some_script.py if you have the executable bit set.

import asyncio
import sys

from outleap import LEAPClient, LLViewerControlAPI


async def amain():
    # Create a client speaking LEAP over stdin/stdout and connect it
    async with await LEAPClient.create_stdio_client() as client:
        # Use our typed wrapper around the LLViewerControl LEAP API
        viewer_control_api = LLViewerControlAPI(client)
        # Ask for a config value and print it in the viewer logs
        print(await viewer_control_api.get("Global", "StatsPilotFile"), file=sys.stderr)


asyncio.run(amain())

If you just want to play around with the LEAP APIs:

$ outleap-repl
# ... in another terminal ...
$ viewer --leap outleap-agent

will give you an interactive REPL with a LEAP client object, with all the API wrappers already imported:

>>> floater_api = LLFloaterRegAPI(client)
>>> floater_api.show_instance(name="preferences")
>>> window_api = LLWindowAPI(client)
>>> prefs_path = UIPath.for_floater("Preferences")
>>> pprint.pp(await window_api.get_info(prefs_path))
{'available': True,
 'class': '19LLFloaterPreference',
 'enabled': 1,
 'enabled_chain': 1,
 'path': '/main_view/menu_stack/world_panel/Floater View/Preferences',
 'rect': {'bottom': 234, 'left': 593, 'right': 1255, 'top': 762},
 'value': None,
 'visible': 1,
 'visible_chain': 1}

Similarly, there's an interactive UI tree inspector available through outleap-inspector. It can be launched through viewer --leap outleap-inspector.

Screenshot of outleap-inspector

What viewers does LEAP even work in?

Due to the fact that LEAP has only historically been used internally for testing, or for integration with the official viewer's updater, many viewers have disabled LEAP both intentionally or accidentally.

The code in the upstream viewer also appears to refuse to launch LEAP scripts if the updater isn't present, which I don't entirely understand. I can't compile it to check.

Does it work in Firestorm?

No, the code to launch LEAP scripts is commented out. If you do your own build with those lines uncommented it'll work fine.

Does it work in Alchemy?

Probably not, and definitely not on Linux. Alchemy does the same SL updater presence checks as upstream before attempting to launch LEAP scripts, which I imagine wouldn't succeed. Haven't tried.

Does it work in LL's official viewer?

Yeah, probably.

Does it work in <other viewer>?

No, probably not.

Credits

The project scaffolding is based on code from https://github.com/MatthieuDartiailh/bytecode

Release files for outleap 0.8.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for outleap 0.8.5
File Size Uploaded
outleap-0.8.5.tar.gz 160.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for outleap 0.8.5
File Interpreter ABI Platform
outleap-0.8.5-py3-none-any.whl Python 3 none any Details

Total release size: 194.6 kB

Release files / outleap-0.8.5.tar.gz

Download URL outleap-0.8.5.tar.gz
Size 160.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3c7ccb6966f548307f110151b4980994b4eb5b78026edcd2fefad9dc1cb0ff3e
BLAKE2b-256 checksum
How to use checksums
b993e662f342b919c15b3ac975fa4ad24f773ffc81f3d278a93163dbaacbf084
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.14

Release files / outleap-0.8.5-py3-none-any.whl

Download URL outleap-0.8.5-py3-none-any.whl
Size 34.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
05da2e78921426b046158e1fe4e2a0585dc1abd237a30e78ada9aea9cb007c4e
BLAKE2b-256 checksum
How to use checksums
b130cdba8acc9dc5e68471d9e51117a1124b2d5df7aba32ac179b03bde1aec05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.8.5 This release

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page