Skip to content

cf_make_model

Category: model
GitHub: cute_model.h


Loads a GLB or .gltf model from the virtual file system.

CM_Model* cf_make_model(const char* virtual_path);
Parameters Description
virtual_path A virtual path to the model file (see the Virtual File System topic).

Return Value

Returns the loaded model, or NULL on failure -- call cf_model_error for the reason.

Remarks

External references inside a .gltf (a .bin buffer, image files) resolve through the VFS relative to the model's directory, so a model mounted with its sidecar files simply works. The returned CM_Model owns all of its arrays; free the whole thing with cf_destroy_model. The model's data and animation API (cm_animate, cm_skin_palette, cm_interleave, ...) lives in libraries/cute/cute_model.h -- see the includes note at the top of this header.

cf_destroy_model
cf_model_error
cf_make_texture_from_model_image