Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

debug.dump (procNode)

Inspect a graph value into a Data summary: its type and the facts that type states. A Geometry's counts and bounds are reduced on the device and read back once; every other value is described from what it holds. Wire it beside a node to see what that node made, and label each dump to tell several apart.

Inputs

  • value (Any). The value to summarize, of any type the graph carries. A Geometry reports its point count (as vertexCount), triangle count, curve count, point attributes and bounds; a Population its instances, draw calls, variants and bytes; a Prefab or Bundle its record count; a Raster its layer names, cell grid, tile count, resolution, origin, size and bytes; a Field its element type and stride; a Texture its width and height; a Material its shader. A value that is not a table reports the Luau type it is and the value itself.
  • label (String). Default "". A caption carried onto the summary, which is how several dumps in one graph are told apart. An empty string leaves the summary uncaptioned.

Outputs

  • info: the Data summary. Every summary holds kind and, when given, label. By kind:
    • Geometry: vertexCount (the number of points), triangleCount (the triangles its faces make), curveCount (the primitives whose curve flag is 1; a primitive without the flag is a face), attributes (the point attribute names) and bounds ({ min = { x, y, z }, max = { x, y, z } }).
    • Population: count, drawCalls, variants, bytes.
    • Prefab and Bundle: records.
    • Part: pieces, the type of each piece by name.
    • Raster: layers, cells, tiles, resolution, origin, size, bytes.
    • Field: type, stride.
    • Texture: width, height.
    • Material: shader.
    • A value that is not a table: valueType and value.

Example

local grid = g.mesh.grid({ size = { x = 2, z = 2 }, cells = { x = 2, z = 2 } })
local info = g.debug.dump({ value = grid, label = "floor" })

info is { kind = "Geometry", label = "floor", vertexCount = 9, triangleCount = 8, curveCount = 0, attributes = {}, bounds = { min = { x = -1, y = 0, z = -1 }, max = { x = 1, y = 0, z = 1 } } }.