From 2cbcdf0ce210cba0b5dc72c5ff4bee9b055fe2c5 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 14 Sep 2021 13:32:22 +0900 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E6=9C=AC=E8=AA=9E=E3=83=89=E3=82=AD?= =?UTF-8?q?=E3=83=A5=E3=83=A1=E3=83=B3=E3=83=88=E3=82=92=20sphinx=20?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docfx/articles/ja/index.md | 3 - docfx/articles/ja/toc.yml | 51 -------------- docfx/articles/ja/vrm1/vrm1_lookat.md | 5 -- docs/.gitignore | 1 + docs/conf.py | 55 +++++++++++++++ .../articles/ja => docs}/gltf/0_36_update.md | 2 +- .../ja => docs}/gltf/0_82_glb_import.md | 43 ++++++------ .../ja => docs}/gltf/how_to_impl_extension.md | 20 +++--- {docfx/articles/ja => docs}/history.md | 0 docs/index.md | 67 +++++++++++++++++++ {docfx/articles/ja => docs}/package.md | 4 +- .../ja => docs}/vrm0/0_44_runtime_import.md | 2 + .../ja => docs}/vrm0/0_58_blendshape.md | 18 ++--- .../ja => docs}/vrm0/0_68_runtime_import.md | 12 ++-- .../ja => docs}/vrm0/0_77_runtime_import.md | 4 +- .../ja => docs}/vrm0/0_79_runtime_import.md | 6 +- .../ja => docs}/vrm0/0_82_runtime_import.md | 24 ++++--- .../articles/ja => docs}/vrm0/firstperson.md | 15 ++--- .../ja => docs}/vrm1/vrm1_expression.md | 9 +-- .../ja => docs}/vrm1/vrm1_firstperson.md | 12 ++-- .../ja => docs}/vrm1/vrm1_get_humanoid.md | 5 +- docs/vrm1/vrm1_lookat.md | 1 + .../ja => docs}/vrm1/vrm1_runtime_load.md | 2 +- 23 files changed, 208 insertions(+), 153 deletions(-) delete mode 100644 docfx/articles/ja/index.md delete mode 100644 docfx/articles/ja/toc.yml delete mode 100644 docfx/articles/ja/vrm1/vrm1_lookat.md create mode 100644 docs/.gitignore create mode 100644 docs/conf.py rename {docfx/articles/ja => docs}/gltf/0_36_update.md (96%) rename {docfx/articles/ja => docs}/gltf/0_82_glb_import.md (83%) rename {docfx/articles/ja => docs}/gltf/how_to_impl_extension.md (98%) rename {docfx/articles/ja => docs}/history.md (100%) create mode 100644 docs/index.md rename {docfx/articles/ja => docs}/package.md (97%) rename {docfx/articles/ja => docs}/vrm0/0_44_runtime_import.md (99%) rename {docfx/articles/ja => docs}/vrm0/0_58_blendshape.md (95%) rename {docfx/articles/ja => docs}/vrm0/0_68_runtime_import.md (97%) rename {docfx/articles/ja => docs}/vrm0/0_77_runtime_import.md (99%) rename {docfx/articles/ja => docs}/vrm0/0_79_runtime_import.md (78%) rename {docfx/articles/ja => docs}/vrm0/0_82_runtime_import.md (89%) rename {docfx/articles/ja => docs}/vrm0/firstperson.md (87%) rename {docfx/articles/ja => docs}/vrm1/vrm1_expression.md (87%) rename {docfx/articles/ja => docs}/vrm1/vrm1_firstperson.md (92%) rename {docfx/articles/ja => docs}/vrm1/vrm1_get_humanoid.md (75%) create mode 100644 docs/vrm1/vrm1_lookat.md rename {docfx/articles/ja => docs}/vrm1/vrm1_runtime_load.md (99%) diff --git a/docfx/articles/ja/index.md b/docfx/articles/ja/index.md deleted file mode 100644 index 234180dab..000000000 --- a/docfx/articles/ja/index.md +++ /dev/null @@ -1,3 +0,0 @@ -これは、開発者(UniVRMを使ったアプリケーションを作成する人)向けのドキュメントです。 - -UnityでVRMをエクスポートする方法などについては [manual](https://vrm.dev/docs/univrm/) を参照してください。 diff --git a/docfx/articles/ja/toc.yml b/docfx/articles/ja/toc.yml deleted file mode 100644 index 647ca117e..000000000 --- a/docfx/articles/ja/toc.yml +++ /dev/null @@ -1,51 +0,0 @@ -- name: 概要 - href: index.md - items: - - name: パッケージ構成 - href: package.md - - name: Version - href: history.md - -- name: glTF - items: - - name: GlbImport(0.82) - href: gltf/0_82_glb_import.md - - name: glTF拡張の実装(0.63.2) - href: gltf/how_to_impl_extension.md - - name: GltfUpdate(0.36) - href: gltf/0_36_update.md - -- name: VRM - items: - - name: 🚧Samples/SimpleViewer - - name: 🚧Samples/RuntimeExporerSample - - name: 🚧Samples/FirstPersonSample - - name: 🚧Samples/AnimationBridgeSample - - name: RuntimeImport(0.82) - href: vrm0/0_82_runtime_import.md - - name: RuntimeImport(0.79) - href: vrm0/0_79_runtime_import.md - - name: RuntimeImport(0.77) - href: vrm0/0_77_runtime_import.md - - name: RuntimeImport(0.68) - href: vrm0/0_68_runtime_import.md - - name: RuntimeImport(0.44) - href: vrm0/0_44_runtime_import.md - - name: BlendShapeProxy(0.58) - href: vrm0/0_58_blendshape.md - - name: FirstPerson - href: vrm0/firstperson.md - -- name: VRM-1.0(β) - items: - - name: 🚧Samples/VRM10Viewer - - name: RuntimeImport - href: vrm1/vrm1_runtime_load.md - - name: 🚧Humanoid - href: vrm1/vrm1_get_humanoid.md - - name: 🚧Expression - href: vrm1/vrm1_expression.md - - name: 🚧LookAt - href: vrm1/vrm1_lookat.md - - name: FirstPerson - href: vrm1/vrm1_firstperson.md diff --git a/docfx/articles/ja/vrm1/vrm1_lookat.md b/docfx/articles/ja/vrm1/vrm1_lookat.md deleted file mode 100644 index 179f374de..000000000 --- a/docfx/articles/ja/vrm1/vrm1_lookat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: 🚧LookAt -weight: 40 ---- - diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 000000000..9c5f57827 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1 @@ +_build \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 000000000..5652f49ab --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,55 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + +# -- Project information ----------------------------------------------------- + +project = 'UniVRM Programming Document' +copyright = '2021, VRM Consortium' +author = 'VRM Consortium' + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = ['myst_parser'] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = 'ja' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'classic' + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] \ No newline at end of file diff --git a/docfx/articles/ja/gltf/0_36_update.md b/docs/gltf/0_36_update.md similarity index 96% rename from docfx/articles/ja/gltf/0_36_update.md rename to docs/gltf/0_36_update.md index d7a1093dc..eca1eea3b 100644 --- a/docfx/articles/ja/gltf/0_36_update.md +++ b/docs/gltf/0_36_update.md @@ -1,4 +1,4 @@ -# v0.36 +# GltfUpdate(0.36) ## テクスチャ名の格納位置の修正 diff --git a/docfx/articles/ja/gltf/0_82_glb_import.md b/docs/gltf/0_82_glb_import.md similarity index 83% rename from docfx/articles/ja/gltf/0_82_glb_import.md rename to docs/gltf/0_82_glb_import.md index b5c0cfae7..2fcce636b 100644 --- a/docfx/articles/ja/gltf/0_82_glb_import.md +++ b/docs/gltf/0_82_glb_import.md @@ -1,3 +1,4 @@ +# GlbImport(0.82) `0.82.1` の API です。 `0.82.0` の場合は更新をお願いします。 @@ -7,55 +8,55 @@ 2. `GltfData` から `Unity Hierarchy` を ロード する。`RuntimeGltfInstance` を得る。 ローダーを破棄する。 3. ロードした `RuntimeGltfInstance` 使う。`RuntimeGltfInstance` を破棄する。 -# 1. パースする +## 1. パースする -## glb ファイルパスからパースする +### glb ファイルパスからパースする * `vrm` もこの関数を使います。 -```cs +```csharp GltfData Load(string path) { return new GlbFileParser(path).Parse(); } ``` -## glb バイト列をパースする +### glb バイト列をパースする * `vrm` もこの関数を使います。 -```cs +```csharp GltfData Load(byte[] bytes) { return new GlbBinaryParser(bytes, "LOAD_NAME").parse(); } ``` -## gltf ファイルパスからパースする +### gltf ファイルパスからパースする -```cs +```csharp GltfData Load(string path) { return new GltfFileWithResourceFilesParser(path).Parse(); } ``` -## zip アーカイブからパースする +### zip アーカイブからパースする gltf と関連するファイルを zip アーカイブしたファイルをパースできます(実験)。 -```cs +```csharp GltfData Load(string path) { return new ZipArchivedGltfFileParser(path).Parse(); } ``` -## ファイルパスの拡張子でパースする +### ファイルパスの拡張子でパースする サンプルの `SimpleViewer` を参考にしてください。 -```cs +```csharp GltfData Load(string path) { // ファイル拡張子で自動判定します @@ -63,11 +64,11 @@ GltfData Load(string path) } ``` -# 2. ロードする +## 2. ロードする -## sync +### sync -```cs +```csharp RuntimeGltfInstance Load(GltfData data) { // ImporterContext は使用後に Dispose を呼び出してください。 @@ -80,9 +81,9 @@ RuntimeGltfInstance Load(GltfData data) } ``` -## async +### async -```cs +```csharp async RuntimeGltfInstance Load(GltfData data) { // ImporterContext は使用後に Dispose を呼び出してください。 @@ -95,11 +96,11 @@ async RuntimeGltfInstance Load(GltfData data) } ``` -## materialGenerator で URP 用のマテリアルをロードする +### materialGenerator で URP 用のマテリアルをロードする `materialGenerator` 引き数(省略可能)を指定することで URP マテリアルを生成するようにカスタムできます。 -```cs +```csharp async RuntimeGltfInstance Load(GltfData data) { var materialGenerator = new GltfUrpMaterialDescriptorGenerator(); @@ -111,9 +112,9 @@ async RuntimeGltfInstance Load(GltfData data) } ``` -# 3. インスタンスを使用する +## 3. インスタンスを使用する -```cs +```csharp // SkinnedMeshRenderer に対する指示 instance.EnableUpdateWhenOffscreen(); // 準備ができたら表示する(デフォルトでは非表示) @@ -121,6 +122,6 @@ instance.ShowMeshes(); ``` 使用後に以下のように破棄してください。関連する Asset(Texture, Material, Meshなど)も破棄されます。 -```cs +```csharp GameObject.Destroy(instance); ``` diff --git a/docfx/articles/ja/gltf/how_to_impl_extension.md b/docs/gltf/how_to_impl_extension.md similarity index 98% rename from docfx/articles/ja/gltf/how_to_impl_extension.md rename to docs/gltf/how_to_impl_extension.md index 00d6004ca..d1b6b500e 100644 --- a/docfx/articles/ja/gltf/how_to_impl_extension.md +++ b/docs/gltf/how_to_impl_extension.md @@ -1,3 +1,5 @@ +# glTF拡張の実装(0.63.2) + `UniVRM-0.63.2` から `UniGLTF` の構成が変わって、 `extensions` / `extras` の実装方法が変わりました。 ## GLTF 拡張とは @@ -26,7 +28,7 @@ `v0.63.0` 以前は、`GLTF 型` の `extensions` フィールドに、`GLTFExtensions` 型を定義して、`VRM` フィールドを定義するという方法をとっていました。 -```cs +```csharp class VRM { @@ -49,7 +51,7 @@ class GLTF `v0.63.1` から設計を変更して、すべての `extensions/extras` に同じ型の入れ物を使うように変更しました。 UniGLTF は `import/export` の具体的な内容を知らずに中間データの入れ物として扱います。 -```cs +```csharp // extensions / extras の入れ物として使う型 // 実行時は、 glTFExtensionImport / glTFExtensionExport を使う public abstract class glTFExtension @@ -126,7 +128,7 @@ void ImportMaterial(UniGLTF.glTFMaterial material) ### export -```cs +```csharp void SerializeGoodMaterial(UniJSON.JsonFormatter f, GoodMaterial value) { // シリアライズ。手で書くかコード生成する(後述) @@ -255,7 +257,7 @@ C# の型から生成するものと、JsonSchema から C# の型とともに * `Assets\UniGLTF\Editor\UniGLTF\Serialization\SerializerGenerator.cs` -```cs +```csharp using System; using System.Collections.Generic; using System.IO; @@ -331,7 +333,7 @@ namespace UniGLTF { * `Assets\UniGLTF\Editor\UniGLTF\Serialization\DeserializerGenerator.cs` -```cs +```csharp using System.IO; using System.Reflection; using System.Text; @@ -401,21 +403,21 @@ public static class GltfDeserializer TODO: `int?` にするべきだった -```cs +```csharp [JsonSchema(Minimum = 0)] int index = -1; ``` のようにすることで、キーの出力を抑制できます。 -```cs +```csharp // 生成コードのキー出力例 if(value.index>=0){ ``` 何も付けないと -```cs +```csharp // 出力制御無し if(true){ ``` @@ -425,7 +427,7 @@ int index = -1; enumの値の名前を文字列で使う、enumの値の数値を使うの2種類がありえます。 enumの場合はデフォルト値が無いので必須です。 -```cs +```csharp [JsonSchema(EnumSerializationType = EnumSerializationType.AsInt)] public glBufferTarget target; diff --git a/docfx/articles/ja/history.md b/docs/history.md similarity index 100% rename from docfx/articles/ja/history.md rename to docs/history.md diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 000000000..2161c4bf6 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,67 @@ +# UniVRM Programming Document + +これは、開発者(UniVRMを使ったアプリケーションを作成する人)向けのドキュメントです。 + +UnityでVRMをエクスポートする方法などについては [manual](https://vrm.dev/docs/univrm/) を参照してください。 + +## 概要 + +```{toctree} +:maxdepth: 1 + +package.md +history.md +``` + +## glTF + +```{toctree} +:maxdepth: 1 + +gltf/0_82_glb_import.md +gltf/how_to_impl_extension.md +gltf/0_36_update.md +``` + +## VRM + +```{toctree} +:maxdepth: 1 + +vrm0/0_82_runtime_import.md +vrm0/0_79_runtime_import.md +vrm0/0_77_runtime_import.md +vrm0/0_68_runtime_import.md +vrm0/0_44_runtime_import.md +vrm0/0_58_blendshape.md +vrm0/firstperson.md +``` + +### Samples + +- SimpleViewer +- RuntimeExporerSample +- FirstPersonSample +- AnimationBridgeSample + +## VRM-1.0(β) + +```{toctree} +:maxdepth: 2 + +vrm1/vrm1_runtime_load.md +vrm1/vrm1_get_humanoid.md +vrm1/vrm1_expression.md +vrm1/vrm1_lookat.md +vrm1/vrm1_firstperson.md +``` + +### Samples + +- VRM10Viewer + +# Indices and tables + +* {ref}`genindex` +* {ref}`modindex` +* {ref}`search` diff --git a/docfx/articles/ja/package.md b/docs/package.md similarity index 97% rename from docfx/articles/ja/package.md rename to docs/package.md index eb0638246..601252e6a 100644 --- a/docfx/articles/ja/package.md +++ b/docs/package.md @@ -1,5 +1,7 @@ # パッケージ構成 +## パッケージ + | unitypackage | folder | contents | |--------------------|-----------------------------------|-----------------------| | VRMShaders_UniGLTF | Assets/VRMShaders, Assets/UniGLTF | VRMShaders と UniGLTF | @@ -17,7 +19,7 @@ +----------------------+ ``` -# UPM +## UPM ```json // manifest.json 抜粋 diff --git a/docfx/articles/ja/vrm0/0_44_runtime_import.md b/docs/vrm0/0_44_runtime_import.md similarity index 99% rename from docfx/articles/ja/vrm0/0_44_runtime_import.md rename to docs/vrm0/0_44_runtime_import.md index 88739adc1..1332997cd 100644 --- a/docfx/articles/ja/vrm0/0_44_runtime_import.md +++ b/docs/vrm0/0_44_runtime_import.md @@ -1,3 +1,5 @@ +# RuntimeImport(0.44) + ## `Version 0.44~` LoadAsyncの例 ```csharp diff --git a/docfx/articles/ja/vrm0/0_58_blendshape.md b/docs/vrm0/0_58_blendshape.md similarity index 95% rename from docfx/articles/ja/vrm0/0_58_blendshape.md rename to docs/vrm0/0_58_blendshape.md index 446e36f3d..022e76e2f 100644 --- a/docfx/articles/ja/vrm0/0_58_blendshape.md +++ b/docs/vrm0/0_58_blendshape.md @@ -1,13 +1,5 @@ ---- -title: BlendShapeProxyの使い方 -date: 2018-04-16T16:30:00+09:00 -aliases: [ - "/dev/univrm-0.xx/programming/univrm_use_blendshape/", - "/univrm/programming/how_to_use_blendshapeproxy/", - ] -weight: 3 -tags: ["api"] ---- +# BlendShapeProxy(0.58) + ## 環境 UniVRM v0.58.0 @@ -103,7 +95,7 @@ BlendShape同士が競合することがわかりました。 例: -```cs +```csharp var proxy = GetComponent(); proxy.ImmediatelySetValue(BlendShapeKey.CreateFromPreset(BlendShapePreset.A), 1.0f); @@ -113,7 +105,7 @@ proxy.ImmediatelySetValue(BlendShapeKey.CreateFromPreset(BlendShapePreset.A), 1. 例: -```cs +```csharp var proxy = GetComponent(); proxy.AccumulateValue(BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_L), 1.0f); // すぐに適用せずにたくわえる @@ -129,7 +121,7 @@ BlendShape合成器が必要に応じ呼び出すことを想定しています 例: -```cs +```csharp var proxy = GetComponent(); proxy.SetValues(new Dictionary diff --git a/docfx/articles/ja/vrm0/0_68_runtime_import.md b/docs/vrm0/0_68_runtime_import.md similarity index 97% rename from docfx/articles/ja/vrm0/0_68_runtime_import.md rename to docs/vrm0/0_68_runtime_import.md index 7f2fbe534..55b9cdc74 100644 --- a/docfx/articles/ja/vrm0/0_68_runtime_import.md +++ b/docs/vrm0/0_68_runtime_import.md @@ -1,6 +1,6 @@ -## `Version 0.68~` +# RuntimeImport(0.68) -### 過去バージョンからの仕様変更 +## 過去バージョンからの仕様変更 `ImporterContext` の仕様を変更しました。 @@ -17,9 +17,9 @@ * VRM の GameObject の破棄タイミングでリソース (Texture, Material, Mesh, etc) を破棄します。 -### サンプルコード(同期的ロード) +## サンプルコード(同期的ロード) -```cs +```csharp using UniGLTF; using UnityEngine; using VRM; @@ -85,9 +85,9 @@ namespace YourNameSpace } ``` -### サンプルコード(非同期ロード) +## サンプルコード(非同期ロード) -```cs +```csharp using System.IO; using System.Threading.Tasks; using UniGLTF; diff --git a/docfx/articles/ja/vrm0/0_77_runtime_import.md b/docs/vrm0/0_77_runtime_import.md similarity index 99% rename from docfx/articles/ja/vrm0/0_77_runtime_import.md rename to docs/vrm0/0_77_runtime_import.md index c2c2f3587..973c902d9 100644 --- a/docfx/articles/ja/vrm0/0_77_runtime_import.md +++ b/docs/vrm0/0_77_runtime_import.md @@ -1,4 +1,4 @@ -## `Version 0.77~` +# RuntimeImport(0.77) [DisposeOnGameObjectDestroyed](https://github.com/vrm-c/UniVRM/issues/1018) @@ -17,7 +17,7 @@ Load の呼び出し後の任意のタイミングで ImporterContext.Dispose で Importer を破棄してください。 任意のタイミングで RuntimeGltfInstance を Destory することで紐づくリソース (Texture, Material, Mesh, etc) も破棄されます。 -```cs +```csharp using UniGLTF; using UnityEngine; diff --git a/docfx/articles/ja/vrm0/0_79_runtime_import.md b/docs/vrm0/0_79_runtime_import.md similarity index 78% rename from docfx/articles/ja/vrm0/0_79_runtime_import.md rename to docs/vrm0/0_79_runtime_import.md index 309abcfe8..656b6801f 100644 --- a/docfx/articles/ja/vrm0/0_79_runtime_import.md +++ b/docs/vrm0/0_79_runtime_import.md @@ -1,12 +1,12 @@ -## `Version 0.79` +# RuntimeImport(0.79) `GltfParser` と `GltfData` の分割 -```cs +```csharp var parser = new GltfParser(); parser.ParsePath(path); ``` -```cs +```csharp GltfData data = new GlbFileParser(path).Parse(); ``` diff --git a/docfx/articles/ja/vrm0/0_82_runtime_import.md b/docs/vrm0/0_82_runtime_import.md similarity index 89% rename from docfx/articles/ja/vrm0/0_82_runtime_import.md rename to docs/vrm0/0_82_runtime_import.md index fba95d61c..c23583d92 100644 --- a/docfx/articles/ja/vrm0/0_82_runtime_import.md +++ b/docs/vrm0/0_82_runtime_import.md @@ -1,3 +1,5 @@ +# RuntimeImport(0.82) + * `Version 0.82.0` は `0.82.1` 以降を使ってください。 * `Version 0.82.1~` @@ -10,9 +12,9 @@ サンプルの `Assets\VRM\Samples\SimpleViewer\ViewerUI.cs` も参照してください。 -# 1. `GltfData` を得る +## 1. `GltfData` を得る -```cs +```csharp GltfData Load(string path) { return new GlbFileParser(path).Parse(); @@ -21,15 +23,15 @@ GltfData Load(string path) [GLB import](../gltf/0_82_glb_import.md) も参照してください。 -# 2. `VRMData` を得る +## 2. `VRMData` を得る -```cs +```csharp VRMData vrm = new VRMData(data); ``` -# 3. Load する +## 3. Load する -```cs +```csharp async RuntimeGltfInstance Load(VRMData vrm) { // 使用後に Dispose で VRMImporterContext を破棄してください。 @@ -41,12 +43,12 @@ async RuntimeGltfInstance Load(VRMData vrm) } ``` -## URP 向けに `materialGenerator` を指定する(実験) +### URP 向けに `materialGenerator` を指定する(実験) `materialGenerator` 引き数(省略可能)を指定することで URP マテリアルを生成するようにカスタムできます。 指定しない場合は `built-in` 向けのデフォルトが使用されます。 -```cs +```csharp async RuntimeGltfInstance Load(VRMData vrm) { var materialGenerator = new VRMUrpMaterialDescriptorGenerator(vrm.VrmExtension); @@ -60,9 +62,9 @@ async RuntimeGltfInstance Load(VRMData vrm) * まだ URP 向け MToonShader が作成されていないので、`UniUnlit` にフォールバックします。 -# 4. Instance +## 4. Instance -```cs +```csharp // SkinnedMeshRenderer に対する指示 instance.EnableUpdateWhenOffscreen(); // 準備ができたら表示する(デフォルトでは非表示) @@ -70,7 +72,7 @@ instance.ShowMeshes(); ``` 使用後に以下のように破棄してください。関連する Asset(Texture, Material, Meshなど)も破棄されます。 -```cs +```csharp // GameObject.Destroy(instance); // RuntimeGltfInstance ではなくて、その GameObject を Destroy します。 diff --git a/docfx/articles/ja/vrm0/firstperson.md b/docs/vrm0/firstperson.md similarity index 87% rename from docfx/articles/ja/vrm0/firstperson.md rename to docs/vrm0/firstperson.md index 0d00ed22d..99e189afd 100644 --- a/docfx/articles/ja/vrm0/firstperson.md +++ b/docs/vrm0/firstperson.md @@ -1,13 +1,6 @@ ---- -title: "VRMFirstPersonの使い方" -linkTitle: "一人称モードの使い方" -date: 2018-05-29T10:00:00+09:00 -aliases: ["/dev/univrm-0.xx/programming/univrm_use_firstperson/"] -weight: 5 -tags: ["api"] ---- +# VRMFirstPersonの使い方 -# VRMFirstPersonの設定 +## VRMFirstPersonの設定 [VRMFirstPerson]({{< relref "univrm_firstperson.md" >}})ではRendererに対して設定があります。 |FirstPersonFlag |レイヤー |備考 | @@ -19,7 +12,7 @@ tags: ["api"] 実行時に**VRMFirstPerson.Setup**を呼び出すことで、上記のレイヤー設定を行うことができます。明示的に外部から呼び出してください。 -# アプリケーションに追加の描画レイヤーを指定する +## アプリケーションに追加の描画レイヤーを指定する 定数で以下のレイヤーを定義しています。 @@ -37,7 +30,7 @@ public class VRMFirstPerson : MonoBehaviour |-----| |9番と10番にLayerを設定| -# 実行時にSetupを呼び出して、カメラにLayerMaskを設定する +## 実行時にSetupを呼び出して、カメラにLayerMaskを設定する * VRMFirstPerson.Setupの呼び出し * 一人称カメラとその他のカメラに対してLayerMask diff --git a/docfx/articles/ja/vrm1/vrm1_expression.md b/docs/vrm1/vrm1_expression.md similarity index 87% rename from docfx/articles/ja/vrm1/vrm1_expression.md rename to docs/vrm1/vrm1_expression.md index dcae23152..c107ea7a6 100644 --- a/docfx/articles/ja/vrm1/vrm1_expression.md +++ b/docs/vrm1/vrm1_expression.md @@ -1,7 +1,4 @@ ---- -title: 🚧Expression -weight: 30 ---- +# 🚧Expression 表情周りの操作方法。 @@ -9,7 +6,7 @@ weight: 30 VRM-0.X の例 -```cs +```csharp void SetExpression(GameObject root) { var controller = root.GetComponent(); @@ -18,7 +15,7 @@ void SetExpression(GameObject root) VRM-1.0 の例 -```cs +```csharp void SetExpression(GameObject root) { var controller = root.GetComponent(); diff --git a/docfx/articles/ja/vrm1/vrm1_firstperson.md b/docs/vrm1/vrm1_firstperson.md similarity index 92% rename from docfx/articles/ja/vrm1/vrm1_firstperson.md rename to docs/vrm1/vrm1_firstperson.md index b7858ddb0..14bdbbfdf 100644 --- a/docfx/articles/ja/vrm1/vrm1_firstperson.md +++ b/docs/vrm1/vrm1_firstperson.md @@ -1,4 +1,6 @@ -# Runtime に FirstPerson 機能を有効にする +# FirstPerson + +## Runtime に FirstPerson 機能を有効にする VR向け FirstPerson 設定の初期化手順です。 @@ -8,7 +10,7 @@ VR向け FirstPerson 設定の初期化手順です。 4. `controller.Vrm.FirstPerson.SetupAsync` した結果新規に作成されたモデルを `RuntimeGltfInstance` に渡す 5. ShowMeshes -```cs +```csharp async Task LoadAsync(string path) { var data = new GlbFileParser(path).Parse(); @@ -38,7 +40,7 @@ async Task LoadAsync(string path) } ``` -# VRMの推奨する VR 向けのカメラ構成 +## VRMの推奨する VR 向けのカメラ構成 ヘッドマウントディスプレイを表すカメラ と その他のカメラという2種類のカメラを想定ます。 それぞれに対して、 @@ -57,10 +59,10 @@ VRMは、`VRMFirstPersonOnly` と `VRMThirdPersonOnly` という名前のレイ 設定してください。 サンプルでは、それぞれに `9` と `10` を割り当ています。 -# 初期化時に layer を明示する +## 初期化時に layer を明示する 追加の引数で指定できます。 -```cs +```csharp var created = await controller.Vrm.FirstPerson.SetupAsync(controller.gameObject, firstPersonOnlyLayer: 9, thirdPersonOnlyLayer: 10); ``` diff --git a/docfx/articles/ja/vrm1/vrm1_get_humanoid.md b/docs/vrm1/vrm1_get_humanoid.md similarity index 75% rename from docfx/articles/ja/vrm1/vrm1_get_humanoid.md rename to docs/vrm1/vrm1_get_humanoid.md index cdcaec66a..814cefea3 100644 --- a/docfx/articles/ja/vrm1/vrm1_get_humanoid.md +++ b/docs/vrm1/vrm1_get_humanoid.md @@ -1,7 +1,4 @@ ---- -title: 🚧Humanoid -weight: 20 ---- +# 🚧Humanoid ## Humanoid Bone の取得方法 diff --git a/docs/vrm1/vrm1_lookat.md b/docs/vrm1/vrm1_lookat.md new file mode 100644 index 000000000..f32f1b88b --- /dev/null +++ b/docs/vrm1/vrm1_lookat.md @@ -0,0 +1 @@ +# 🚧LookAt diff --git a/docfx/articles/ja/vrm1/vrm1_runtime_load.md b/docs/vrm1/vrm1_runtime_load.md similarity index 99% rename from docfx/articles/ja/vrm1/vrm1_runtime_load.md rename to docs/vrm1/vrm1_runtime_load.md index b9dcd8aa1..9296818ba 100644 --- a/docfx/articles/ja/vrm1/vrm1_runtime_load.md +++ b/docs/vrm1/vrm1_runtime_load.md @@ -6,7 +6,7 @@ サンプルの `Assets\VRM10\Samples\VRM10Viewer\VRM10ViewerUI.cs` も参照してください。 -```cs +```csharp static IMaterialDescriptorGenerator GetVrmMaterialDescriptorGenerator(bool useUrp) { if (useUrp)