{"id":16209708,"url":"https://github.com/poi-vrc/avatarlib","last_synced_at":"2026-03-17T14:24:27.918Z","repository":{"id":129019276,"uuid":"487253897","full_name":"poi-vrc/AvatarLib","owner":"poi-vrc","description":"Contains a bunch of quick-to-use APIs for plugins and applications to add, modify a VRChat avatar.","archived":false,"fork":false,"pushed_at":"2023-12-14T07:53:28.000Z","size":753,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T18:50:57.678Z","etag":null,"topics":["api","avatar","dev","vrchat","vrcsdk"],"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/poi-vrc.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":"2022-04-30T11:00:54.000Z","updated_at":"2024-09-10T08:35:37.000Z","dependencies_parsed_at":"2023-10-16T02:53:41.825Z","dependency_job_id":"7bfcf235-718b-4485-913a-0697a48592f2","html_url":"https://github.com/poi-vrc/AvatarLib","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/poi-vrc/AvatarLib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poi-vrc%2FAvatarLib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poi-vrc%2FAvatarLib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poi-vrc%2FAvatarLib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poi-vrc%2FAvatarLib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/poi-vrc","download_url":"https://codeload.github.com/poi-vrc/AvatarLib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poi-vrc%2FAvatarLib/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267436538,"owners_count":24086898,"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","status":"online","status_checked_at":"2025-07-27T02:00:11.917Z","response_time":82,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api","avatar","dev","vrchat","vrcsdk"],"created_at":"2024-10-10T10:31:55.991Z","updated_at":"2026-03-17T14:24:22.879Z","avatar_url":"https://github.com/poi-vrc.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AvatarLib\n\nContains a bunch of quick-to-use APIs for plugins and applications to add, modify a VRChat avatar. This is created because one or more tools of mine share the same code.\n\n## API Documentation\n\nDocumentation is available at https://poi-vrc.github.io/AvatarLib\n\n## How to install\n\nAvatarLib uses the Unity Package Manager (UPM) for version control. You can install the library by:\n\n1. Start the Package Manager from `Window -\u003e Package Manager`\n\n2. Press the `+` icon and `Add package from git URL...`\n\n3. Enter the URL: `https://github.com/poi-vrc/AvatarLib.git?path=Packages/com.chocopoi.vrc.avatarlib`\n\n  - This URL tracks the latest `master` branch version\n  - To change to a specific version, you can append `#1.x.x` at the end\n    - e.g. `https://github.com/poi-vrc/AvatarLib.git?path=Packages/com.chocopoi.vrc.avatarlib#1.0.0`\n  - For details, check https://docs.unity3d.com/Manual/upm-git.html\n\n## How to update\n\n1. Start the Package Manager from `Window -\u003e Package Manager`\n\n2. Next to the `+` icon, change to `In Project`\n\n3. Find `AvatarLib` and press the `Update to x.x.x` button if available.\n\n## Why this library?\n\nIt is created to simply allow me to re-use some codes in multiple tools. But it is a really good library with handy library functions:\n\n1. Easier `VRCExpressionsMenu` generation\n\nWith plain VRCSDK code, you will need to:\n\n```csharp\n...\nVRCExpressionsMenu menu = new VRCExpressionsMenu(); \nmenu.controls.Add(new VRCExpressionsMenu.Control()\n{\n    name = \"MyButton\",\n    type = VRCExpressionsMenu.Control.ControlType.Button,\n    parameter = \"this_is_a_parameter_1\",\n    value = 1.0f\n});\nmenu.controls.Add(new VRCExpressionsMenu.Control()\n{\n    name = \"MyToggle\",\n    type = VRCExpressionsMenu.Control.ControlType.Toggle,\n    parameter = \"this_is_a_parameter_2\",\n    value = 1.0f\n});\nVRCExpressionsMenu subMenuHere = new VRCExpressionsMenu(); \nmenu.controls.Add(new VRCExpressionsMenu.Control()\n{\n    name = \"MyAnotherSubMenu\",\n    type = VRCExpressionsMenu.Control.ControlType.SubMenu,\n    subMenu = subMenuHere\n});\nAssetDatabase.CreateAsset(menu, \"Assets/Menu1.asset\");\nAssetDatabase.CreateAsset(subMenuHere, \"Assets/Menu2.asset\");\n...\n```\n\n...which is very long. But you can do this easier with AvatarLib:\n\n```csharp\n// you can create a ExpressionMenuBuilder or directly create a sub-menu the avatar root menu\nVRCExpressionsMenu myMenu = new ExpressionMenuBuilder()\n    .AddButton(\"MyButton\", \"this_is_a_parameter_1\", 1.0f)\n    .CreateAsset(\"Assets/Menu1.asset\")\n    .GetMenu();\n\n// or..\nExpressionMenuUtils.CreateSubMenu(avatar.rootMenu, \"MySubMenu\")\n    .AddButton(\"MyButton\", \"this_is_a_parameter_1\", 1.0f)\n    .AddToggle(\"MyToggle\", \"this_is_a_parameter_2\", 1.0f)\n    .BeginNewSubMenu(\"MyAnotherSubMenu\")\n        .AddButton(\"SubMenuButtonHere\", \"this_is_a_parameter_3\", 1.0f)\n        .CreateAsset(\"Assets/Menu2.asset\")\n    .EndNewSubMenu()\n    .CreateAsset(\"Assets/Menu1.asset\");\n```\n\n2. Clean up your existing expression menus and animator stuff easier using Regex\n\n```csharp\n// removes controls with name starting with \"MyMenu \"\nExpressionMenuUtils.RemoveExpressionMenuControls(menu, \"^MyMenu \");\n\n// removes parameters with name starting with \"MyParameter_\"\nExpressionMenuUtils.RemoveExpressionParameters(parameters, \"^MyParameter_\");\n\n// removes layers with name starting with \"MyLayer_\"\nAnimationUtils.RemoveAnimatorLayers(controller, \"^MyLayer_\");\n\n// removes parameters with name starting with \"MyParameter_\"\nAnimationUtils.RemoveAnimatorParameters(controller, \"^MyParameter_\");\n```\n\n3. Quick create animator layers with one-line of code\n\n```csharp\n// Creates a AnyState--{condition}--\u003eState layer!\n//\n//    [Entry] --------------------|\n//                                v\n//    [AnyState] --{if 0}-\u003e [ myDefaultMotion ]\n//         |\n//          -------{if 1}-\u003e [ motion1 ]\n//         |\n//          -------{if 2}-\u003e [ motion2 ]\n//         |\n//          -------{if 3}-\u003e [ motion3 ]\n\nDictionary\u003cint, Motion\u003e pairs = new Dictionary\u003cint, Motion\u003e();\n\npairs.Add(0, myDefaultMotion);\npairs.Add(1, motion1);\npairs.Add(2, motion2);\npairs.Add(3, motion3);\n\nAnimationUtils.GenerateAnyStateLayer(controller, \"MyLayer\", \"MyParameter_Integer\", pairs, true);\n```\n\n4. Create World Constraint with code\n\n```csharp\nTransform root = avatar.transform;\n\nWorldConstraint wc = WorldConstraintUtils.CreateWorldConstraint(myGameObjectToBeInWorldSpace, root);\n\n// animation clips generation\n\nAnimationClip lockClip = WorldConstraintUtils.GenerateLockAnimation(wc);\nAnimationClip unlockClip = WorldConstraintUtils.GenerateUnlockAnimation(wc);\nAnimationClip showClip = WorldConstraintUtils.GenerateShowAnimation(wc);\nAnimationClip hideClip = WorldConstraintUtils.GenerateHideAnimation(wc);\n```\n\n## Contributing\n\nPlease use `dotnet-format` to format your code before committing. The `master` branch is the branch holding the latest stable version. Only submit code to `develop` branch. And it will be merged to `master` soon if it is time.\n\nTo install `dotnet-format`, you can use: `dotnet tool install -g dotnet-format`\n\nTo format code, do `dotnet-format \".\\\" --folder` in the repository root.\n\n## License\n\nThis project is licensed under the MIT License. [tl;dr](https://www.tldrlegal.com/license/mit-license)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoi-vrc%2Favatarlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoi-vrc%2Favatarlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoi-vrc%2Favatarlib/lists"}