Skip to content

file.py

rerun.log.file

class MeshFormat

Bases: Enum

Mesh file format.

GLB = 'GLB' class-attribute

glTF binary format.

OBJ = 'OBJ' class-attribute

Wavefront .obj format.

class ImageFormat dataclass

Bases: Enum

Image file format.

JPEG = 'jpeg' class-attribute

JPEG format.

PNG = 'png' class-attribute

PNG format.

def log_mesh_file(entity_path, mesh_format, *, mesh_bytes=None, mesh_path=None, transform=None, timeless=False, recording=None)

Log the contents of a mesh file (.gltf, .glb, .obj, …).

You must pass either mesh_bytes or mesh_path.

You can also use [rerun.log_mesh] to log raw mesh data.

Example:
# Move mesh 10 units along the X axis.
transform=np.array([
    [1, 0, 0, 10],
    [0, 1, 0, 0],
    [0, 0, 1, 0]])

Parameters:

Name Type Description Default
entity_path str

Path to the mesh in the space hierarchy

required
mesh_format MeshFormat

Format of the mesh file

required
mesh_bytes Optional[bytes]

Content of an mesh file, e.g. a .glb.

None
mesh_path Optional[Path]

Path to an mesh file, e.g. a .glb.

None
transform Optional[npt.ArrayLike]

Optional 3x4 affine transform matrix applied to the mesh

None
timeless bool

If true, the mesh will be timeless (default: False)

False
recording Optional[RecordingStream]

Specifies the rerun.RecordingStream to use. If left unspecified, defaults to the current active data recording, if there is one. See also: rerun.init, rerun.set_global_data_recording.

None

def log_image_file(entity_path, *, img_bytes=None, img_path=None, img_format=None, timeless=False, recording=None)

Log an image file given its contents or path on disk.

You must pass either img_bytes or img_path.

Only JPEGs and PNGs are supported right now.

JPEGs will be stored compressed, saving memory, whilst PNGs will currently be decoded before they are logged. This may change in the future.

If no img_format is specified, rerun will try to guess it.

Parameters:

Name Type Description Default
entity_path str

Path to the image in the space hierarchy.

required
img_bytes Optional[bytes]

Content of an image file, e.g. a .jpg.

None
img_path Optional[Path]

Path to an image file, e.g. a .jpg.

None
img_format Optional[ImageFormat]

Format of the image file.

None
timeless bool

If true, the image will be timeless (default: False).

False
recording Optional[RecordingStream]

Specifies the rerun.RecordingStream to use. If left unspecified, defaults to the current active data recording, if there is one. See also: rerun.init, rerun.set_global_data_recording.

None