{"id":22229584,"url":"https://github.com/tcoppex/cgltf_vrm","last_synced_at":"2025-03-25T08:43:45.561Z","repository":{"id":265287956,"uuid":"895089379","full_name":"tcoppex/cgltf_vrm","owner":"tcoppex","description":"👘 Single-file VRM 1.0 loader written in C99, extending cgltf.","archived":false,"fork":false,"pushed_at":"2024-11-28T17:55:29.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-30T08:15:53.016Z","etag":null,"topics":["avatar","c99","gltf2","vrm","vrm-loader"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tcoppex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-27T14:40:02.000Z","updated_at":"2025-01-18T17:08:19.000Z","dependencies_parsed_at":"2024-11-28T18:37:05.963Z","dependency_job_id":"856f148c-93c4-4f79-9273-d3da41960d20","html_url":"https://github.com/tcoppex/cgltf_vrm","commit_stats":null,"previous_names":["tcoppex/cgltf_vrm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcoppex%2Fcgltf_vrm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcoppex%2Fcgltf_vrm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcoppex%2Fcgltf_vrm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tcoppex%2Fcgltf_vrm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tcoppex","download_url":"https://codeload.github.com/tcoppex/cgltf_vrm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245431708,"owners_count":20614182,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["avatar","c99","gltf2","vrm","vrm-loader"],"created_at":"2024-12-03T01:11:00.099Z","updated_at":"2025-03-25T08:43:45.537Z","avatar_url":"https://github.com/tcoppex.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :kimono: cgltf_vrm\n\n**Single-file C99 VRM 1.0 loader companion to [cgltf](https://github.com/jkuhlmann/cgltf).** \n\n![Stage: alpha](https://img.shields.io/badge/-alpha-red)\n\n_This library depends on cgltf.h to work (tested against v1.14)._\n\n#### Extensions support\n\n- [x] KHR_materials_unlit (*via cgltf*),\n- [x] KHR_texture_transform (*via cgltf*),\n- [x] KHR_materials_emissive_strength (*via cgltf*),\n- [x] [VRMC_vrm](https://github.com/vrm-c/vrm-specification/tree/master/specification/VRMC_vrm-1.0),\n- [x] [VRMC_springBone](https://github.com/vrm-c/vrm-specification/tree/master/specification/VRMC_springBone-1.0),\n- [x] [VRMC_node_constraint](https://github.com/vrm-c/vrm-specification/tree/master/specification/VRMC_node_constraint-1.0),\n- [x] [VRMC_materials_mtoon](https://github.com/vrm-c/vrm-specification/tree/master/specification/VRMC_materials_mtoon-1.0),\n- [ ] [VRMC_VRM_animation](https://github.com/vrm-c/vrm-specification/tree/master/specification/VRMC_vrm_animation-1.0),\n- [ ] [VRMC_springBone_extended_collider](https://github.com/vrm-c/vrm-specification/tree/master/specification/VRMC_springBone_extended_collider-1.0)\n\n#### Basic usage\n\nThe main concern is to include the `cgltf_vrm` implementation in the same file and **_after_**\nthe `cgltf` implementation as it depends on some of its static functions to work.\n\n##### Loading from an existing `cgltf_data` object\n```c\n#include \u003cstdlib.h\u003e\n\n#define CGLTF_IMPLEMENTATION\n#include \"cgltf.h\"\n#include \"cgltf_vrm.h\"\n\nint main(int argc, char **argv[])\n{\n  cgltf_options options{};\n  cgltf_result result{};\n  cgltf_data* gltf = NULL;\n  cgltf_vrm_data vrm;\n\n  result = cgltf_parse_file(\u0026options, \"avatar.vrm\", \u0026gltf);\n  if (result != cgltf_result_success)\n  {\n    return EXIT_FAILURE;\n  }\n\n  result = cgltf_vrm_parse_cgltf_data(\u0026options, gltf, \u0026vrm);\n  if (result != cgltf_result_success)\n  {\n    cgltf_free(gltf);\n    return EXIT_FAILURE;\n  }\n\n  /* process data here */\n\n  cgltf_vrm_free(\u0026vrm);\n  cgltf_free(gltf);\n\n  return EXIT_SUCCESS;\n}\n```\n\n\u003c!-- \n##### Loading from a file\n```c\n#include \u003cstdlib.h\u003e\n\n#define CGLTF_IMPLEMENTATION\n#include \"cgltf_vrm.h\"\n\nint main(int argc, char **argv[])\n{\n  cgltf_options options{};\n  cgltf_result result{};\n\n  cgltf_vrm_data* vrm = NULL;\n\n  result = cgltf_vrm_parse_file(\u0026options, \"avatar.vrm\", \u0026vrm);\n  if (result != cgltf_result_success)\n  {\n    return EXIT_FAILURE;\n  }\n\n  /* process data here */\n\n  cgltf_vrm_free(\u0026vrm);\n\n  return EXIT_SUCCESS;\n}\n```\n--\u003e\n\n### See also\n\n* [VRM specifications](https://github.com/vrm-c/vrm-specification)\n* [Unity implementation](https://github.com/vrm-c/UniVRM)\n* [ThreeJS implementation](https://github.com/pixiv/three-vrm/tree/dev)\n* [Online VRM viewer](https://vrm-viewer.ownverse.world/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcoppex%2Fcgltf_vrm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftcoppex%2Fcgltf_vrm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftcoppex%2Fcgltf_vrm/lists"}