⚠ Preview docs — built from the develop branch and may be unstable. Go to the stable docs.

Model.FromMemory

static Model FromMemory(string filename, Byte[]& data, Shader shader, int loadPriority)

Loads a list of mesh and material subsets from a .obj, .stl, .ply (ASCII), .gltf, or .glb file stored in memory. Note that this function won’t work well on files that reference other files, such as .gltf files with references in them.

   
string filename StereoKit still uses the filename of the data for format discovery, but not asset Id creation. If you don’t have a real filename for the data, just pass in an extension with a leading ‘.’ character here, like “.glb”.
Byte[]& data The binary data of a model file, this is NOT a raw array of vertex and index data!
Shader shader The shader to use for the model’s materials! If null, this will automatically determine the best shader available to use.
RETURNS: Model Always returns a valid Model created from the file, check the AssetState to see if a failure occurred.




Found an issue with these docs, or have some additional questions? Create an Issue on Github!