Material files
Modlumi shares materials as .mlmat files. The format is open: anyone may
read and write it, and this page is its full specification. To import or
export one in the app, see
Share materials.
The .mlmat format
Section titled âThe .mlmat formatâA .mlmat file is a zip archive. Its entries may be stored or compressed
with Deflate, and their names are UTF-8 with / between folders. It holds:
material.json, which describes the material.- The materialâs image, if it has one, under the name
material.jsongives. - Optionally a small preview image, under the name
material.jsongives.
A material file needs no other files and readers ignore any it has.
material.json
Section titled âmaterial.jsonâ{ "format": "modlumi-material", "version": 1, "id": "red-brick", "name": "Red brick", "category": "Masonry", "tags": ["brick", "wall"], "color": [1, 1, 1, 1], "image": { "file": "color.jpg", "width": 1.0, "height": 0.75 }, "thumbnail": "thumbnail.png", "credit": { "source": "ambientCG", "url": "https://ambientcg.com/view?id=Bricks085", "authors": [], "license": "CC0-1.0", "license_url": "https://creativecommons.org/publicdomain/zero/1.0/" }}| Field | Required | Meaning |
|---|---|---|
format |
Yes | Always "modlumi-material". |
version |
Yes | The format version, 1 for this page. A reader refuses newer versions it doesnât know. |
name |
Yes | The materialâs name as the Materials panel shows it. |
id |
No | A stable identifier, such as the materialâs id in a library. |
category |
No | A group to show the material in, such as "Wood". |
tags |
No | Words to search for the material by. |
color |
No | Red, green, blue and opacity from 0 to 1, in sRGB. Without an image itâs the materialâs color; with one it multiplies the image, so [1, 1, 1, 1] shows the image unchanged. Defaults to [1, 1, 1, 1]. |
image |
No | The materialâs image: file names its entry in the archive, and width and height give the real-world size in meters that one copy of the image covers, so it repeats at the right scale. PNG, JPEG or BMP, of at most 32 MB. |
thumbnail |
No | Names a PNG or JPEG entry to preview the material with. |
credit |
No | Who made the material and on what terms. Every field is optional: source names where it comes from, url links to it, authors lists its makers, license gives an SPDX identifier or name, and license_url links to the license text. |
Readers ignore fields they donât know, so later versions can add fields without breaking older readers.
Modlumi keeps a materialâs credit when you paint with it, saves it with the model, and writes it back when you export the material, so the credit travels with every copy.
Material libraries
Section titled âMaterial librariesâThe Library tab of the Materials panel lists the materials of a library
served over HTTPS, Modlumiâs own at https://modlumi.com/api/materials/.
A library is a folder of files:
index.jsonlists the materials.<id>/material.mlmatis each materialâs file.<id>/thumbnail.jpgis each materialâs swatch.
index.json looks like this:
{ "format": "modlumi-material-library", "version": 1, "materials": [ { "id": "red-brick", "name": "Red brick", "category": "Masonry", "tags": ["brick", "wall"], "credit": { "source": "ambientCG", "license": "CC0-1.0" }, "sha256": "9f2câŚ", "size": 158213 } ]}An id uses lowercase letters, digits, -, _ and ., doesnât start with
a dot or contain .., and is at most 128 characters long. sha256 is the
SHA-256 digest of the materialâs .mlmat file in lowercase hexadecimal, and
size its size in bytes. Modlumi checks every material it downloads against
its digest, and a new digest tells it a material changed. Modlumi skips
entries it canât use and ignores fields it doesnât know.
The desktop app keeps the index and the materials it downloads, so the library still works offline.
Converting SketchUp materials
Section titled âConverting SketchUp materialsâModlumi imports SketchUp .skm material files directly: their name, color,
opacity, image and real-world image size carry over, and the creator their
file names becomes the creditâs author. Other texture maps of physically based
.skm materials are skipped. Export the material afterwards to share it as a
.mlmat file.
Only convert materials you have the right to share. The materials that ship with SketchUp are licensed for use with SketchUp, not for redistribution.