Skip to content

Latest commit

 

History

History
14 lines (14 loc) · 983 Bytes

README.md

File metadata and controls

14 lines (14 loc) · 983 Bytes

lua-gltf

Installation

Install with luarocks: $ luarocks install lua-gltf

Usage

local gltf = require("gltf")
local asset = gltf.new("/path/to/file.gltf")

The returned table is identical to a standard glTF asset with the following differences:

  • Any fields which hold an index, now instead hold the object referenced by that index
    • To get the original numerical index, call asset:IndexOf(object). Keep in mind that these values will begin from 0, as they correspond to the indices in the glTF file.
  • Each node has the field node.parent
  • Buffers, buffer views, accessors, and images have a :get() method
    • When called on an accessor, an additional boolean argument packed is accepted (defaults to false). If true, the value returned will be the raw string which holds the accessor data. Otherwise, this method returns the values contained in the accessor.