Re-use blueprints across sessions and SDKs

While the blueprint APIs are currently only available through 🐍 Python, blueprints can be saved to file and then re-logged as needed from any language our SDKs support.

This enables you to re-use your saved blueprints both from any language we support as well as across different recordings that share a similar-enough structure, and makes it possible to share those blueprints with other users.

For this you'll need to 1) create a blueprint file and B) import that file when needed.

Creating a blueprint file creating-a-blueprint-file

Blueprint files (.rbl, by convention) can currently be created in two ways.

One is to use the Rerun viewer to interactively build the blueprint you want (e.g. by moving panels around, changing view settings, etc), and then using Menu > Save blueprint (or the equivalent palette command) to save the blueprint as a file.

The other is to use the 🐍 Python blueprint API to programmatically build the blueprint, and then use the Blueprint.save method to save it as a file:

"""Craft an example blueprint with the python API and save it to a file for future use."""

import sys

import rerun.blueprint as rrb

path_to_rbl = sys.argv[1]

rrb.Blueprint(
    rrb.Horizontal(
        rrb.Grid(
            rrb.BarChartView(name="Bar Chart", origin="/bar_chart"),
            rrb.TimeSeriesView(
                name="Curves",
                origin="/curves",
            ),
        ),
        rrb.TextDocumentView(name="Description", origin="/description"),
        column_shares=[3, 1],
    ),
    rrb.SelectionPanel(state="collapsed"),
    rrb.TimePanel(state="collapsed"),
).save("your_blueprint_name", path_to_rbl)

(Re)Using a blueprint file reusing-a-blueprint-file

There are two ways to re-use a blueprint file.

The interactive way is to import the blueprint file directly into the Rerun viewer, using either Menu > Import… (or the equivalent palette command) or simply by drag-and-dropping the blueprint file into your recording.

The programmatic way works by calling log_file_from_path:

This method allows you to log any file that contains data that Rerun understands (in this case, blueprint data) as part of your current recording:

"""Demonstrates how to programmatically re-use a blueprint stored in a file."""

import sys

import rerun as rr

path_to_rbl = sys.argv[1]

rr.init("rerun_example_reuse_blueprint_file", spawn=True)
rr.log_file_from_path(path_to_rbl)

# … log some data as usual …

Limitation: dynamic blueprints limitation-dynamic-blueprints

Sometimes, you might need your blueprint to dynamically react to the data you receive at runtime (e.g. you want to create one view per anomaly detected, and there is no way of knowing how many anomalies you're going to detect until the program actually runs).

The only way to deal with these situations today is to use the 🐍 Python API.