diff --git a/en/.doctrees/api/index.doctree b/en/.doctrees/api/index.doctree index 5406f795d..c5932001e 100644 Binary files a/en/.doctrees/api/index.doctree and b/en/.doctrees/api/index.doctree differ diff --git a/en/.doctrees/api/vrm1_firstperson.doctree b/en/.doctrees/api/vrm1_firstperson.doctree deleted file mode 100644 index 271485b8f..000000000 Binary files a/en/.doctrees/api/vrm1_firstperson.doctree and /dev/null differ diff --git a/en/.doctrees/api/vrm1_get_humanoid.doctree b/en/.doctrees/api/vrm1_get_humanoid.doctree deleted file mode 100644 index a44904ceb..000000000 Binary files a/en/.doctrees/api/vrm1_get_humanoid.doctree and /dev/null differ diff --git a/en/.doctrees/api/vrm1_runtime_load.doctree b/en/.doctrees/api/vrm1_runtime_load.doctree deleted file mode 100644 index bcf5542fd..000000000 Binary files a/en/.doctrees/api/vrm1_runtime_load.doctree and /dev/null differ diff --git a/en/.doctrees/environment.pickle b/en/.doctrees/environment.pickle index 51170fa98..f5c23238f 100644 Binary files a/en/.doctrees/environment.pickle and b/en/.doctrees/environment.pickle differ diff --git a/en/.doctrees/index.doctree b/en/.doctrees/index.doctree index a4de6fd64..8f500f34a 100644 Binary files a/en/.doctrees/index.doctree and b/en/.doctrees/index.doctree differ diff --git a/en/.doctrees/vrm1/index.doctree b/en/.doctrees/vrm1/index.doctree new file mode 100644 index 000000000..e10620cb3 Binary files /dev/null and b/en/.doctrees/vrm1/index.doctree differ diff --git a/en/.doctrees/vrm1/vrm1_controlrig.doctree b/en/.doctrees/vrm1/vrm1_controlrig.doctree new file mode 100644 index 000000000..8dde4c045 Binary files /dev/null and b/en/.doctrees/vrm1/vrm1_controlrig.doctree differ diff --git a/en/.doctrees/api/vrm1_expression.doctree b/en/.doctrees/vrm1/vrm1_expression.doctree similarity index 72% rename from en/.doctrees/api/vrm1_expression.doctree rename to en/.doctrees/vrm1/vrm1_expression.doctree index 5842b57c9..3effdd246 100644 Binary files a/en/.doctrees/api/vrm1_expression.doctree and b/en/.doctrees/vrm1/vrm1_expression.doctree differ diff --git a/en/.doctrees/vrm1/vrm1_firstperson.doctree b/en/.doctrees/vrm1/vrm1_firstperson.doctree new file mode 100644 index 000000000..286a5ca3f Binary files /dev/null and b/en/.doctrees/vrm1/vrm1_firstperson.doctree differ diff --git a/en/.doctrees/vrm1/vrm1_load.doctree b/en/.doctrees/vrm1/vrm1_load.doctree new file mode 100644 index 000000000..9f69f794d Binary files /dev/null and b/en/.doctrees/vrm1/vrm1_load.doctree differ diff --git a/en/.doctrees/api/vrm1_lookat.doctree b/en/.doctrees/vrm1/vrm1_lookat.doctree similarity index 92% rename from en/.doctrees/api/vrm1_lookat.doctree rename to en/.doctrees/vrm1/vrm1_lookat.doctree index fc30636f6..65de71c20 100644 Binary files a/en/.doctrees/api/vrm1_lookat.doctree and b/en/.doctrees/vrm1/vrm1_lookat.doctree differ diff --git a/en/_sources/api/index.md.txt b/en/_sources/api/index.md.txt index 74c8e8159..94ebca539 100644 --- a/en/_sources/api/index.md.txt +++ b/en/_sources/api/index.md.txt @@ -26,15 +26,3 @@ fast_spring_bone 0_95_highlevel 0_96_1_use_gamma_colorspace ``` - -## VRM-1.0(β) - -```{toctree} -:maxdepth: 2 - -vrm1_runtime_load -vrm1_get_humanoid -vrm1_expression -vrm1_lookat -vrm1_firstperson -``` diff --git a/en/_sources/api/vrm1_get_humanoid.md.txt b/en/_sources/api/vrm1_get_humanoid.md.txt deleted file mode 100644 index 814cefea3..000000000 --- a/en/_sources/api/vrm1_get_humanoid.md.txt +++ /dev/null @@ -1,7 +0,0 @@ -# 🚧Humanoid - -## Humanoid Bone の取得方法 - -### Humanoidコンポーネント(vrm-1.0) - -### Animator経由(vrm-0.xとvrm-1.0共通) diff --git a/en/_sources/index.md.txt b/en/_sources/index.md.txt index bf5dccea2..4314151fb 100644 --- a/en/_sources/index.md.txt +++ b/en/_sources/index.md.txt @@ -6,6 +6,7 @@ api/index build implementation/index +vrm1/index ``` ```{toctree} diff --git a/en/_sources/vrm1/index.md.txt b/en/_sources/vrm1/index.md.txt new file mode 100644 index 000000000..b1e43f8cd --- /dev/null +++ b/en/_sources/vrm1/index.md.txt @@ -0,0 +1,34 @@ +# 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 などまとめて入っています。 +``` + +```{toctree} +:maxdepth: 2 + +vrm1_load +vrm1_controlrig +vrm1_expression +vrm1_lookat +vrm1_firstperson +``` diff --git a/en/_sources/vrm1/vrm1_controlrig.md.txt b/en/_sources/vrm1/vrm1_controlrig.md.txt new file mode 100644 index 000000000..39bf18258 --- /dev/null +++ b/en/_sources/vrm1/vrm1_controlrig.md.txt @@ -0,0 +1,46 @@ +# ControlRig 正規化されていないモデルを操作する + +VRM-1.0 は正規化が仕様から除かれました。 + +```{admonition} 正規化 +:class: info + +ヒエラルキーからの 回転、スケールの除去。 +その状態での Binding 行列再生成。 +です。 +すべてのノードの回転が 0 のときが初期姿勢(T-Pose)であるという仕様で、 +プログラムから統一的にモデルを操作することが可能でした。 +``` + +正規化されていないモデルも含めて統一的にポーズを付けるインターフェスとして、 `ControlRig` が新規に導入されました。 `v0.103` + +基本的な使い方は下記のとおりです。 +`UnityEngine.Animator.GetBoneTransform` の代わりに使う想定です。 + +```csharp +Vrm10RuntimeControlRig rig = instance.Runtime.ControlRig + +// 使用例 +var transform = rig.GetBoneTransform(HumanBodyBones.Head); +transform.localRotation = rotation; +``` + +```{admonition} ランタイムロード専用 +:class: warn + +`v0.103` 現在この機能は Editor で Asset 生成されたモデルでは動作しません。 +初期姿勢を確実に取得する方法を検討中です。 +``` + +vrm-0.x でプログラムから HumanoidBone に回転クォータニオンを代入していた +場所を `Vrm10RuntimeControlRig.GetBoneTransform` で置きかえることで +同じポーズを当てることができます。 + +## 動作の説明 + +毎フレーム `Vrm10Instance` が `Vrm10RuntimeControlRig` からVRM-1.0のヒエラルキーにポーズを転送します。 + +`Vrm10RuntimeControlRig` が初期姿勢を記憶していて、 +`正規化ポーズ localRotation => 初期姿勢を加味 => 元のヒエラルキーの localRotation` に変換という処理をします。 + +初期姿勢は `T-Pose` ですが、 `VRM-0.X` のように正規化されている必要がありません。 diff --git a/en/_sources/api/vrm1_expression.md.txt b/en/_sources/vrm1/vrm1_expression.md.txt similarity index 100% rename from en/_sources/api/vrm1_expression.md.txt rename to en/_sources/vrm1/vrm1_expression.md.txt diff --git a/en/_sources/api/vrm1_firstperson.md.txt b/en/_sources/vrm1/vrm1_firstperson.md.txt similarity index 100% rename from en/_sources/api/vrm1_firstperson.md.txt rename to en/_sources/vrm1/vrm1_firstperson.md.txt diff --git a/en/_sources/api/vrm1_runtime_load.md.txt b/en/_sources/vrm1/vrm1_load.md.txt similarity index 53% rename from en/_sources/api/vrm1_runtime_load.md.txt rename to en/_sources/vrm1/vrm1_load.md.txt index 811d65f4e..413b3c763 100644 --- a/en/_sources/api/vrm1_runtime_load.md.txt +++ b/en/_sources/vrm1/vrm1_load.md.txt @@ -1,46 +1,23 @@ # RuntimeLoad -## Runtime Normalization (from `v0.92.0`) +`Assets\VRM10\Samples\VRM10Viewer\VRM10ViewerUI.cs` -`VRM-1.0` は、ノードの `回転・スケールの削除` をしません。 -後方互換性のため、 `RuntimeLoad` 時に動的に `回転・スケールの削除` する機能を提供します。 - -> `VRM-0.x` のエクスポート時の正規化に相当する処理です - -以下のように doNormalize に true を付与してください。 +## RuntimeLoad ```csharp -using (var loader = new Vrm10Importer(vrm, - // normalize option - doNormalize: true)) -{ - RuntimeGltfInstance instance = await loader.LoadAsync(); - return instance; -} +Vrm10Instance vrm10Instance = await Vrm10.LoadPathAsync(path); ``` ## Migration(VRM-0 to VRM-1) `VRM-1.0` は、 `VRM-0.x` もロードできます。 その場合、あたらしい meta への変換が発生し互換性の無い部分はすべて `不許可` の値になります。 -このため、変換前のライセンスにアクセスする API を提供します。 +変換前のライセンスにアクセスできます。 サンプルの `Assets\VRM10\Samples\VRM10Viewer\VRM10ViewerUI.cs` も参照してください。 ```csharp -static IMaterialDescriptorGenerator GetVrmMaterialDescriptorGenerator(bool useUrp) -{ - if (useUrp) - { - return new Vrm10UrpMaterialDescriptorGenerator(); - } - else - { - return new Vrm10MaterialDescriptorGenerator(); - } -} - -async Task LoadAsync(string path) +async Task LoadAsync(string path) { GltfData data = new AutoGltfFileParser(path).Parse(); @@ -48,8 +25,7 @@ async Task LoadAsync(string path) if (Vrm10Data.TryParseOrMigrate(data, doMigrate: true, out Vrm10Data vrm)) { // vrm - using (var loader = new Vrm10Importer(vrm, - materialGenerator: GetVrmMaterialDescriptorGenerator(m_useUrpMaterial.isOn))) + using (var loader = new Vrm10Importer(vrm)) { // migrate しても thumbnail は同じ var thumbnail = await loader.LoadVrmThumbnailAsync(); @@ -67,7 +43,7 @@ async Task LoadAsync(string path) // モデルをロード RuntimeGltfInstance instance = await loader.LoadAsync(); - return instance; + return instance.GetComponent(); } } else{ diff --git a/en/_sources/api/vrm1_lookat.md.txt b/en/_sources/vrm1/vrm1_lookat.md.txt similarity index 100% rename from en/_sources/api/vrm1_lookat.md.txt rename to en/_sources/vrm1/vrm1_lookat.md.txt diff --git a/en/api/0_36_update.html b/en/api/0_36_update.html index 5065268c9..1f8a2d003 100644 --- a/en/api/0_36_update.html +++ b/en/api/0_36_update.html @@ -182,11 +182,6 @@
  • v0.95 GltfData.Dispose
  • v0.95 High-level API
  • v0.96.1 use gamma color space
  • -
  • RuntimeLoad
  • -
  • 🚧Humanoid
  • -
  • 🚧Expression
  • -
  • 🚧LookAt
  • -
  • FirstPerson
  • Build Application
  • @@ -200,12 +195,20 @@
  • glbフォーマット概説
  • +
  • VRM-1.0 の API +
  • Other