-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #358 from ousttrue/add/univrm-vrma
vrm animation の記事追加など
- Loading branch information
Showing
19 changed files
with
441 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# import animation | ||
|
||
VRM-1.0 を import します。 | ||
|
||
```cs title="load vrm-1.0" | ||
var vrm10Instance = await Vrm10.LoadPathAsync(path, | ||
canLoadVrm0X: true, | ||
showMeshes: false, | ||
awaitCaller: m_useAsync.enabled | ||
? (IAwaitCaller)new RuntimeOnlyAwaitCaller() | ||
: (IAwaitCaller)new ImmediateCaller(), | ||
materialGenerator: GetVrmMaterialDescriptorGenerator(m_useUrpMaterial.isOn), | ||
vrmMetaInformationCallback: m_texts.UpdateMeta, | ||
ct: cancellationToken); | ||
if (cancellationToken.IsCancellationRequested) | ||
{ | ||
UnityObjectDestroyer.DestroyRuntimeOrEditor(vrm10Instance.gameObject); | ||
cancellationToken.ThrowIfCancellationRequested(); | ||
} | ||
|
||
var instance = vrm10Instance.GetComponent<RuntimeGltfInstance>(); | ||
instance.ShowMeshes(); | ||
instance.EnableUpdateWhenOffscreen(); | ||
``` | ||
|
||
VRM-Animation を import します。 | ||
|
||
```cs title="load vrm-animation" | ||
// gltf, glb etc... | ||
using GltfData data = new AutoGltfFileParser(path).Parse(); | ||
using var loader = new VrmAnimationImporter(data); | ||
var instance = await loader.LoadAsync(new ImmediateCaller()); | ||
var vrmAnimation = instance.GetComponent<Vrm10AnimationInstance>(); | ||
instance.GetComponent<Animation>().Play(); | ||
``` | ||
|
||
VRM-1.0 と VRM-Animation を連結します。 | ||
|
||
```cs title="connect model with vrm-animation" | ||
vrm10Instance.Runtime.VrmAnimation = vrmAnimation; | ||
``` | ||
|
||
:::info | ||
以降 Vrm10Instance の Update もしくは LateUpdate で、 | ||
VRM-Animation のポーズが Vrm-1.0 に転送されます。 | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# VRM10Viewer | ||
|
||
![image](./vrm10viewer.jpg) | ||
|
||
vrm-1.0 の Runtime ローダーのサンプルです。 | ||
|
||
以下のフォーマットをロードできます。 | ||
|
||
- (model) vrm-1.0 | ||
- (model) vrm-0.x(vrm-1.0 に動的に変換する) | ||
- (motion) bvh | ||
- (motion) vrm-animation | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# VRMC_node_constraint | ||
|
||
https://github.com/vrm-c/vrm-specification/tree/master/specification/VRMC_node_constraint-1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# emission | ||
|
||
KHR_materials_emissive_strength をサポートします。 | ||
|
||
[Emission と グロー(発光)](/gltf/emission_glow/) | ||
|
||
:::info | ||
vrm-1.0 は KHR_materials_unlit のように KHR_materials_emissive_strength と併用できます。 | ||
::: | ||
|
||
:::info | ||
UniVRM は、gltf と vrm-1 に対する KHR_materials_emissive_strength 読み書きをサポートします。 | ||
::: | ||
|
||
:::info mtoon-0.x | ||
vrm-0.x は、KHR_materials_emissive_strength ではなく mtoon-0.x が 範囲外の emission を記録します。 | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# VRMC_vrm: expression | ||
|
||
BlendShape は、Expression に名称を変更します。 | ||
|
||
:::warning BlendShape | ||
|
||
BlendShape は Unity の MorphTarget 機能のことで、区別が付きにくかったためです。 | ||
|
||
::: | ||
|
||
preset の見直し | ||
|
||
| | VRM0 | VRM1 | | ||
| --- | ----------------------------- | --------- | | ||
| 喜 | joy(joy と fun が曖昧) | happy | | ||
| 怒 | angry | angry | | ||
| 哀 | sorrow(文語) | sad | | ||
| 楽 | fun(joy と fun が曖昧) | relaxed | | ||
| 驚 | (新規追加) | surprised | | ||
| あ | a(非日本語で自然なように変更) | aa | | ||
| い | i(非日本語で自然なように変更) | ih | | ||
| う | u(非日本語で自然なように変更) | ou | | ||
| え | e(非日本語で自然なように変更) | ee | | ||
| お | o(非日本語で自然なように変更) | oh | | ||
|
||
- overrideMouse, overrideLipSync, overrideBlink 設定の追加 | ||
- VRM0 の materialBind から MaterialColorBind と TextureTransformBind に整理 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# gltf 格納詳細 | ||
|
||
:::warning | ||
import, export の実装で注意が必要です。 | ||
::: | ||
|
||
## glTF: z+ forward | ||
|
||
モデルは Z+ 方向が前方になるように格納します。 | ||
|
||
| | VRM0 | VRM1 | | ||
| ------- | ---- | ---- | | ||
| forward | z- | z+ | | ||
| right | x+ | x- | | ||
|
||
:::warning 実装 | ||
|
||
vrm-0.x を vrm-1.0 に変換する際は、Y 軸 180 度の回転をしてください。 | ||
|
||
```csharp | ||
Vector3 vrm0; | ||
var vrm1 = new Vector3(-vrm0.x, vrm0.y, -vrm0.z); | ||
``` | ||
|
||
::: | ||
|
||
## glTF: divided vertex buffer | ||
|
||
bufferView の primitive 間での共有をやめます。 | ||
|
||
| | VRM0 | VRM1 | | ||
| ---------- | --------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ | | ||
| bufferView | shared | divided | | ||
| 利点 | GameEngine メモリレイアウトに近いので変換が少ない | 一般的な glTF ローダーでロードできる | | ||
| 欠点 | UniVRM 以外の glTF ローダーでメモリ使用量が爆発する可能性(ロードできるが頂点バッファに未使用領域ができてしまう) | export 時に頂点の増加・並び順の変化がありえる。import 時に連結する手間。morphTarget の扱いが煩雑 | | ||
|
||
:::warning 例 | ||
|
||
| | prim0 | prim1 | | ||
| -------- | ------ | ------ | | ||
| position | 100 | 100 | | ||
| index | 0..100 | 0..100 | | ||
|
||
👇 | ||
|
||
| | prim0 | prim1 | | | ||
| -------- | ------ | -------- | -------------------------- | | ||
| position | 100 | 100 | バッファーが連結されている | | ||
| index | 0..100 | 100..200 | | | ||
|
||
::: | ||
|
||
:::warning 実装 | ||
|
||
`Vrm` 専用の gltfPrimitive 間での共有バッファーローダーをやめて、 | ||
一般的な `glTF` ローダーで問題ありません。 | ||
|
||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# VRMC_vrm: humanoid | ||
|
||
必須ボーンの見直し。 | ||
|
||
| | VRM0 | VRM1 | | ||
| ------------------- | ---- | ---- | | ||
| neck | 必須 | | | ||
| head | 必須 | 必須 | | ||
| hips | 必須 | 必須 | | ||
| spine | 必須 | 必須 | | ||
| chest | 必須 | | | ||
| left/right UpperArm | 必須 | 必須 | | ||
| left/right LowerArm | 必須 | 必須 | | ||
| left/right Hand | 必須 | 必須 | | ||
| left/right UpperLeg | 必須 | 必須 | | ||
| left/right LowerLeg | 必須 | 必須 | | ||
| left/right Foot | 必須 | 必須 | | ||
|
||
以下の項目が廃止になります(`VRMHumanoidDescription` に記録されていたが未使用)。 | ||
|
||
- armStretch | ||
- legStretch | ||
- upperArmTwist | ||
- lowerArmTwist | ||
- upperLegTwist | ||
- lowerLegTwist | ||
- feetSpacing | ||
- hasTranslationDoF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.