Docs updates

This commit is contained in:
bd_ 2022-10-15 21:23:01 -07:00
parent 7c7fa06083
commit a67d5f7b17
23 changed files with 213 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

View File

@ -0,0 +1,39 @@
---
sidebar_position: 5
sidebar_label: Distributing Prefabs
---
import ReactPlayer from 'react-player'
# Distributing Prefabs
Modular Avatar is designed to make things easier for prefab authors, by allowing them to distribute prefabs which can be installed by simply dragging and dropping onto the avatar.
Here are some recommendations for how to best structure prefabs based on Modular Avatar.
## Guide your users to the official distribution point for Modular Avatar
Including a copy of Modular Avatar in your prefab's distribution is permitted by the license. However, this could result in users installing a very old version, or even accidentally downgrading and breaking their other prefabs.
I strongly recommend guiding users to the official distribution point for Modular Avatar, which is the [Modular Avatar GitHub repository](https://github.com/bdunderscore/modular-avatar/releases).
In the future, I intend to provide a VCC-based installation method, which should make things even easier. This is waiting on improvements to VCC itself, however.
## Use nested prefabs for compatibility with non-ModularAvatar setups
If you add a Modular Avatar component to a prefab, users will be unable to use that prefab without installing Modular Avatar.
Some users might prefer not to use Modular Avatar for whatever reason. If you wish to support this, you can use nested prefabs to separate out the core of your outfits from the Modular Avatar configuration.
If you've not worked with nested prefabs before, here's how to do this:
1. Create your outfit prefab as normal.
2. Open your prefab in prefab mode (double-click it in the project view).
![Prefab mode](prefab-mode.png)
3. Drag the root of your prefab to the project window. When a window pops up, click Create Base. Rename the file to something you'll remember (e.g. `Outfit without Modular Avatar`)
<ReactPlayer playing muted loop playsinline url='/img/creating-base.mp4' />
Once you've done this, you can set up modular avatar components on the original prefab, and set any non-modular avatar settings on the base prefab you just created.
An easy way of applying such settings is using the prefab overrides menu - you can make changes in a test scene, then select which prefab to apply those changes to afterward.
![Apply as override](apply-as-override.png)
## Use internal parameters on your animator gimmicks
Using [internal parameters](../reference/parameters.md) can help avoid clashing with other prefabs. Internal parameters are automatically renamed to a unique name at build time, ensuring you won't have any name clashes.

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

View File

@ -0,0 +1,5 @@
---
sidebar_position: 3
---
TODO

View File

@ -0,0 +1,8 @@
---
sidebar_position: 4
sidebar_label: Component reference
---
# Component reference
This section contains detailed documentation on the components included in the Modular Avatar system.

View File

@ -0,0 +1,5 @@
---
sidebar_position: 4
---
TODO

View File

@ -0,0 +1,5 @@
---
sidebar_position: 2
---
TODO

View File

@ -0,0 +1,43 @@
---
sidebar_position: 1
---
# Merge Armature
The Merge Armature component merges a tree of GameObjects onto the armature of the avatar.
![Merge Armature](merge-armature.png)
## When should I use it?
The Merge Armature component is designed specifically for clothing prefabs, and includes special logic for updating existing Skinned Mesh Renderer references and minimizing the number of generated bones. You should use it if you intend to create a skinned mesh which tracks the avatar's armature.
## When shouldn't I use it?
The Merge Armature component is not designed for use in prefabs that are intended to be able to apply generically to many different avatars. It would not be a good fit for a finger-pen prefab, for example.
Because the Merge Armature component assumes that the bones you are binding to do not move, it is not able to generalize to avatars other than the one it was set up with.
## Setting up Merge Armature
After adding the Merge Armature component to the root of the source hierarchy, drag the avatar's corresponding bone (where these should be merged to) onto Merge Target. Prefix and Suffix will normally be set automatically.
## How does it work?
Merge Armature will walk the tree of GameObjects under the GameObject it is attached to, and search for the corresponding bone in the base avatar by name. For better compatibility with existing avatars, you can optionally specify a prefix and/or suffix which will be removed from the merged bones when looking for a match.
If a match is found, Merge Armature will attempt to rewrite references to the merged bone to instead point to the base avatar's corresponding bone. In some cases this is not possible, and a child bone will be created instead.
If a match is not found, a child bone will be created under the corresponding parent bone.
Merge Armature goes to a lot of trouble to ensure that components configured on the source hierarchy, or pointing to it, Just Work (tm). In particular, it will:
* Update animator references to point to the appropriate position, depending on what properties are being animated (e.g. transform animations will point to the post-merge bone, GameObject active animations will point to the source heirarchy)
* PhysBones and contacts will have their target field updated to point to the new merged bones. This will happen even if the PhysBone is not located under the Merge Armature component.
* Other components will remain on the source hierarchy, but constraints will be generated to track the merged hierarchy.
Merge Armature will leave portions of the original hierarchy behind - specifically, if they contain any components other than Transforms, they will be retained, and otherwise will generally be deleted.
Where necessary, PhysBone objects will have their targets updated, and ParentConstraints may be created as necessary to make things Just Work (tm).
## Locked mode
If the locked option is enabled, the position and rotation of the merged bones will be locked to their parents in the editor. This is a two-way relationship; if you move the merged bone, the avatar's bone will move, and vice versa.
This is intended for use when animating non-humanoid bones. For example, you could use this to build an animator which can animate cat-ear movements.

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -0,0 +1,5 @@
---
sidebar_position: 4
---
TODO

View File

@ -0,0 +1,8 @@
---
sidebar_position: 3
sidebar_label: Samples
---
# Samples
Modular Avatar comes with a few sample prefabs to demonstrate its features.

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

View File

@ -0,0 +1,49 @@
---
sidebar_position: 1
sidebar_label: Configuring a simple outfit
---
# Configuring a simple outfit
## Tutorial
With modular avatar, most simple outfits can be merged onto your avatar with one click. Let's give it a try.
This example will install Capettiya's [Sailor Onepiece](https://capettiya.booth.pm/items/3795694) onto Nagatoro Koyori's [Anon-chan](https://booth.pm/ja/items/3564947). We'll assume you've already installed VRCSDK and Modular Avatar itself.
We'll start by just dragging and dropping the outfit prefab onto the avatar.
![Step One](step1.png)
Now, we right click the outfit, and choose the `[ModularAvatar] Setup Outfit` option listed there.
![Step Two](step2.png)
At this point you can set up your animators as normal. Just turn on and off the `SailorOnepiece_Anon_PB` object if you want to enable or disable the outfit as a whole.
For the purposes of this test we'll just turn off the original outfit objects manually.
When we go into play mode, we can see that the outfit is following the avatar's armature:
![It moves!](it_moves.png)
If you ever want to remove the outfit, just delete it from your avatar's hierarchy.
:::tip
With Modular Avatar, you don't need to unpack the original avatar or outfit prefab! This makes updating your avatar, in case a new version is released by the author, much easier.
:::
## What happened here?
When you click on the `Setup Outfit` option, Modular Avatar will automatically locate the armature object under the outfit, and attach a [Merge Armature](../../reference/merge-armature.md) component to it.
![After setup](after_setup.png)
This component will automatically merge the bone heirarchy with the original avatar's bones, when you click play. When doing so, it minimizes the number of extra bones added, and ensures that all the physics bones and other active components stay in their original places, so you can manipulate them with animations without having to go through any hoops.
If we open up the avatar in play mode, we can see what it looks like after merging:
![Play mode armature](play_mode_armature.png)
As you can see, the bones unique to the new outfit have been merged into the avatar's armature, while for bones that are shared between the outfit and the avatar, the outfit will reference the original avatar's bones instead.

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -0,0 +1,10 @@
---
sidebar_position: 2
sidebar_label: Tutorials
---
# Tutorials
Here are some step-by-step guides on how to set up things using Modular Avatar.
* [Configuring a simple outfit](clothing/index.md) - in most cases, you can set up an outfit with just a few clicks. Check out this tutorial for details.

View File

@ -15,13 +15,16 @@
"typecheck": "tsc"
},
"dependencies": {
"@algolia/client-search": "^4.9.1",
"@docusaurus/core": "^2.1.0",
"@docusaurus/preset-classic": "^2.1.0",
"@mdx-js/react": "^1.6.22",
"clsx": "^1.2.1",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"react-dom": "^17.0.2",
"react-loadable": "^5.5.0",
"react-player": "^2.11.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "2.1.0",

BIN
docs/static/img/creating-base.mp4 vendored Normal file

Binary file not shown.

View File

@ -76,7 +76,7 @@
"@algolia/requester-common" "4.14.2"
"@algolia/transporter" "4.14.2"
"@algolia/client-search@4.14.2":
"@algolia/client-search@4.14.2", "@algolia/client-search@^4.9.1":
version "4.14.2"
resolved "https://registry.yarnpkg.com/@algolia/client-search/-/client-search-4.14.2.tgz#357bdb7e640163f0e33bad231dfcc21f67dc2e92"
integrity sha512-L5zScdOmcZ6NGiVbLKTvP02UbxZ0njd5Vq9nJAmPFtjffUSOGEp11BmD2oMJ5QvARgx2XbX4KzTTNS5ECYIMWw==
@ -3302,7 +3302,7 @@ deep-extend@^0.6.0:
resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac"
integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==
deepmerge@^4.2.2:
deepmerge@^4.0.0, deepmerge@^4.2.2:
version "4.2.2"
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955"
integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==
@ -4814,6 +4814,11 @@ lines-and-columns@^1.1.6:
resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632"
integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==
load-script@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/load-script/-/load-script-1.0.0.tgz#0491939e0bee5643ee494a7e3da3d2bac70c6ca4"
integrity sha512-kPEjMFtZvwL9TaZo0uZ2ml+Ye9HUMmPwbYRJ324qF9tqMejwykJ5ggTyvzmrbBeapCAbk98BSbTeovHEEP1uCA==
loader-runner@^4.2.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.3.0.tgz#c1b4a163b99f614830353b16755e7149ac2314e1"
@ -4983,6 +4988,11 @@ memfs@^3.1.2, memfs@^3.4.3:
dependencies:
fs-monkey "^1.0.3"
memoize-one@^5.1.1:
version "5.2.1"
resolved "https://registry.yarnpkg.com/memoize-one/-/memoize-one-5.2.1.tgz#8337aa3c4335581839ec01c3d594090cebe8f00e"
integrity sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q==
merge-descriptors@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61"
@ -5827,7 +5837,7 @@ prompts@^2.4.2:
kleur "^3.0.3"
sisteransi "^1.0.5"
prop-types@^15.6.2, prop-types@^15.7.2:
prop-types@^15.5.0, prop-types@^15.6.2, prop-types@^15.7.2:
version "15.8.1"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==
@ -6001,7 +6011,7 @@ react-error-overlay@^6.0.11:
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.11.tgz#92835de5841c5cf08ba00ddd2d677b6d17ff9adb"
integrity sha512-/6UZ2qgEyH2aqzYZgQPxEnz33NJ2gNsnHA2o5+o4wW9bLM/JYQitNP9xPhsXwC08hMMovfGe/8retsdDsczPRg==
react-fast-compare@^3.2.0:
react-fast-compare@^3.0.1, react-fast-compare@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.0.tgz#641a9da81b6a6320f270e89724fb45a0b39e43bb"
integrity sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==
@ -6044,6 +6054,24 @@ react-loadable-ssr-addon-v5-slorber@^1.0.1:
dependencies:
"@babel/runtime" "^7.10.3"
react-loadable@^5.5.0:
version "5.5.0"
resolved "https://registry.yarnpkg.com/react-loadable/-/react-loadable-5.5.0.tgz#582251679d3da86c32aae2c8e689c59f1196d8c4"
integrity sha512-C8Aui0ZpMd4KokxRdVAm2bQtI03k2RMRNzOB+IipV3yxFTSVICv7WoUr5L9ALB5BmKO1iHgZtWM8EvYG83otdg==
dependencies:
prop-types "^15.5.0"
react-player@^2.11.0:
version "2.11.0"
resolved "https://registry.yarnpkg.com/react-player/-/react-player-2.11.0.tgz#9afc75314eb915238e8d6615b2891fbe7170aeaa"
integrity sha512-fIrwpuXOBXdEg1FiyV9isKevZOaaIsAAtZy5fcjkQK9Nhmk1I2NXzY/hkPos8V0zb/ZX416LFy8gv7l/1k3a5w==
dependencies:
deepmerge "^4.0.0"
load-script "^1.0.0"
memoize-one "^5.1.1"
prop-types "^15.7.2"
react-fast-compare "^3.0.1"
react-router-config@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/react-router-config/-/react-router-config-5.1.1.tgz#0f4263d1a80c6b2dc7b9c1902c9526478194a988"