Skip to content

Search

Documentation

mesh asset type

Geometry for mesh properties: a source file, a primitive kind, or its own positions and indices. skin, colors and morphs add bone weights, vertex tints…

Files live in models/. Used by collider2d · mesh, collider3d · mesh, mesh · source, occluder2d · mesh, polygon · mesh, shape2d · mesh, softbody2d · collision_mesh, softbody2d · mesh, softbody3d · collision_mesh, softbody3d · mesh.

Geometry for mesh properties: a source file, a primitive kind, or its own positions and indices. skin, colors and morphs add bone weights, vertex tints and blend shapes.

[[assets]]
id = "blade"
type = "mesh"
source = "models/blade.obj"      # imported...
part = "stone"                   # glTF only: just this material's triangles
# ...or a primitive, one of sphere, box, capsule, cylinder, cone, plane,
# torus, pyramid, prism, tube:
kind = "torus"
radius = 1.0
tube_radius = 0.3
# ...or a word, shaped and filled from the project's fonts:
kind = "text"
text = "BALAUR"
size = 1.0
underline = "single"             # or "double"; strikethrough and overline take true
# ...or, instead of any of those:
positions = [[0, 0, 0], [1, 0, 0], [0, 1, 0]]
indices = [[0, 1, 2]]
colors = [[1, 0, 0, 1], [0, 1, 0, 1], [0, 0, 1, 1]]   # a tint per vertex
skin = { bones = [{ path = "Rig/Hip", weights = [1, 1, 1] }] }   # one weight per vertex
morphs = [{ name = "smile", positions = [[0, 0, 0], [0.1, 0, 0], [0, 0.1, 0]] }]   # a clip drives it as mesh/morph.smile