Skip to content

Scripting, Recording & WebPanels

Every button click, slider drag, and checkbox toggle in the OpenSpace UI executes a Lua function under the hood. Capturing those commands lets you automate complex camera tours, build custom show buttons, and record repeatable flight paths.


Extracting Commands with ScriptLog.txt

Whenever you want to script an action—such as fading in an atmosphere layer or flying to a specific coordinate—perform it once in the UI and copy the generated Lua from the live script log:

  1. Open <OpenSpace_Root>/logs/ScriptLog.txt in VS Code (which auto-updates as the file changes).
  2. Perform the desired action in OpenSpace (e.g., toggling a layer or adjusting opacity).
  3. Copy the newest line from the bottom of ScriptLog.txt:
openspace.setPropertyValueSingle("Scene.Earth.Renderable.Layers.ColorLayers.ESRI_VIIRS_Combo.Enabled", true)
  1. Test the command live by pressing ~ (Tilde) in OpenSpace to open the interactive Lua console, pasting the line, and pressing Enter.

Batch Property Updates

When toggling multiple layers or trails simultaneously in an Action, replace "Scene.Earth..." wildcards with openspace.setPropertyValue("Scene.*.Renderable.Enabled", false) (without Single) to apply a change across matching nodes in one call.


Session Recording & Playback

Session recordings capture your exact camera transforms, simulation time changes, and UI property adjustments into a lightweight .osrec file for deterministic playback or high-resolution offline video rendering.

  1. Open the Session Recording menu from the bottom toolbar.
  2. Choose Text (human-readable/editable) or Binary (compact) format and click Start Recording.
  3. Pilot your sequence and click Stop Recording when finished—files save automatically to ${USER}/recordings/.
  1. Open Session Recording Play and select your .osrec file.
  2. (Optional) Enable Screenshot / Frame Output before playback to export lossless frame sequences at a locked framerate (e.g., 60 FPS) even on slower hardware, then encode with ffmpeg.

Screenshot Placeholder: session-recording-panel.png

  • Crop: Capture the Session Recording UI panel showing the Record and Playback tabs.
  • Callouts: (1) Output format selector (Binary vs. Text), (2) Record/Stop toggle, (3) Playback file selector and loop checkbox.

Custom WebPanels & Remote Control

OpenSpace hosts an embedded web server on http://localhost:4680 and exposes its Lua scripting engine over WebSockets (ws://localhost:4682). This allows you to control a show from a tablet, secondary monitor, or custom HTML control deck:

  • Built-in Web GUI: Open http://localhost:4680 in any browser on the same machine (or over LAN if configured in openspace.cfg) to access the full OpenSpace interface remotely.
  • Custom Show Control Pages: Any HTML/JS panel placed in ${USER} can connect to OpenSpace's WebSocket API (openspace-api-js) to trigger your custom Profile Actions with single-tap show buttons.