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.

def log_mesh_file(entity_path, mesh_format, mesh_file, *, transform=None, timeless=False)

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

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_file bytes

Contents of the mesh file

required
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

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

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

Only JPEGs are supported right now.

You must pass either img_bytes or img_path.

If no img_format is specified, we will try and 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