Skip to content

Control with Workspace RPC ​

Workspace RPC (flarelive-client) is the recommended interface for controlling Flare Live from Python. It covers scene construction, inspection, editing, project files, simulation and export. Your script runs in your own Python environment and controls the scene in an already running GUI or headless instance.

You need Python 3.10 or newer, an activated Flare Live installation, and the client wheel supplied in that installation's python folder. Run Flare Live and the script as the same OS user.

Install the client ​

Create and activate an environment for your scripts. Install the wheel supplied with the version of Flare Live you will control. Run subsequent examples with python in this activated environment.

Windows PowerShell ​

Set $flareLiveBin to the folder containing flare-live-cli.exe:

powershell
$flareLiveBin = 'C:\Tools\FlareLive\bin'
python -m venv .venv-flarelive
.\.venv-flarelive\Scripts\Activate.ps1
$clientWheel = Get-ChildItem -LiteralPath "$flareLiveBin\python" -Filter 'flarelive_client-*.whl' | Select-Object -First 1
python -m pip install $clientWheel.FullName

If PowerShell prevents activation, use .\.venv-flarelive\Scripts\python.exe in place of python in the examples.

Linux ​

For an extracted runtime package, locate flarelive_client-*.whl in the python folder beside flare-live-cli.

For an AppImage, extract a copy to obtain its wheel. Replace FlareLive.AppImage with your downloaded filename:

sh
chmod +x ./FlareLive.AppImage
./FlareLive.AppImage --appimage-extract
python3 -m venv .venv-flarelive
. .venv-flarelive/bin/activate
flarelive_wheel="$(find "$PWD/squashfs-root" -name 'flarelive_client-*.whl' -print -quit)"
python -m pip install "$flarelive_wheel"

You can continue launching the original AppImage. The extracted copy supplies the client wheel for this environment.

Connect and inspect ​

Open the GUI or start headless mode, then keep that instance running. Save this as inspect_scene.py:

python
from flarelive_client import connect

with connect() as client:
    ws = client.workspace
    print("Project:", ws.state.document_file or "(unsaved document)")
    for obj in ws.list_objects():
        print(obj.name, obj.class_name)

Run it in your activated environment:

sh
python inspect_scene.py

connect() selects the single running instance. The script reads that instance's current scene. Use the same connection for editing, simulation and export; GUI and headless instances expose the same Workspace operations.

Edit and save a scene ​

While in Document, an RPC edit has the same persistence rules as a GUI edit: it changes the current scene and enters editing history. Call save_world or use File > Save to write the preparation to disk. Closing the client leaves committed edits in the application; it does not save an FLL automatically.

For example, with Simulation stopped and no Experiment active, this script adds a Camera to the current Document and saves a separate project:

python
from pathlib import Path
from flarelive_client import connect

PROJECT = Path("prepared-scene.fll").resolve()

with connect() as client:
    ws = client.workspace
    camera = ws.create_object("simexp.core.camera")
    ws.set_property(camera, "name", "Observer")
    ws.save_world(PROJECT)

save_world() with no path saves to the Document's existing filename. The call returns after the file is written successfully.

For complex scenes, prepare and save an FLL once. A trial script can open it with ws.open_world(Path("prepared-scene.fll").resolve()), begin an Experiment for temporary changes, initialize, run, then Clear and End experiment. Save reusable changes in Document before starting the trial. See world lifecycle and projects and saving.

Continue with inspection queries, Workspace editing or a complete simulation loop. The vehicle tutorials use this same RPC connection.

Multiple instances ​

When several Flare Live processes are running, list them with flare-live-cli instances (Windows adds .exe; an AppImage uses ./FlareLive.AppImage --cli instances). Each entry includes an ID, process ID and project path.

Replace connect() with connect(instance_id="INSTANCE_ID"), using the desired ID or a unique prefix. For CLI commands targeting an existing instance, append --instance INSTANCE_ID. All other examples assume one running instance and omit this selector.

If connection fails ​

ResultWhat to check
ModuleNotFoundError: flarelive_clientInstall the wheel and run the script with the same Python environment.
No matching instanceStart the GUI or CLI serve as the same OS user, then connect again.
Multiple matching instancesFollow Multiple instances to select the desired process.
Missing method or version mismatchInstall the wheel supplied with the target Flare Live version. Use pip --force-reinstall when replacing a wheel with the same version.