Merge pull request #1830 from ousttrue/doc/update_v0_104_1

document update
This commit is contained in:
ousttrue
2022-09-26 19:35:28 +09:00
committed by GitHub
7 changed files with 199 additions and 63 deletions

View File

@@ -42,10 +42,12 @@
</header>
<main>
<a href="https://github.com/vrm-c/UniVRM/releases/download/v0.104.0/UniVRM-0.104.0_c466.unitypackage" class="btn">
<a href="https://github.com/vrm-c/UniVRM/releases/download/v0.104.1/UniVRM-0.104.1_4a9b.unitypackage" class="btn">
<div class="btn">
<h1>Download</h1>
<h2>UniVRM-0.104.0</h2>
<div>Unity-2020.3 or later</div>
<div>for vrm-0.x</div>
<h2>UniVRM-0.104.1</h2>
</div>
</a>
</main>

View File

@@ -28,26 +28,18 @@ def gen(version: str, hash: str):
# Download
* for `Unity-2020.3 LTS` or later
* [UniVRM-{version_hash}.unitypackage](https://github.com/vrm-c/UniVRM/releases/download/v{version}/UniVRM-{version_hash}.unitypackage)
* `for vrm-0.x` [UniVRM-{version_hash}.unitypackage](https://github.com/vrm-c/UniVRM/releases/download/v{version}/UniVRM-{version_hash}.unitypackage)
* `for vrm-1.0` [VRM-{version_hash}.unitypackage](https://github.com/vrm-c/UniVRM/releases/download/v{version}/VRM-{version_hash}.unitypackage)
ReleaseNote
* [日本語](https://vrm-c.github.io/UniVRM/ja/release/079/v{version}.html)
* [English](https://vrm-c.github.io/UniVRM/en/release/079/v{version}.html)
## other unitypackage
### UniVRM API sample
* [UniVRM_Samples-{version_hash}.unitypackage](https://github.com/vrm-c/UniVRM/releases/download/v{version}/UniVRM_Samples-{version_hash}.unitypackage)
### VRM-1.0Beta
* [VRM-{version_hash}.unitypackage](https://github.com/vrm-c/UniVRM/releases/download/v{version}/VRM-{version_hash}.unitypackage)
### VRM-1.0Beta API sample
* [VRM_Samples-{version_hash}.unitypackage](https://github.com/vrm-c/UniVRM/releases/download/v{version}/VRM_Samples-{version_hash}.unitypackage)
|package|folder|
|-|-|
|UniVRM|Assets/VRMShaders, Assets/UniGLTF, Assets/VRM|
|UniVRM_Samples|Assets/VRM_Samples|
|VRM|Assets/VRMShaders, Assets/UniGLTF, Assets/VRM10|
|VRM_Samples|Assets/VRM10_Samples|
* `VRM-0.x API sample` [UniVRM_Samples-{version_hash}.unitypackage](https://github.com/vrm-c/UniVRM/releases/download/v{version}/UniVRM_Samples-{version_hash}.unitypackage)
* `VRM-1.0 API sample` [VRM_Samples-{version_hash}.unitypackage](https://github.com/vrm-c/UniVRM/releases/download/v{version}/VRM_Samples-{version_hash}.unitypackage)
# UPM
@@ -72,6 +64,15 @@ ReleaseNote
}}
```
# UPM packages and folders and unitypackage
| UPM package | folder | unitypackage | note |
|---------------------|------------------|------------------------------------------------------------------------|-|
| com.vrmc.vrmshaders | Assets/VRMShaders | UniVRM-XXX, VRM-XXX | 0.x and 1.0 shared |
| com.vrmc.gltf | Assets/UniGLTF | UniVRM-XXX, VRM-XXX | 0.x and 1.0 shared |
| com.vrmc.univrm | Assets/VRM | UniVRM-XXX | import/export 0.x |
| com.vrmc.vrm | Assets/VRM10 | VRM-XXX | import/export 1.0 and import 0.x |
'''
@@ -203,6 +204,8 @@ if __name__ == '__main__':
<a href="https://github.com/vrm-c/UniVRM/releases/download/v{version}/UniVRM-{version}_{hash[0:4]}.unitypackage" class="btn">
<div class="btn">
<h1>Download</h1>
<div>Unity-2020.3 or later</div>
<div>for vrm-0.x</div>
<h2>UniVRM-{version}</h2>
</div>
</a>

91
docs/vrm1/api_update.md Normal file
View File

@@ -0,0 +1,91 @@
# API更新
`VRM-1.0` ではフォーマットの更新とともに、 `Unity Component` が変わります。
## Load
`VRM-0.X` をロードして新しいコンポーネントで動かすことができます。
この場合 `VRM-0` ライセンスで扱ってください。
```csharpharp
RuntimeGltfInstance instance = await VrmUtility.LoadAsync(path);
```
👇
```csharpharp
Vrm10Instance vrm10Instance = await Vrm10.LoadPathAsync(path);
```
`VRM-0.x` から設計を変更して `Vrm10Instance` にすべての情報を格納する方式になりました。
```{admonition} 毎フレーム決まった順番で更新します。
:class: info
1. Control Rig
2. Constraints
3. Gaze control
4. Expression
<https://github.com/vrm-c/UniVRM/blob/master/Assets/VRM10/Runtime/Components/Vrm10Runtime/Vrm10Runtime.csharp#L170>
```
## Expression
```{admonition} VRMBlendShapeProxy は Vrm10Instance.Runtime.Expression になりました。
:class: info
ImmediatelySetValue と AccumulateValue は、SetWeight に一本化されました。
ImmediatelySetValue は無くなりました。
```
```csharp
var proxy = root.GetComponent<VRMBlendShapeProxy>();
proxy.ImmediatelySetValue(BlendShapeKey.CreateFromPreset(BlendShapePreset.A), 0.5f);
```
👇
```csharp
var vrm10 = root.GetComponent<Vrm10Instance>();
vrm10.Runtime.Expression.SetWeight(ExpressionKey.CreateFromPreset(ExpressionPreset.aa), 0.5f);
```
## LookAt
```{admonition} VRMLookAt は Vrm10Instance.Runtime.LookAt になりました。
:class: info
vrm10.Gaze.position か vrm10.Runtime.LookAt.SetLookAtYawPitch で予め更新しておいた値が、
後で vrm10.Runtime により適用されます。
```
### Gaze
```csharp
var lookAt = root.GetComponent<VRMLookAt>();
lookAt.LookWorldPosition(new Vector3(x, y, z));
```
👇
```csharp
var vrm10 = root.GetComponent<Vrm10Instance>();
vrm10.LookAtTargetType = LookAtTargetTypes.CalcYawPitchToGaze;
vrm10.Gaze.position = new Vector3(x, y, z);
```
### SetYawPitch
```csharp
var lookAt = root.GetComponent<VRMLookAt>();
lookAt.ApplyRotations(yaw, pitch);
```
👇
```csharp
var vrm10 = root.GetComponent<Vrm10Instance>();
vrm10.LookAtTargetType = LookAtTargetTypes.SetYawPitch;
vrm10.Runtime.LookAt.SetLookAtYawPitch(yaw, pitch);
```

View File

@@ -0,0 +1,85 @@
# Folder 構成
`v0.104` 時点で UniVRM リポジトリの `Assets` 下には6つのフォルダがあります。
## Assets 下のフォルダ
### VRMShaders
UPM パッケージ `com.vrmc.vrmshaders` です。
`gltf`, `vrm-0.x`, `vrm-1.0` に関連する `Shader``Material``Texture` に関連する機能を集めています。
`UniUnlit` `MToon` `MToon-1.0` が含まれています。
個々のシェーダーについては、<https://vrm.dev/univrm/shaders/index.html> を参照してください。
### UniGLTF
UPM パッケージ `com.vrmc.gltf` です。
`com.vrmc.vrmshaders` に依存します。
`gltf`, `glb` の import / export 機能が有ります。
拡張子、 `.gltf`, `.glb` のファイルの Editor import 機能が有ります。
### VRM
UPM パッケージ `com.vrmc.univrm` です。
`com.vrmc.vrmshaders``com.vrmc.gltf` に依存します。
`vrm-0.x` の import / export 機能が有ります。
拡張子、 `.vrm` のファイルの Editor import 機能が有ります。
もし、`vrm-1.0` だった場合は import できません。
### VRM_Samples
`vrm-0.x` のサンプルシーンが有ります。
動作に `VRM`, `UniGLTF`, `VRMShaders` が必要です。
### VRM10
UPM パッケージ `com.vrmc.vrm` です。
`com.vrmc.vrmshaders``com.vrmc.gltf` に依存します。
`vrm-1.0` の import / export 機能が有ります。
拡張子、 `.vrm` のファイルの Editor import 機能が有ります。
もし、`vrm-0.x` だった場合は マイグレート が可能です。
### VRM10_Samples
`vrm-1.0` のサンプルシーンが有ります。
動作に `VRM10`, `UniGLTF`, `VRMShaders` が必要です。
## フォルダの組み合わせ
フォルダは、依存フォルダの条件を満たす範囲で組み合わせることができます。
すべてのフォルダがあると `vrm-0.x``vrm-1.0` の両方が動きます。
片方だけ使う場合は、不要な方を削除することができます。
### 例: VRM-0.X だけインストールする
* VRMShaders
* UniGLTF
* VRM
### 例: VRM-1.0 と VRM-0.X 両方 インストールする
* VRMShaders
* UniGLTF
* VRM
* VRM10
### 例: VRM-1.0 だけインストールする
* VRMShaders
* UniGLTF
* VRM10
### 例: UniGLTF だけインストールする
* VRMShaders
* UniGLTF
### 動かない例: UniGLTF だけインストールする
* UniGLTF
VRMShaders が無いので動きません。

View File

@@ -1,34 +1,13 @@
# VRM-1.0 の API
`vrm-0.103.1`
`VRM-1.0` ではフォーマットの更新とともに、 `Unity Component` が変わります。
また、`VRM-0.X` をロードして新しいコンポーネントで動かすことができます。
この場合 `VRM-0` ライセンスで扱ってください。
```csharp
RuntimeGltfInstance instance = await VrmUtility.LoadAsync(path);
```
👇
```csharp
Vrm10Instance vrm10Instance = await Vrm10.LoadPathAsync(path);
```
`VRM-0.x` から設計を変更して `Vrm10Instance` にすべての情報を格納する方式になりました。
```{admonition} Vrm10Instance
:class: info
Expression や LookAt, FirstPerson などまとめて入っています。
```
`vrm-0.104.0`
```{toctree}
:maxdepth: 2
folder_structure
api_update
vrm1_load
vrm1_controlrig
vrm1_expression
vrm1_lookat
vrm1_firstperson
```

View File

@@ -1,23 +0,0 @@
# 🚧Expression
表情周りの操作方法。
> VRM-1.0 の `BlendShapeProxy` は、`Vrm10Instance.Expression` になります。
VRM-0.X の例
```csharp
void SetExpression(GameObject root)
{
var controller = root.GetComponent<BlendShapeProxy>();
}
```
VRM-1.0 の例
```csharp
void SetExpression(GameObject root)
{
var controller = root.GetComponent<Vrm10Instance>();
}
```

View File

@@ -1 +0,0 @@
# 🚧LookAt