Builtin Library
README.md
asset
The one node an asset enters a graph through.
Ops
asset— an asset's content as a graph value, in the form its type states: a mesh is a Surface, a texture is a Texture. Itsassetparam is a reference, writtenasset.resolve("<identity>", "<type>"); a name alone is refused. The asset is read when the node cooks, and a later edit to it cooks the node again.
An asset type states the conversion in the graph its behavior.luau
declares: read(ref) answers the value, and write(value, name, place)
persists a value as that asset again. The sinks that write a value back
(mesh.write, texture.write) go through the same write, so what enters a
graph and what leaves it are one conversion.
local rock = g.op.asset({ asset = asset.resolve("@builtin::meshes.sphere", "mesh") })
local grass = g.op.asset({ asset = asset.resolve("@builtin::systems.terrainSystem.demo.textures.grass_diff", "texture") })
procgen.searchNodes("", { pack = "asset" }) lists the family and procgen.describeNode("op.asset")
describes it.