GltfReader¶
Namespace Nfty.Model in assembly Nfty.Model.
Reads back the models ModelWriter writes (GLB, glTF + .bin, embedded glTF) and nothing else. It goes through the same record model the writer serializes, so there is one schema; every member that model does not state is refused by name with UnsupportedModelException instead of being skipped, because a skipped feature (a second mesh, a sparse accessor) would show the reader a different model from the file's.
Methods¶
Read(ReadOnlySpan<byte>)¶
Reads a GLB held in memory.
Parameters
glb(ReadOnlySpan<byte>) - The whole file.
Returns. The mesh and texture.
Exceptions
UnsupportedModelException- The bytes are not a GLB nfty could have written.
Read(string)¶
Reads a model file; the extension (.glb or .gltf) says which.
Parameters
path(string) - The file. A .gltf's .bin sits beside it.
Returns. The mesh and texture.
Exceptions
UnsupportedModelException- The file is not one nfty could have written.