mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-04-19 21:47:46 -05:00
update po
This commit is contained in:
parent
abc6610fe2
commit
bf77f86e2b
|
|
@ -1,32 +0,0 @@
|
|||
# v0.36
|
||||
|
||||
## Changed Storage Position of Texture Name
|
||||
|
||||
Conforming to the GLTF specification.
|
||||
|
||||
```json
|
||||
json.images[i].extra.name
|
||||
```
|
||||
|
||||
After the change
|
||||
|
||||
```json
|
||||
json.images[i].name
|
||||
```
|
||||
|
||||
## Changed Storage Position BlendShape Name
|
||||
|
||||
Conforming to the GLTF specification.
|
||||
|
||||
* `extras` is not allowed in target
|
||||
* https://github.com/KhronosGroup/glTF/issues/1036#issuecomment-314078356
|
||||
|
||||
```json
|
||||
json.meshes[i].primitives[j].targets[k].extra.name
|
||||
```
|
||||
|
||||
After the change
|
||||
|
||||
```json
|
||||
json.meshes[i].primitives[j].extras.targetNames[k]
|
||||
```
|
||||
|
|
@ -1,127 +0,0 @@
|
|||
This is `0.82.1` API.
|
||||
If use `0.82.0`, please upgrade.
|
||||
|
||||
GLB load is below steps.
|
||||
|
||||
1. Parse `GLB` / `GLTF`, get a `GltfData`
|
||||
2. Load `Unity Hierarchy` from the `GltfData`, get a `RuntimeGltfInstance`, dispose loader.
|
||||
3. Use the `RuntimeGltfInstance`, destroy the `RuntimeGltfInstance`.
|
||||
|
||||
# 1. Parse
|
||||
|
||||
## Parse glb from file path
|
||||
|
||||
* same as `vrm`
|
||||
|
||||
```cs
|
||||
GltfData Load(string path)
|
||||
{
|
||||
return new GlbFileParser(path).Parse();
|
||||
}
|
||||
```
|
||||
|
||||
## Parse glb byte array
|
||||
|
||||
* same as `vrm`
|
||||
|
||||
```cs
|
||||
GltfData Load(byte[] bytes)
|
||||
{
|
||||
return new GlbBinaryParser(bytes, "LOAD_NAME").parse();
|
||||
}
|
||||
```
|
||||
|
||||
## Parse gltf from file path
|
||||
|
||||
```cs
|
||||
GltfData Load(string path)
|
||||
{
|
||||
return new GltfFileWithResourceFilesParser(path).Parse();
|
||||
}
|
||||
```
|
||||
|
||||
## Parse gltf in zip archive from file path
|
||||
|
||||
Zip archive that contain gltf and related files can parsed (experimental).
|
||||
|
||||
```cs
|
||||
GltfData Load(string path)
|
||||
{
|
||||
return new ZipArchivedGltfFileParser(path).Parse();
|
||||
}
|
||||
```
|
||||
|
||||
## Parse by file extension
|
||||
|
||||
See `SimpleViewer` sample.
|
||||
|
||||
```cs
|
||||
GltfData Load(string path)
|
||||
{
|
||||
// Detect type by file extension automatically
|
||||
return new AutoGltfFileParser(path).Parse();
|
||||
}
|
||||
```
|
||||
|
||||
# 2. Load
|
||||
|
||||
## sync
|
||||
|
||||
```cs
|
||||
RuntimeGltfInstance Load(GltfData data)
|
||||
{
|
||||
// Call ImporterContext.Dispose after load.
|
||||
// Automatically load dispose by using.
|
||||
using(var loader = new UniGLTF.ImporterContext(data)
|
||||
{
|
||||
var instance = loader.Load();
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## async
|
||||
|
||||
```cs
|
||||
async RuntimeGltfInstance Load(GltfData data)
|
||||
{
|
||||
// Call ImporterContext.Dispose after load.
|
||||
// Automatically load dispose by using.
|
||||
using(var loader = new UniGLTF.ImporterContext(data)
|
||||
{
|
||||
var instance = await loader.LoadAsync();
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Load URP material by materialGenerator argument
|
||||
|
||||
You can load URP materials by setting the `materialGenerator` Argument (optional).
|
||||
|
||||
```cs
|
||||
async RuntimeGltfInstance Load(GltfData data)
|
||||
{
|
||||
var materialGenerator = new GltfUrpMaterialDescriptorGenerator();
|
||||
using(var loader = new UniGLTF.ImporterContext(data, materialGenerator: materialGenerator)
|
||||
{
|
||||
var instance = await loader.LoadAsync();
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
# 3. Use instance
|
||||
|
||||
```cs
|
||||
// Setup for SkinnedMeshRenderer
|
||||
instance.EnableUpdateWhenOffscreen();
|
||||
// Show meshes when ready(invisible by default)
|
||||
instance.ShowMeshes();
|
||||
```
|
||||
|
||||
Destroy after use and discard related assets (textures, materials, meshes, etc.)
|
||||
|
||||
```cs
|
||||
GameObject.Destroy(instance);
|
||||
```
|
||||
|
|
@ -1,440 +0,0 @@
|
|||
From `UniVRM-0.63.2` , `UniGLTF` structure is changed, cause `extensions` / `extras` implementations is updated.
|
||||
|
||||
## About GLTF Extensions
|
||||
|
||||
`glTF` has each `extensions`, `extras` points.
|
||||
|
||||
* `extensions` (or extras)
|
||||
* `asset.extensions` (or はextras)
|
||||
* `meshes[*].extensions` (or はextras)
|
||||
* `materials[*].extensions` (or はextras)
|
||||
|
||||
etc...
|
||||
|
||||
`extensions` is defined specification officially, and publish `JsonSchema`.
|
||||
|
||||
* https://github.com/KhronosGroup/glTF/tree/master/extensions
|
||||
|
||||
`extensions` naming convention is `{VENDOR_NAME}_{EXTENSION_NAME}`.
|
||||
VENDOR_NAME can registered on https://github.com/KhronosGroup/glTF.
|
||||
|
||||
`extras` is defined in application local.
|
||||
|
||||
> This enables glTF models to contain application-specific properties without creating a full glTF extension
|
||||
|
||||
## UniGLTF の extensions
|
||||
|
||||
Before `v0.63.0`, `GLTF type` 's `extensions` field is statically extended as `GLTFExtensions Type`, and had `VRM type` field.
|
||||
|
||||
```cs
|
||||
class VRM
|
||||
{
|
||||
}
|
||||
|
||||
class GLTFExtensions
|
||||
{
|
||||
public VRM VRM;
|
||||
}
|
||||
|
||||
class GLTF
|
||||
{
|
||||
// all types require in compile time. cannot extend dynamically.
|
||||
public GLTFExtensions extensions;
|
||||
}
|
||||
```
|
||||
|
||||
TODO:
|
||||
|
||||
この設計だと GLTF と拡張を別ライブラリとして分離することができませんでした。
|
||||
|
||||
`v0.63.1` から設計を変更して、すべての `extensions/extras` に同じ型の入れ物を使うように変更しました。
|
||||
UniGLTF は `import/export` の具体的な内容を知らずに中間データの入れ物として扱います。
|
||||
|
||||
```cs
|
||||
// extensions / extras の入れ物として使う型
|
||||
// 実行時は、 glTFExtensionImport / glTFExtensionExport を使う
|
||||
public abstract class glTFExtension
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
class GLTF
|
||||
{
|
||||
// UniGLTFは具体的な型を知らない。利用側が処理(serialize/deserialize)する
|
||||
public glTFExtension extensions;
|
||||
}
|
||||
```
|
||||
|
||||
## UniGLTF の拡張の書き方
|
||||
|
||||
拡張は、以下の部品要素から作れます。
|
||||
|
||||
* 名前(JsonPath)。例: `extensions.VRM`, `materials[*].extensions.KHR_materials_unlit`
|
||||
* 拡張の型。`T型`
|
||||
* デシリアライザー(import)。 `jsonバイト列 => T型`
|
||||
* シリアライザーexport)。`T型 => jsonバイト列`
|
||||
|
||||
### JSONPATH と 型を決める
|
||||
|
||||
```C#
|
||||
// 型
|
||||
class GoodMaterial
|
||||
{
|
||||
// `materials[*].extensions.CUSTOM_materials_good`
|
||||
public const string EXTENSION_NAME = "CUSTOM_materials_good";
|
||||
|
||||
public int GoodValue;
|
||||
}
|
||||
```
|
||||
|
||||
### import
|
||||
|
||||
```C#
|
||||
GoodMaterial DeserializeGoodMaterial(ListTreeNode<JsonValue> json)
|
||||
{
|
||||
// デシリアライズ。手で書くかコード生成する(後述)
|
||||
}
|
||||
|
||||
// ユーティリティ関数例
|
||||
bool TryGetExtension<T>(UniGLTF.glTFExtension extension, string key, Func<ListTreeNode<JsonValue>, T> deserializer, out T value)
|
||||
{
|
||||
if(material.extensions is UniGLTF.glTFExtensionsImport import)
|
||||
{
|
||||
// null check 完了
|
||||
foreach(var kv in import.ObjectItems())
|
||||
{
|
||||
if(kv.key.GetString()==key)
|
||||
{
|
||||
value = Deserialize(kv.Value);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
value = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
void ImportMaterial(UniGLTF.glTFMaterial material)
|
||||
{
|
||||
// material の処理に割り込んで
|
||||
if(TryGetExtension(material.extension, GoodMaterial.EXTENSION_NAME, DeserializeGoodMaterial, out GoodMaterial good))
|
||||
{
|
||||
// good material 独自の処理
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### export
|
||||
|
||||
```cs
|
||||
void SerializeGoodMaterial(UniJSON.JsonFormatter f, GoodMaterial value)
|
||||
{
|
||||
// シリアライズ。手で書くかコード生成する(後述)
|
||||
}
|
||||
|
||||
// ユーティリティ関数例
|
||||
public ArraySegment<byte> SerializeExtension<T>(T value, Func<T, ArraySegment<byte>> serialize)
|
||||
{
|
||||
var f = new UniJSON.JsonFormatter();
|
||||
serialize(f, value);
|
||||
return f.GetStoreBytes();
|
||||
}
|
||||
|
||||
void ExportGoodMaterial(UniGLTF.glTFMaterial material, GoodMaterial good)
|
||||
{
|
||||
// material の処理に割り込んで
|
||||
if(!(material.extensions is UniGLTF.glTFExtensionsExport export))
|
||||
{
|
||||
// 無かった。新規作成
|
||||
export = new UniGLTF.glTFExtensionsExport();
|
||||
material.extensions = export;
|
||||
}
|
||||
|
||||
var bytes = SerializeExtension(good, SerializeGoodMaterial);
|
||||
export.Add(GoodMaterial.EXTENSION_NAME, bytes);
|
||||
}
|
||||
```
|
||||
|
||||
## 実装例
|
||||
|
||||
### GLTF: GLTF全体
|
||||
`C#の型からコード生成`
|
||||
|
||||
* `Assets\UniGLTF\Runtime\UniGLTF\Format\GltfSerializer.g.cs`
|
||||
* `Assets\UniGLTF\Runtime\UniGLTF\Format\GltfDeserializer.g.cs`
|
||||
|
||||
ジェネレーターの呼び出しコード
|
||||
|
||||
* `Assets\UniGLTF\Editor\UniGLTF\Serialization\SerializerGenerator.cs`
|
||||
* `Assets\UniGLTF\Editor\UniGLTF\Serialization\DeserializerGenerator.cs`
|
||||
|
||||
生成コードの呼び出し
|
||||
|
||||
### GLTF: `meshes[*].extras.targetNames`
|
||||
`コード生成せずに手書き`
|
||||
|
||||
* `Assets\UniGLTF\Runtime\UniGLTF\Format\ExtensionsAndExtras\gltf_mesh_extras_targetNames.cs`
|
||||
|
||||
生成コードの呼び出し
|
||||
|
||||
### GLTF: `materials[*].extensions.KHR_materials_unlit`
|
||||
`コード生成せずに手書き`
|
||||
|
||||
* `Assets\UniGLTF\Runtime\UniGLTF\Format\ExtensionsAndExtras\KHR_materials_unlit.cs`
|
||||
|
||||
生成コードの呼び出し
|
||||
|
||||
### GLTF: `materials[*].extensions.KHR_texture_transform`
|
||||
`コード生成せずに手書き`
|
||||
|
||||
* `Assets\UniGLTF\Runtime\UniGLTF\Format\ExtensionsAndExtras\KHR_texture_transform.cs`
|
||||
|
||||
生成コードの呼び出し
|
||||
|
||||
* https://github.com/vrm-c/UniVRM/blob/master/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialImporter.cs#L296
|
||||
* https://github.com/vrm-c/UniVRM/blob/master/Assets/UniGLTF/Runtime/UniGLTF/IO/MaterialExporter.cs#L193
|
||||
|
||||
### VRM0: `extensions.VRM`
|
||||
`C#の型からコード生成`
|
||||
|
||||
* `Assets\VRM\Runtime\Format\VRMSerializer.g.cs`
|
||||
* `Assets\VRM\Runtime\Format\VRMDeserializer.g.cs`
|
||||
|
||||
ジェネレーターの呼び出しコード
|
||||
|
||||
* `Assets\VRM\Editor\VRMSerializerGenerator.cs`
|
||||
* `Assets\VRM\Editor\VRMDeserializerGenerator.cs`
|
||||
|
||||
生成コードの呼び出し
|
||||
|
||||
* https://github.com/vrm-c/UniVRM/blob/master/Assets/VRM/Runtime/IO/VRMImporterContext.cs#L41
|
||||
* https://github.com/vrm-c/UniVRM/blob/master/Assets/VRM/Runtime/IO/VRMExporter.cs#L209
|
||||
|
||||
### VRM1: `extensions.VRMC_vrm` など
|
||||
`JsonSchemaからコード生成`
|
||||
|
||||
5つの Extensions に分かれたので個別に作成。
|
||||
ささる場所(JsonPath)が違うのに注意。
|
||||
|
||||
#### `extensions.VRMC_vrm`
|
||||
* `Assets\VRM10\Runtime\Format\VRM`
|
||||
|
||||
#### `materials[*].extensions.VRMC_materials_mtoon`
|
||||
* `Assets\VRM10\Runtime\Format\MaterialsMToon`
|
||||
|
||||
#### `nodes[*].extensions.VRMC_node_collider`
|
||||
* `Assets\VRM10\Runtime\Format\NodeCollider`
|
||||
|
||||
#### `extensions.VRMC_springBone`
|
||||
* `Assets\VRM10\Runtime\Format\SpringBone`
|
||||
|
||||
#### `extensions.VRMC_vrm_constraints`
|
||||
* `Assets\VRM10\Runtime\Format\Constraints`
|
||||
|
||||
#### ジェネレーターの呼び出しコード
|
||||
* `Assets\VRM10\Editor\GeneratorMenu.cs`
|
||||
|
||||
#### 生成コードの呼び出し
|
||||
|
||||
## コード生成
|
||||
JSON と C# の型との シリアライズ/デシリアライズは定型コードになるので、ジェネレーターがあります。
|
||||
C# の型から生成するものと、JsonSchema から C# の型とともに生成するものがあります。
|
||||
|
||||
### C# の型から生成
|
||||
|
||||
#### シリアライザー
|
||||
|
||||
ジェネレーターを呼び出すコードを作成します。
|
||||
|
||||
* 元になる型
|
||||
* 出力先
|
||||
|
||||
の2つを決めます。static関数を生成するので、namespace と static class で囲ってあげます。
|
||||
|
||||
例
|
||||
|
||||
* `Assets\UniGLTF\Editor\UniGLTF\Serialization\SerializerGenerator.cs`
|
||||
|
||||
```cs
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using UniJSON;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UniGLTF
|
||||
{
|
||||
public static class SerializerGenerator
|
||||
{
|
||||
const BindingFlags FIELD_FLAGS = BindingFlags.Instance | BindingFlags.Public;
|
||||
|
||||
const string Begin = @"// Don't edit manually. This is generaged.
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UniJSON;
|
||||
|
||||
namespace UniGLTF {
|
||||
|
||||
static public class GltfSerializer
|
||||
{
|
||||
|
||||
";
|
||||
|
||||
const string End = @"
|
||||
} // class
|
||||
} // namespace
|
||||
";
|
||||
|
||||
static string OutPath
|
||||
{
|
||||
get
|
||||
{
|
||||
return Path.Combine(UnityEngine.Application.dataPath,
|
||||
"UniGLTF/UniGLTF/Scripts/IO/GltfSerializer.g.cs");
|
||||
}
|
||||
}
|
||||
|
||||
[MenuItem(UniGLTFVersion.MENU + "/GLTF: Generate Serializer")]
|
||||
static void GenerateSerializer()
|
||||
{
|
||||
var info = new ObjectSerialization(typeof(glTF), "gltf", "Serialize_");
|
||||
Debug.Log(info);
|
||||
|
||||
using (var s = File.Open(OutPath, FileMode.Create))
|
||||
using (var w = new StreamWriter(s, new UTF8Encoding(false)))
|
||||
{
|
||||
w.Write(Begin);
|
||||
info.GenerateSerializer(w, "Serialize");
|
||||
w.Write(End);
|
||||
}
|
||||
|
||||
Debug.LogFormat("write: {0}", OutPath);
|
||||
UnityPath.FromFullpath(OutPath).ImportAsset();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### デシリアライザー
|
||||
|
||||
ジェネレーターを呼び出すコードを作成します。
|
||||
|
||||
* 元になる型
|
||||
* 出力先
|
||||
|
||||
の2つを決めます。static関数を生成するので、namespace と static class で囲ってあげます。
|
||||
|
||||
例
|
||||
|
||||
* `Assets\UniGLTF\Editor\UniGLTF\Serialization\DeserializerGenerator.cs`
|
||||
|
||||
```cs
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UniGLTF
|
||||
{
|
||||
/// <summary>
|
||||
/// Generate deserializer from ListTreeNode<JsonValue> to glTF using type reflection
|
||||
/// </summary>
|
||||
public static class DeserializerGenerator
|
||||
{
|
||||
public const BindingFlags FIELD_FLAGS = BindingFlags.Instance | BindingFlags.Public;
|
||||
|
||||
const string Begin = @"// Don't edit manually. This is generaged.
|
||||
using UniJSON;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UniGLTF {
|
||||
|
||||
public static class GltfDeserializer
|
||||
{
|
||||
|
||||
";
|
||||
|
||||
const string End = @"
|
||||
} // GltfDeserializer
|
||||
} // UniGLTF
|
||||
";
|
||||
|
||||
static string OutPath
|
||||
{
|
||||
get
|
||||
{
|
||||
return Path.Combine(UnityEngine.Application.dataPath,
|
||||
"UniGLTF/UniGLTF/Scripts/IO/GltfDeserializer.g.cs");
|
||||
}
|
||||
}
|
||||
|
||||
[MenuItem(UniGLTFVersion.MENU + "/GLTF: Generate Deserializer")]
|
||||
static void GenerateSerializer()
|
||||
{
|
||||
var info = new ObjectSerialization(typeof(glTF), "gltf", "Deserialize_");
|
||||
Debug.Log(info);
|
||||
|
||||
using (var s = File.Open(OutPath, FileMode.Create))
|
||||
using (var w = new StreamWriter(s, new UTF8Encoding(false)))
|
||||
{
|
||||
w.Write(Begin);
|
||||
info.GenerateDeserializer(w, "Deserialize");
|
||||
w.Write(End);
|
||||
}
|
||||
|
||||
Debug.LogFormat("write: {0}", OutPath);
|
||||
UnityPath.FromFullpath(OutPath).ImportAsset();
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### キー出力の抑制
|
||||
|
||||
`index` に無効な値として `-1` を入れる場合に、JSONではキーを出力しないとしたいことがあります。
|
||||
|
||||
TODO: `int?` にするべきだった
|
||||
|
||||
```cs
|
||||
[JsonSchema(Minimum = 0)]
|
||||
int index = -1;
|
||||
```
|
||||
|
||||
のようにすることで、キーの出力を抑制できます。
|
||||
|
||||
```cs
|
||||
// 生成コードのキー出力例
|
||||
if(value.index>=0){
|
||||
```
|
||||
|
||||
何も付けないと
|
||||
|
||||
```cs
|
||||
// 出力制御無し
|
||||
if(true){
|
||||
```
|
||||
|
||||
#### enum のエンコーディング
|
||||
|
||||
enumの値の名前を文字列で使う、enumの値の数値を使うの2種類がありえます。
|
||||
enumの場合はデフォルト値が無いので必須です。
|
||||
|
||||
```cs
|
||||
[JsonSchema(EnumSerializationType = EnumSerializationType.AsInt)]
|
||||
public glBufferTarget target;
|
||||
|
||||
[JsonSchema(EnumSerializationType = EnumSerializationType.AsLowerString)]
|
||||
public ProjectionType type;
|
||||
```
|
||||
|
||||
### JsonSchemaから生成
|
||||
VRM-1.0 の実装
|
||||
|
||||
TODO:
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
# Version
|
||||
|
||||
| version | |
|
||||
|---------|-----------------------------------------------------|
|
||||
| v0.82.1 | `materialGenerator(for URP)` argument and `VrmData` |
|
||||
| v0.79 | `GltfData` |
|
||||
| v0.77 | `RuntimeGltfInstance` |
|
||||
| v0.68 | `GltfParser` |
|
||||
| v0.63.2 | Update gltf extensions implementation |
|
||||
| v0.56 | Update BlendShapeKey spec |
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
This is a document for developer that using UniVRM.
|
||||
|
||||
Please see [manual](https://vrm.dev/en/docs//univrm/) about how to export VRM.
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
# Package Structure
|
||||
|
||||
| unitypackage | folder | contents |
|
||||
|--------------------|-----------------------------------|------------------------|
|
||||
| VRMShaders_UniGLTF | Assets/VRMShaders, Assets/UniGLTF | VRMShaders and UniGLTF |
|
||||
| UniVRM | Assets/VRM | VRM-0.X |
|
||||
| VRM | Assets/VRM10 | VRM-1.0(β) |
|
||||
|
||||
```
|
||||
+----------++----------+
|
||||
|UniVRM-0.X||UniVRM-1.0|
|
||||
+----------++----------+
|
||||
+----------------------+
|
||||
| UniGLTF |
|
||||
+----------------------+
|
||||
| VRMShaders |
|
||||
+----------------------+
|
||||
```
|
||||
|
||||
# UPM
|
||||
|
||||
```json
|
||||
// manifest.json
|
||||
{
|
||||
"dependencies": {
|
||||
"com.vrmc.vrmshaders": "https://github.com/vrm-c/UniVRM.git?path=/Assets/VRMShaders#v0.82.1",
|
||||
"com.vrmc.gltf": "https://github.com/vrm-c/UniVRM.git?path=/Assets/UniGLTF#v0.82.1", // rename unigltf to gltf
|
||||
"com.vrmc.univrm": "https://github.com/vrm-c/UniVRM.git?path=/Assets/VRM#v0.82.1",
|
||||
"com.vrmc.vrm": "https://github.com/vrm-c/UniVRM.git?path=/Assets/VRM10#v0.82.1", // rename univrm1 to vrm
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
- name: Overview
|
||||
href: index.md
|
||||
items:
|
||||
- name: PackageStructure
|
||||
href: package.md
|
||||
- name: Version
|
||||
href: history.md
|
||||
|
||||
- name: glTF
|
||||
items:
|
||||
- name: GlbImport(0.82)
|
||||
href: gltf/0_82_glb_import.md
|
||||
- name: glTF extensions implementation(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
|
||||
|
|
@ -1,162 +0,0 @@
|
|||
## `Version 0.44~` LoadAsync Example
|
||||
|
||||
```csharp
|
||||
// Get the byte array
|
||||
var bytes = File.ReadAllBytes(path);
|
||||
|
||||
var context = new VRMImporterContext();
|
||||
context.ParseGlb(bytes);
|
||||
|
||||
// When meta is needed
|
||||
bool createThumbnail=true;
|
||||
var meta = context.ReadMeta(createThumbnail);
|
||||
var thumbnail = meta.Thumbnail;
|
||||
|
||||
// Construct a model
|
||||
context.LoadAsync(_ =>
|
||||
{
|
||||
context.ShowMeshes();
|
||||
var go = context.Root;
|
||||
// Load completed
|
||||
},
|
||||
Debug.LogError);
|
||||
```
|
||||
|
||||
## LoadAsyncTask Example
|
||||
|
||||
```csharp
|
||||
#if (NET_4_6 && UNITY_2017_1_OR_NEWER)
|
||||
async static Task<GameObject> LoadAsync(Byte[] bytes)
|
||||
{
|
||||
var context = new VRMImporterContext();
|
||||
|
||||
// Get JSON in GLB format and parse it
|
||||
context.ParseGlb(bytes);
|
||||
|
||||
try
|
||||
{
|
||||
// Convert the parsed JSON to the scene object
|
||||
await context.LoadAsyncTask();
|
||||
|
||||
// Prevent the model's surface from being penetrated by
|
||||
// the positional relation between the bounding box and the camera
|
||||
// SkinnedMeshRenderer.updateWhenOffscreen = true
|
||||
context.EnableUpdateWhenOffscreen();
|
||||
|
||||
// If you do not want the program displaying the model's T-Pose,
|
||||
// prepare it before ShowMeshes
|
||||
// Display the model when the loading is finished
|
||||
context.ShowMeshes();
|
||||
|
||||
return context.Root;
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
Debug.LogError(ex);
|
||||
// Destroy related resources
|
||||
context.Destroy(true);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
```
|
||||
|
||||
## Related-Article
|
||||
|
||||
More details can be found in the link below (written in Japanese):
|
||||
|
||||
* [UniVRMを使ってVRMモデルをランタイムロードする方法](https://qiita.com/sh_akira/items/8155e4b69107c2a7ede6)
|
||||
|
||||
|
||||
Examples of importing the VRM model with the latest version [can be found here]({{< relref "runtime_import.md" >}}).
|
||||
|
||||
The followings are the methods to import a VRM model at runtime in Unity:
|
||||
|
||||
## Open VRM from a file path
|
||||
|
||||
{{< highlight cs >}}
|
||||
var path="sample.vrm";
|
||||
var go=VRM.VRMImporter.LoadFromPath(path);
|
||||
Debug.LogFormat("loaded {0}", go.name);
|
||||
{{< / highlight >}}
|
||||
|
||||
## Open VRM asynchronously from a file path
|
||||
|
||||
{{< highlight cs >}}
|
||||
var path="sample.vrm";
|
||||
VRMImporter.LoadVrmAsync(path, go => {
|
||||
Debug.LogFormat("loaded {0}", go.name);
|
||||
});
|
||||
{{< / highlight >}}
|
||||
|
||||
## Open VRM from a byte array
|
||||
|
||||
{{< highlight cs >}}
|
||||
var path="sample.vrm";
|
||||
var bytes = File.ReadAllBytes(path);
|
||||
var go=VRMImporter.LoadFromBytes(bytes);
|
||||
{{< / highlight >}}
|
||||
|
||||
## Open VRM asynchronously from a byte array
|
||||
|
||||
{{< highlight cs >}}
|
||||
VRMImporter.LoadVrmAsync(bytes, go => {
|
||||
Debug.LogFormat("loaded {0}", go.name);
|
||||
});
|
||||
{{< / highlight >}}
|
||||
|
||||
## Get the information form VRM
|
||||
|
||||
{{< highlight cs >}}
|
||||
#if UNITY_STANDALONE_WIN
|
||||
var path = FileDialogForWindows.FileDialog("open VRM", ".vrm");
|
||||
#else
|
||||
var path = Application.dataPath + "/default.vrm";
|
||||
#endif
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the byte array
|
||||
var bytes = File.ReadAllBytes(path);
|
||||
|
||||
var context = new VRMImporterContext();
|
||||
|
||||
// Get JSON in GLB format and parse it
|
||||
context.ParseGlb(bytes);
|
||||
|
||||
// Get the meta
|
||||
var meta = context.ReadMeta();
|
||||
Debug.LogFormat("meta: title:{0}", meta.Title);
|
||||
|
||||
// You can access the entire parsed GLTF here
|
||||
var vrm = context.GLTF;
|
||||
|
||||
// Convert the parsed JSON to the Scene Object
|
||||
if (m_loadAsync)
|
||||
{
|
||||
// Run asynchronously
|
||||
var now = Time.time;
|
||||
VRMImporter.LoadVrmAsync(context, go=> {
|
||||
var delta = Time.time - now;
|
||||
Debug.LogFormat("LoadVrmAsync {0:0.0} seconds", delta);
|
||||
OnLoaded(go);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
// Run synchronously
|
||||
VRMImporter.LoadFromBytes(context);
|
||||
OnLoaded(context.Root);
|
||||
}
|
||||
{{< / highlight >}}
|
||||
|
||||
## Get the thumbnail (From v0.37)
|
||||
|
||||
A thumbnail texture can be created by passing arguments to ReadMeta.
|
||||
|
||||
{{< highlight cs >}}
|
||||
var meta = context.ReadMeta(true); // Make a thumbnail texture
|
||||
Texture2D thumbnail=meta.Thumbnail;
|
||||
{{< / highlight >}}
|
||||
|
|
@ -1,128 +0,0 @@
|
|||
---
|
||||
title: "How to Use BlendShapeProxy"
|
||||
date: 2018-04-16T16:30:00+09:00
|
||||
aliases: ["/en/dev/univrm-0.xx/programming/univrm_use_blendshape/",
|
||||
"/en/docs/univrm/programming/how_to_use_blendshapeproxy/"]
|
||||
weight: 3
|
||||
tags: ["api"]
|
||||
---
|
||||
|
||||
## Environment
|
||||
UniVRM v0.58.0
|
||||
|
||||
[Rework BlendShapeKey's Interface](https://github.com/vrm-c/UniVRM/wiki/ReleaseNote-v0.56.0%28en%29#reworks-blendshapekeys-interface)
|
||||
|
||||
## Methods
|
||||
|
||||
* [Recommended] `SetValues`
|
||||
* [Not Recommended] `ImmediatelySetValue`
|
||||
* [For Advanced Users] `AccumulateValue`, `Apply`
|
||||
|
||||
## Apply BlendShape weight from script
|
||||
|
||||
Call `SetValues` function once to create the specific expression (merged by multiple BlendShapes) in a frame:
|
||||
|
||||
{{< highlight cs >}}
|
||||
var proxy = GetComponent<VRMBlendShapeProxy>();
|
||||
|
||||
proxy.SetValues(new Dictionary<BlendShapeKey, float>
|
||||
{
|
||||
{BlendShapeKey.CreateFromPreset(BlendShapePreset.A), 1f}, // Assign the Weight of a BlendShape clip between 0 and 1
|
||||
{BlendShapeKey.CreateFromPreset(BlendShapePreset.Joy), 1f}, // Specify a system-defined BlendShape clip by enum
|
||||
{BlendShapeKey.CreateUnknown("USER_DEFINED_FACIAL"), 1f}, // Specify a user-defined BlendShape clip by string
|
||||
});
|
||||
{{< / highlight >}}
|
||||
|
||||
## Why use `SetValues` for synthesizing multiple BlendShapes?
|
||||
|
||||
We found that multiple BlendShapes compete with each other when the following expressions are specified:
|
||||
|
||||
* LipSync
|
||||
* Eye Blink
|
||||
* Eye Gaze control (if eye gaze movements are controlled by BlendShape)
|
||||
* Emotions
|
||||
|
||||
A BlendShape set first may be overwritten with followed BlendShapes so it turns out that the specified expression is not actually shown.
|
||||
|
||||
In order to address this issue, we can use `SetValues` function to merge multiple BlendShapes into a specified expression while the BlendShape overwriting can be avoided.
|
||||
|
||||
Blink example:
|
||||
|
||||
For Blink_L
|
||||
|
||||
* The weight value for BlendShape `eye_L` of `Mesh_A` is 100
|
||||
* The weight value for BlendShape `eye_R` of `Mesh_A` is 1
|
||||
|
||||
For Blink_R
|
||||
|
||||
* The weight value for BlendShape `eye_L` of `Mesh_A` is 1
|
||||
* The weight value for BlendShape `eye_R` of `Mesh_A` is 100
|
||||
|
||||
If we use `ImmediatelySetValue` function for eye blinking,
|
||||
|
||||
{{< highlight cs >}}
|
||||
proxy.ImmediatelySetValue(BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_L), 1.0f);
|
||||
proxy.ImmediatelySetValue(BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_R), 1.0f);
|
||||
{{< / highlight >}}
|
||||
|
||||
The weight values set for Blink_L will be overwritten by Blink_R. To resolve this issue, we use `SetValues` or `AccumulateValue` to correctly manipulate specified BlendShapes:
|
||||
|
||||
{{< highlight cs >}}
|
||||
proxy.SetValues(new Dictionary<BlendShapeKey, float>
|
||||
{
|
||||
{BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_L), 1.0f},
|
||||
{BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_R), 1.0f},
|
||||
});
|
||||
{{< / highlight >}}
|
||||
|
||||
{{< highlight cs >}}
|
||||
proxy.AccumulateValue(BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_L), 1.0f);
|
||||
proxy.AccumulateValue(BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_R), 1.0f);
|
||||
// Apply all the specified BlendShapes at once
|
||||
proxy.Apply();
|
||||
{{< / highlight >}}
|
||||
|
||||
More details are described below:
|
||||
|
||||
## ImmediatelySetValue
|
||||
|
||||
Assumed to be used for a simple test program.
|
||||
|
||||
Example:
|
||||
|
||||
```cs
|
||||
var proxy = GetComponent<VRMBlendShapeProxy>();
|
||||
|
||||
proxy.ImmediatelySetValue(BlendShapeKey.CreateFromPreset(BlendShapePreset.A), 1.0f);
|
||||
```
|
||||
|
||||
## AccumulateValue + Apply
|
||||
|
||||
Example:
|
||||
|
||||
```cs
|
||||
var proxy = GetComponent<VRMBlendShapeProxy>();
|
||||
|
||||
proxy.AccumulateValue(BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_L), 1.0f);
|
||||
proxy.AccumulateValue(BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_R), 1.0f);
|
||||
// Apply all the specified BlendShapes at once
|
||||
proxy.Apply();
|
||||
```
|
||||
|
||||
We recommend `SetValues` (below) to handle the case of applying multiple BlendShapes.
|
||||
|
||||
## SetValues
|
||||
|
||||
Call `SetValues` to combine multiple BlendShapes.
|
||||
|
||||
Example:
|
||||
|
||||
```cs
|
||||
var proxy = GetComponent<VRMBlendShapeProxy>();
|
||||
|
||||
proxy.SetValues(new Dictionary<BlendShapeKey, float>
|
||||
{
|
||||
{BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_L), 1.0f},
|
||||
{BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_R), 1.0f},
|
||||
});
|
||||
```
|
||||
|
|
@ -1,161 +0,0 @@
|
|||
## `Version 0.68~`
|
||||
|
||||
### API Changes
|
||||
|
||||
ImporterContext has been reworked.
|
||||
|
||||
* Loading processing has been divided into two steps: `Parse` and `Load`
|
||||
* `Parse` processing can be processed by other than the main thread
|
||||
* The implementation of asynchronous loading function `ImporterContext.LoadAsync` has changed to `Task`
|
||||
* The method of explicitly destroying `UnityEngine.Object` resources is now available. As such, resource leaks can be prevented
|
||||
* The timing of calling `ImporterContext.Dispose` has been changed to when the loading process ends
|
||||
* Call `ImporterContext.DisposeOnGameObjectDestroyed` function (described below) before `ImporterContext.Dispose` function is called
|
||||
* In the previous versions, `ImporterContext.Dispose` is called when the generated VRM model is destroyed
|
||||
* Added `ImporterContext.DisposeOnGameObjectDestroyed` function
|
||||
* The duty of destroying VRM resources (Texture, Material, Mesh, etc) has been transferred to GameObject
|
||||
* The resources (Texture, Material, Mesh, etc) will be destroyed when VRM's GameObject is destroyed
|
||||
|
||||
|
||||
### Sample Codes (Synchronous Loading)
|
||||
|
||||
```cs
|
||||
using UniGLTF;
|
||||
using UnityEngine;
|
||||
using VRM;
|
||||
|
||||
namespace YourNameSpace
|
||||
{
|
||||
public sealed class LoadVrmSample : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private string _vrmFilePath;
|
||||
private GameObject _vrmGameObject;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_vrmGameObject = LoadVrm(_vrmFilePath);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
DestroyVrm(_vrmGameObject);
|
||||
}
|
||||
|
||||
private GameObject LoadVrm(string vrmFilePath)
|
||||
{
|
||||
// 1. Call GltfParser function (it has been separated from ImporterContext)
|
||||
// We use GltfParser to obtain JSON information and binary data from the VRM file
|
||||
var parser = new GltfParser();
|
||||
parser.ParsePath(vrmFilePath);
|
||||
|
||||
// 2. Initialize a new VRMImporterContext object and pass `parser` as an argument to it
|
||||
// VRMImporterContext is the class for loading VRM
|
||||
using (var context = new VRMImporterContext(parser))
|
||||
{
|
||||
// 3. Call Load function to create a VRM GameObject
|
||||
context.Load();
|
||||
|
||||
// 4. Enable UpdateWhenOffscreen
|
||||
// https://docs.unity3d.com/2019.4/Documentation/ScriptReference/SkinnedMeshRenderer-updateWhenOffscreen.html
|
||||
context.EnableUpdateWhenOffscreen();
|
||||
|
||||
// 5. Display the model
|
||||
context.ShowMeshes();
|
||||
|
||||
// 6. By calling this function, unity resources such as Texture, Material, Mesh, etc. used by VRM GameObject can be associated
|
||||
// In other words, when the VRM GameObject is destroyed, resources (Texture, Material, Mesh, etc) that are actually used by the VRM GameObject can be destroyed
|
||||
context.DisposeOnGameObjectDestroyed();
|
||||
|
||||
// 7. Return Root GameObject (VRM model)
|
||||
// Root GameObject is where VRMMeta component is attached
|
||||
return context.Root;
|
||||
}
|
||||
// 8. When using statement ends, UnityEngine.Object resources held by VRMImporterContext are destroyed
|
||||
// As mentioned in step 6, the resources associated with the VRM GameObject will not be destroyed
|
||||
// The unused resources (not used by the VRM GameObject), i.e. unassigned textures, will be destroyed
|
||||
}
|
||||
|
||||
private void DestroyVrm(GameObject vrmGameObject)
|
||||
{
|
||||
// 9. Destroy the generated VRM GameObject
|
||||
// If the VRM GameObject is destroyed, the associated unity resources (Texture, Material, Mesh, etc) will be destroyed, too
|
||||
UnityEngine.Object.Destroy(vrmGameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Sample Codes (Asynchronous Loading)
|
||||
|
||||
```cs
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using UniGLTF;
|
||||
using UnityEngine;
|
||||
using VRM;
|
||||
|
||||
namespace YourNameSpace
|
||||
{
|
||||
public sealed class LoadVrmAsyncSample : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private string _vrmFilePath;
|
||||
private GameObject _vrmGameObject;
|
||||
|
||||
private async void Start()
|
||||
{
|
||||
_vrmGameObject = await LoadVrmAsync(_vrmFilePath);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
DestroyVrm(_vrmGameObject);
|
||||
}
|
||||
|
||||
private async Task<GameObject> LoadVrmAsync(string vrmFilePath)
|
||||
{
|
||||
// 1. Call GltfParser function (it has been separated from ImporterContext)
|
||||
// We use GltfParser to obtain JSON information and binary data from the VRM file
|
||||
// GltfParser can be run by other than the Unity's main thread
|
||||
var parser = new GltfParser();
|
||||
await Task.Run(() =>
|
||||
{
|
||||
var file = File.ReadAllBytes(vrmFilePath);
|
||||
parser.ParseGlb(file);
|
||||
});
|
||||
|
||||
// 2. Initialize a new VRMImporterContext object and pass `parser` as an argument to it
|
||||
// VRMImporterContext is the class for loading VRM
|
||||
using (var context = new VRMImporterContext(parser))
|
||||
{
|
||||
// 3. Call LoadAsync function to create a VRM GameObject
|
||||
// For loading process it will take several frames
|
||||
await context.LoadAsync();
|
||||
|
||||
// 4. Enable UpdateWhenOffscreen
|
||||
// https://docs.unity3d.com/2019.4/Documentation/ScriptReference/SkinnedMeshRenderer-updateWhenOffscreen.html
|
||||
context.EnableUpdateWhenOffscreen();
|
||||
|
||||
// 5. Display the model
|
||||
context.ShowMeshes();
|
||||
|
||||
// 6. By calling this function, unity resources such as Texture, Material, Mesh, etc. used by VRM GameObject can be associated
|
||||
// In other words, when the VRM GameObject is destroyed, resources (Texture, Material, Mesh, etc) that are actually used by the VRM GameObject can be destroyed
|
||||
context.DisposeOnGameObjectDestroyed();
|
||||
|
||||
// 7. Return Root GameObject (VRM model)
|
||||
// Root GameObject is where VRMMeta component is attached
|
||||
return context.Root;
|
||||
}
|
||||
// 8. When using statement ends, UnityEngine.Object resources held by VRMImporterContext are destroyed
|
||||
// As mentioned in step 6, the resources associated with the VRM GameObject will not be destroyed
|
||||
// The unused resources (not used by the VRM GameObject), i.e. unassigned textures, will be destroyed
|
||||
}
|
||||
|
||||
private void DestroyVrm(GameObject vrmGameObject)
|
||||
{
|
||||
// 9. Destroy the generated VRM GameObject
|
||||
// If the VRM GameObject is destroyed, the associated unity resources (Texture, Material, Mesh, etc) will be destroyed, too
|
||||
UnityEngine.Object.Destroy(vrmGameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
@ -1,81 +0,0 @@
|
|||
## `Version 0.77~`
|
||||
|
||||
[DisposeOnGameObjectDestroyed](https://github.com/vrm-c/UniVRM/issues/1018)
|
||||
|
||||
`ImporterContext` API has been modified.
|
||||
|
||||
The function `ImporterContext.DisposeOnGameObjectDestroyed` introduced in `Version 0.68` has been discarded.
|
||||
Instead, `ImporterContext.Load` and `RuntimeGltfInstance` are used in `v0.77`.
|
||||
|
||||
In addition, `ImporterContext`'s members have been moved to `RuntimeGltfInstance`:
|
||||
|
||||
* Root
|
||||
* EnableUpdateWhenOffscreen()
|
||||
* ShowMeshes()
|
||||
|
||||
To destroy the Importer, use `ImporterContext.Dispose` after `Load` is called.
|
||||
By destroying RuntimeGltfInstance, the resources associated with the RuntimeGltfInstance (Texture, Material, Mesh, etc) will be destroyed.
|
||||
|
||||
```cs
|
||||
using UniGLTF;
|
||||
using UnityEngine;
|
||||
|
||||
namespace VRM.Samples
|
||||
{
|
||||
public sealed class LoadVrmSample : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private string _vrmFilePath;
|
||||
private GameObject _vrmGameObject;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_vrmGameObject = LoadVrm(_vrmFilePath);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
DestroyVrm(_vrmGameObject);
|
||||
}
|
||||
|
||||
private GameObject LoadVrm(string vrmFilePath)
|
||||
{
|
||||
// 1. Call GltfParser function (it has been separated from ImporterContext)
|
||||
// We use GltfParser to obtain JSON information and binary data from the VRM file
|
||||
var parser = new GltfParser();
|
||||
parser.ParsePath(vrmFilePath);
|
||||
|
||||
// 2. Initialize a new VRMImporterContext object and pass `parser` as an argument to it
|
||||
// The class for loading VRM is VRMImporterContext
|
||||
using (var context = new VRMImporterContext(parser))
|
||||
{
|
||||
// 3. Call Load function to create a VRM GameObject
|
||||
RuntimeGltfInstance instance = context.Load(); // <- `v0.77`
|
||||
|
||||
// For asynchronous loading, use the following line instead:
|
||||
// RuntimeGltfInstance instance = await context.LoadAsync();
|
||||
|
||||
// 4. Enable UpdateWhenOffscreen
|
||||
// https://docs.unity3d.com/2019.4/Documentation/ScriptReference/SkinnedMeshRenderer-updateWhenOffscreen.html
|
||||
instance.EnableUpdateWhenOffscreen(); // This function has been moved from ImporterContext to RuntimeGltfInstance in `v0.77`
|
||||
|
||||
// 5. Display the model
|
||||
instance.ShowMeshes(); // This function has been moved from ImporterContext to RuntimeGltfInstance `v0.77`
|
||||
|
||||
// 6. Return Root GameObject (VRM model)
|
||||
// Root GameObject is where VRMMeta component is attached
|
||||
return instance.Root; // <- changed from ImporterContext to RuntimeGltfInstance in `v0.77`
|
||||
}
|
||||
// 7. When using statement ends, UnityEngine.Object resources held by VRMImporterContext are destroyed
|
||||
// In step 6, the resources associated with the VRM GameObject will not be destroyed
|
||||
// The unused resources included in the glTF file (not used by the VRM GameObject), i.e. unassigned textures, will be destroyed
|
||||
}
|
||||
|
||||
private void DestroyVrm(GameObject vrmGameObject)
|
||||
{
|
||||
// 8. Destroy the generated VRM GameObject
|
||||
// If the VRM GameObject is destroyed, the associated unity resources (Texture, Material, Mesh, etc) will also be destroyed
|
||||
UnityEngine.Object.Destroy(vrmGameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
## `Version 0.79`
|
||||
|
||||
Separate `GltfData` from `GltfParser`
|
||||
|
||||
```cs
|
||||
var parser = new GltfParser();
|
||||
parser.ParsePath(path);
|
||||
```
|
||||
|
||||
```cs
|
||||
GltfData data = new GlbFileParser(path).Parse();
|
||||
```
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
* `Version 0.82.0`: Please use `0.82.1` or later
|
||||
* `Version 0.82.1~`
|
||||
|
||||
Material replacement for URP when Import is implemented .
|
||||
|
||||
Below step is needed.
|
||||
|
||||
1. Parse VRM, and Get `GltfData`.
|
||||
1. Get `VRMData` from `GltfData`.
|
||||
1. Load a `RuntimeGltfInstance` from `VRMData`.
|
||||
1. Use the `RuntimeGltfInstance`
|
||||
|
||||
See `Assets\VRM\Samples\SimpleViewer\ViewerUI.cs`
|
||||
|
||||
# 1. Get `GltfData`
|
||||
|
||||
```cs
|
||||
GltfData Load(string path)
|
||||
{
|
||||
return new GlbFileParser(path).Parse();
|
||||
}
|
||||
```
|
||||
|
||||
See [GLB import](../gltf/0_82_glb_import.md).
|
||||
|
||||
# 2. Get `VRMData`
|
||||
|
||||
```cs
|
||||
VRMData vrm = new VRMData(data);
|
||||
```
|
||||
|
||||
# 3. Load
|
||||
|
||||
```cs
|
||||
async RuntimeGltfInstance Load(VRMData vrm)
|
||||
{
|
||||
// Dispose VRMImporterContext, after load
|
||||
using(var loader = new VRMImporterContext(vrm))
|
||||
{
|
||||
var instance = await loader.LoadAsync();
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Set `materialGenerator` argument for URP(Experimental)
|
||||
|
||||
Set `materialGenerator` Argument, material generation is could customized.
|
||||
If omitted, default `materialGenerator` for `built-in` pipeline is used.
|
||||
|
||||
```cs
|
||||
async RuntimeGltfInstance Load(VRMData vrm)
|
||||
{
|
||||
var materialGenerator = new VRMUrpMaterialDescriptorGenerator(vrm.VrmExtension);
|
||||
using(var loader = new VRM.VRMImporterContext(vrm, materialGenerator: materialGenerator))
|
||||
{
|
||||
var instance = await loader.LoadAsync();
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
* `MToonShader for URP` has not been implemented yet, fallback to `UniUnlit`.
|
||||
|
||||
# 4. Instance
|
||||
|
||||
|
||||
```cs
|
||||
// Setup for SkinnedMeshRenderer
|
||||
instance.EnableUpdateWhenOffscreen();
|
||||
// Show meshes when ready(invisible by default)
|
||||
instance.ShowMeshes();
|
||||
```
|
||||
|
||||
When destroy, related assets(meshes, materials and textures etc...) is destroyed.
|
||||
|
||||
```cs
|
||||
// GameObject.Destroy(instance);
|
||||
|
||||
// Destroy GameObject not RuntimeGltfInstance
|
||||
GameObject.Destroy(instance.gameObject);
|
||||
```
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
---
|
||||
title: "How to Use VRMFirstPerson"
|
||||
linkTitle: "How to use first-person mode "
|
||||
date: 2018-05-29T10:00:00+09:00
|
||||
aliases: ["/en/dev/univrm-0.xx/programming/univrm_use_firstperson/"]
|
||||
weight: 5
|
||||
tags: ["api"]
|
||||
---
|
||||
|
||||
# VRMFirstPerson Settings
|
||||
[VRMFirstPerson]({{< relref "univrm_firstperson.md" >}}) has the following settings for Renderer:
|
||||
|
||||
|FirstPersonFlag |Layer |Note |
|
||||
|------------------------------|----------------------|--------------------------------------------|
|
||||
|Both |default |Specify parts that are not necessarily separated between first-person view and third-person view.|
|
||||
|ThirdPersonOnly |VRMThirdPersonOnly|Specify parts that are not rendered in first-person view.|
|
||||
|FirstPersonOnly |VRMFirstPersonOnly|Specify parts that are not rendered in third-person view. The auto-created headless model is used.|
|
||||
|Auto |VRMThirdPersonOnly|Automatically create the model in first-person view at runtime and set it to FIRSTPERSON_ONLY_LAYER.|
|
||||
|
||||
By calling **VRMFirstPerson.Setup** at runtime, the layer settings described above can be performed. Please call the function explicitly from outside.
|
||||
|
||||
# Specify the additional render layers for the application
|
||||
|
||||
The following layers are defined as constant:
|
||||
|
||||
{{< highlight cs >}}
|
||||
public class VRMFirstPerson : MonoBehaviour
|
||||
{
|
||||
public const int FIRSTPERSON_ONLY_LAYER = 9;
|
||||
public const int THIRDPERSON_ONLY_LAYER = 10;
|
||||
|
||||
// The following parts are omitted
|
||||
}
|
||||
{{< / highlight >}}
|
||||
|
||||
|{{< img src="images/vrm/layer_setting.png" >}}|
|
||||
|-----|
|
||||
|Set Layer in #9 and #10|
|
||||
|
||||
# Call Setup function at runtime and set LayerMask in Camera
|
||||
|
||||
* Call VRMFirstPerson.Setup
|
||||
* Set LayerMask for first-person camera view and other camera views
|
||||
|
||||
{{< highlight cs >}}
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using VRM;
|
||||
|
||||
public class SetupExample : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
Camera m_firstPersonCamera; // HMD camera
|
||||
|
||||
[SerializeField]
|
||||
LayerMask m_firstPersonMask; // Set a first-person mask (default | VRMFirstPersonOnly, etc.) in HMD camera
|
||||
|
||||
[SerializeField]
|
||||
LayerMask m_otherMask; // Set other masks (default | VRMThirdPersonOnly, etc.) in HMD camera
|
||||
|
||||
[SerializeField]
|
||||
VRMFirstPerson m_firstPerson;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_firstPerson = GameObject.FindObjectOfType<VRMFirstPerson>();
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
foreach (var camera in GameObject.FindObjectsOfType<Camera>())
|
||||
{
|
||||
camera.cullingMask = (camera == m_firstPersonCamera)
|
||||
? m_firstPersonMask
|
||||
: m_otherMask
|
||||
;
|
||||
}
|
||||
|
||||
// VRMFirstPerson initialization
|
||||
if (m_firstPerson != null)
|
||||
{
|
||||
m_firstPerson.Setup();
|
||||
}
|
||||
}
|
||||
}
|
||||
{{< / highlight >}}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
---
|
||||
title: 🚧Expression
|
||||
weight: 30
|
||||
---
|
||||
|
||||
表情周りの操作方法。
|
||||
|
||||
> VRM-1.0 の `BlendShapeProxy` は、`VRM10Controller.Expression` になります。
|
||||
|
||||
VRM-0.X の例
|
||||
|
||||
```cs
|
||||
void SetExpression(GameObject root)
|
||||
{
|
||||
var controller = root.GetComponent<BlendShapeProxy>();
|
||||
}
|
||||
```
|
||||
|
||||
VRM-1.0 の例
|
||||
|
||||
```cs
|
||||
void SetExpression(GameObject root)
|
||||
{
|
||||
var controller = root.GetComponent<VRM10Controller>();
|
||||
}
|
||||
```
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
The VR First Person settings.
|
||||
|
||||
1. Load
|
||||
2. Get VRM10Controller
|
||||
3. Call `controller.Vrm.FirstPerson.SetupAsync`
|
||||
4. Add the result of `controller.Vrm.FirstPerson.SetupAsync` to `RuntimeGltfInstance`
|
||||
5. ShowMeshes
|
||||
|
||||
```cs
|
||||
async Task<RuntimeGltfInstance> LoadAsync(string path)
|
||||
{
|
||||
var data = new GlbFileParser(path).Parse();
|
||||
if (!Vrm10Data.TryParseOrMigrate(data, true, out Vrm10Data vrm))
|
||||
{
|
||||
throw new System.Exception("vrm parse error !");
|
||||
}
|
||||
using (var loader = new Vrm10Importer(vrm))
|
||||
{
|
||||
// 1.
|
||||
var instance = await loader.LoadAsync();
|
||||
|
||||
// 2.
|
||||
var controller = instance.GetComponent<VRM10Controller>();
|
||||
|
||||
// 3.
|
||||
var created = await controller.Vrm.FirstPerson.SetupAsync(controller.gameObject);
|
||||
|
||||
// 4.
|
||||
instance.AddRenderers(created);
|
||||
|
||||
// 5.
|
||||
instance.ShowMeshes();
|
||||
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
# Recommended camera layer settings
|
||||
|
||||
Suppose your scene has a camera that represents a head-mounted display and other cameras.
|
||||
|
||||
* FIRSTPERSON_ONLY_LAYER(The gameObject that specifies this layer disappears from other cameras)
|
||||
* THIRDPERSON_ONLY_LAYER(The gameObject that specifies this layer disappears from the head-mounted display)
|
||||
|
||||
Stops drawing the avatar from the head-mounted display perspective and makes it visible to other cameras.
|
||||
|
||||
Example: Stop drawing the avatar's head so you can see the front
|
||||
|
||||
VRM reserves layers named `VRMFirstPersonOnly` and` VRMThirdPersonOnly`.
|
||||
|
||||
Please set `VRMFirstPersonOnly` and` VRMThirdPersonOnly` to `Project Settings`-`Tags and Layers`.
|
||||
|
||||
In the sample, we assign `9` and` 10` to each.
|
||||
|
||||
# Specify layer at initialization
|
||||
|
||||
It can be specified with an additional argument.
|
||||
|
||||
```cs
|
||||
var created = await controller.Vrm.FirstPerson.SetupAsync(controller.gameObject, firstPersonOnlyLayer: 9, thirdPersonOnlyLayer: 10);
|
||||
```
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
---
|
||||
title: 🚧Humanoid
|
||||
weight: 20
|
||||
---
|
||||
|
||||
## Humanoid Bone の取得方法
|
||||
|
||||
### Humanoidコンポーネント(vrm-1.0)
|
||||
|
||||
### Animator経由(vrm-0.xとvrm-1.0共通)
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
---
|
||||
title: 🚧LookAt
|
||||
weight: 40
|
||||
---
|
||||
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
# RuntimeLoad
|
||||
|
||||
`VRM-1.0` can load `VRM-0.x`.
|
||||
In that case, incompatible migrated meta properties are not allowed.
|
||||
Therefore, we provide an API that allows you to access the original meta before migration.
|
||||
|
||||
See `Assets\VRM10\Samples\VRM10Viewer\VRM10ViewerUI.cs`.
|
||||
|
||||
```cs
|
||||
static IMaterialDescriptorGenerator GetVrmMaterialDescriptorGenerator(bool useUrp)
|
||||
{
|
||||
if (useUrp)
|
||||
{
|
||||
return new Vrm10UrpMaterialDescriptorGenerator();
|
||||
}
|
||||
else
|
||||
{
|
||||
return new Vrm10MaterialDescriptorGenerator();
|
||||
}
|
||||
}
|
||||
|
||||
async Task<RuntimeGltfInstance> LoadAsync(string path)
|
||||
{
|
||||
GltfData data = new AutoGltfFileParser(path).Parse();
|
||||
|
||||
// The doMigrate argument allows you to load that older version of the vrm.
|
||||
if (Vrm10Data.TryParseOrMigrate(data, doMigrate: true, out Vrm10Data vrm))
|
||||
{
|
||||
// vrm
|
||||
using (var loader = new Vrm10Importer(vrm,
|
||||
materialGenerator: GetVrmMaterialDescriptorGenerator(m_useUrpMaterial.isOn)))
|
||||
{
|
||||
// It has been migrated, but it is the same thumbnail
|
||||
var thumbnail = await loader.LoadVrmThumbnailAsync();
|
||||
|
||||
if (vrm.OriginalMetaBeforeMigration != null)
|
||||
{
|
||||
// migrated from vrm-0.x. use OriginalMetaBeforeMigration
|
||||
UpdateMeta(vrm.OriginalMetaBeforeMigration, thumbnail);
|
||||
}
|
||||
else
|
||||
{
|
||||
// load vrm-1.0. use newMeta
|
||||
UpdateMeta(vrm.VrmExtension.Meta, thumbnail);
|
||||
}
|
||||
|
||||
// load model
|
||||
RuntimeGltfInstance instance = await loader.LoadAsync();
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw new Exception("not vrm");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
|
||||
* [日本語](./ja/)
|
||||
* [English](./en/)
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
- name: Index
|
||||
href: index.md
|
||||
items:
|
||||
- name: English
|
||||
href: en
|
||||
- name: Japanese
|
||||
href: ja
|
||||
4
docs/.gitignore
vendored
4
docs/.gitignore
vendored
|
|
@ -1 +1,3 @@
|
|||
_build
|
||||
_build
|
||||
_pot
|
||||
*.mo
|
||||
|
|
|
|||
|
|
@ -44,10 +44,17 @@ gettext_compact = False
|
|||
|
||||
potファイル作成
|
||||
```
|
||||
doc$ sphinx-build -M gettext . _build
|
||||
doc$ sphinx-build -M gettext . _pot
|
||||
# => _pot/gettext
|
||||
```
|
||||
|
||||
poファイルを作成
|
||||
```
|
||||
doc$ sphinx-intl update -p _build/gettext -l ja
|
||||
doc$ sphinx-intl update -p _pot/gettext -l en
|
||||
# => locale/en
|
||||
```
|
||||
|
||||
ロケールを使ってサイトビルド
|
||||
```
|
||||
doc$ sphinx-build . _build/en -D language=en
|
||||
```
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
|
|||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
html_theme = 'classic'
|
||||
html_theme = 'nature'
|
||||
|
||||
# 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,
|
||||
|
|
|
|||
4
docs/index.html
Normal file
4
docs/index.html
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<ul>
|
||||
<li><a href="./ja/">日本語</a></li>
|
||||
<li><a href="./en/">English</a></li>
|
||||
</ul>
|
||||
|
|
@ -9,7 +9,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: UniVRM Programming Document \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-09-14 13:46+0900\n"
|
||||
"POT-Creation-Date: 2021-09-14 14:37+0900\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
|
@ -50,7 +50,11 @@ msgstr ""
|
|||
msgid "potファイル作成"
|
||||
msgstr ""
|
||||
|
||||
#: ../../README.md:50
|
||||
#: ../../README.md:51
|
||||
msgid "poファイルを作成"
|
||||
msgstr ""
|
||||
|
||||
#: ../../README.md:57
|
||||
msgid "ロケールを使ってサイトビルド"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
|||
|
|
@ -24,33 +24,32 @@ msgstr ""
|
|||
|
||||
#: ../../gltf/0_36_update.md:3
|
||||
msgid "テクスチャ名の格納位置の修正"
|
||||
msgstr ""
|
||||
msgstr "Changed Storage Position of Texture Name"
|
||||
|
||||
#: ../../gltf/0_36_update.md:5 ../../gltf/0_36_update.md:22
|
||||
msgid "GLTFの仕様に準拠しました。"
|
||||
msgstr ""
|
||||
msgstr "Conforming to the GLTF specification."
|
||||
|
||||
#: ../../gltf/0_36_update.md:7 ../../gltf/0_36_update.md:24
|
||||
msgid "extraはextrasの間違い"
|
||||
msgstr ""
|
||||
msgstr "`extras` is not allowed in target"
|
||||
|
||||
#: ../../gltf/0_36_update.md:8
|
||||
msgid "imageはnameを持っていた"
|
||||
msgstr ""
|
||||
msgstr "Use image.name"
|
||||
|
||||
#: ../../gltf/0_36_update.md:14 ../../gltf/0_36_update.md:32
|
||||
msgid "変更後"
|
||||
msgstr ""
|
||||
msgstr "After the change "
|
||||
|
||||
#: ../../gltf/0_36_update.md:20
|
||||
msgid "ブレンドシェイプ名の格納位置の修正"
|
||||
msgstr ""
|
||||
msgstr "Fix blendshape name"
|
||||
|
||||
#: ../../gltf/0_36_update.md:25
|
||||
msgid "targetにextrasは不許可"
|
||||
msgstr ""
|
||||
msgstr "Target has no extras"
|
||||
|
||||
#: ../../gltf/0_36_update.md:26
|
||||
msgid "https://github.com/KhronosGroup/glTF/issues/1036#issuecomment-314078356"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
|||
|
|
@ -24,65 +24,65 @@ msgstr ""
|
|||
|
||||
#: ../../gltf/0_82_glb_import.md:2
|
||||
msgid "`0.82.1` の API です。 `0.82.0` の場合は更新をお願いします。"
|
||||
msgstr ""
|
||||
msgstr "If use `0.82.0`, please upgrade."
|
||||
|
||||
#: ../../gltf/0_82_glb_import.md:5
|
||||
msgid "以下のステップでロードします。"
|
||||
msgstr ""
|
||||
msgstr "GLB load is below steps."
|
||||
|
||||
#: ../../gltf/0_82_glb_import.md:7
|
||||
msgid "`GLB` / `GLTF` をパースして `GltfData` を得る。"
|
||||
msgstr ""
|
||||
msgstr "Parse `GLB` / `GLTF`, get a `GltfData`"
|
||||
|
||||
#: ../../gltf/0_82_glb_import.md:8
|
||||
msgid ""
|
||||
"`GltfData` から `Unity Hierarchy` を ロード する。`RuntimeGltfInstance` を得る。 "
|
||||
"ローダーを破棄する。"
|
||||
msgstr ""
|
||||
msgstr "Load `Unity Hierarchy` from the `GltfData`, get a `RuntimeGltfInstance`, dispose loader."
|
||||
|
||||
#: ../../gltf/0_82_glb_import.md:9
|
||||
msgid "ロードした `RuntimeGltfInstance` 使う。`RuntimeGltfInstance` を破棄する。"
|
||||
msgstr ""
|
||||
msgstr "Use the `RuntimeGltfInstance`, destroy the `RuntimeGltfInstance`."
|
||||
|
||||
#: ../../gltf/0_82_glb_import.md:11
|
||||
msgid "1. パースする"
|
||||
msgstr ""
|
||||
msgstr "1. Parse"
|
||||
|
||||
#: ../../gltf/0_82_glb_import.md:13
|
||||
msgid "glb ファイルパスからパースする"
|
||||
msgstr ""
|
||||
msgstr "Parse glb from file path"
|
||||
|
||||
#: ../../gltf/0_82_glb_import.md:15 ../../gltf/0_82_glb_import.md:26
|
||||
msgid "`vrm` もこの関数を使います。"
|
||||
msgstr ""
|
||||
msgstr "Use this for vrm too."
|
||||
|
||||
#: ../../gltf/0_82_glb_import.md:24
|
||||
msgid "glb バイト列をパースする"
|
||||
msgstr ""
|
||||
msgstr "Parse glb byte array"
|
||||
|
||||
#: ../../gltf/0_82_glb_import.md:35
|
||||
msgid "gltf ファイルパスからパースする"
|
||||
msgstr ""
|
||||
msgstr "Parse gltf from file path"
|
||||
|
||||
#: ../../gltf/0_82_glb_import.md:44
|
||||
msgid "zip アーカイブからパースする"
|
||||
msgstr ""
|
||||
msgstr "Parse gltf in zip archive from file path"
|
||||
|
||||
#: ../../gltf/0_82_glb_import.md:46
|
||||
msgid "gltf と関連するファイルを zip アーカイブしたファイルをパースできます(実験)。"
|
||||
msgstr ""
|
||||
msgstr "Zip archive that contains gltf and related files could parsed(expelemental)."
|
||||
|
||||
#: ../../gltf/0_82_glb_import.md:55
|
||||
msgid "ファイルパスの拡張子でパースする"
|
||||
msgstr ""
|
||||
msgstr "Parse by file extension"
|
||||
|
||||
#: ../../gltf/0_82_glb_import.md:57
|
||||
msgid "サンプルの `SimpleViewer` を参考にしてください。"
|
||||
msgstr ""
|
||||
msgstr "See `SimpleViewer` sample."
|
||||
|
||||
#: ../../gltf/0_82_glb_import.md:67
|
||||
msgid "2. ロードする"
|
||||
msgstr ""
|
||||
msgstr "2. Load"
|
||||
|
||||
#: ../../gltf/0_82_glb_import.md:69
|
||||
msgid "sync"
|
||||
|
|
@ -94,17 +94,17 @@ msgstr ""
|
|||
|
||||
#: ../../gltf/0_82_glb_import.md:99
|
||||
msgid "materialGenerator で URP 用のマテリアルをロードする"
|
||||
msgstr ""
|
||||
msgstr "Load URP material by materialGenerator argument"
|
||||
|
||||
#: ../../gltf/0_82_glb_import.md:101
|
||||
msgid "`materialGenerator` 引き数(省略可能)を指定することで URP マテリアルを生成するようにカスタムできます。"
|
||||
msgstr ""
|
||||
msgstr "You can load URP materials by setting the `materialGenerator` Argument (optional)."
|
||||
|
||||
#: ../../gltf/0_82_glb_import.md:115
|
||||
msgid "3. インスタンスを使用する"
|
||||
msgstr ""
|
||||
msgstr "3. Use instance"
|
||||
|
||||
#: ../../gltf/0_82_glb_import.md:124
|
||||
msgid "使用後に以下のように破棄してください。関連する Asset(Texture, Material, Meshなど)も破棄されます。"
|
||||
msgstr ""
|
||||
msgstr "Destroy after use and discard related assets (textures, materials, meshes, etc.)"
|
||||
|
||||
|
|
|
|||
|
|
@ -20,45 +20,45 @@ msgstr ""
|
|||
|
||||
#: ../../gltf/how_to_impl_extension.md:1
|
||||
msgid "glTF拡張の実装(0.63.2)"
|
||||
msgstr ""
|
||||
msgstr "The implementation of glTF extensions(0.63.2)"
|
||||
|
||||
#: ../../gltf/how_to_impl_extension.md:3
|
||||
msgid ""
|
||||
"`UniVRM-0.63.2` から `UniGLTF` の構成が変わって、 `extensions` / `extras` "
|
||||
"の実装方法が変わりました。"
|
||||
msgstr ""
|
||||
msgstr "From `UniVRM-0.63.2` , `UniGLTF` structure is changed, cause `extensions` / `extras` implementations is updated."
|
||||
|
||||
#: ../../gltf/how_to_impl_extension.md:5
|
||||
msgid "GLTF 拡張とは"
|
||||
msgstr ""
|
||||
msgstr "About GLTF Extensions"
|
||||
|
||||
#: ../../gltf/how_to_impl_extension.md:7
|
||||
msgid "`glTF` は各所に `extensions`, `extras` が定義してありその中身を拡張できます。"
|
||||
msgstr ""
|
||||
msgstr "`glTF` has each `extensions`, `extras` points."
|
||||
|
||||
#: ../../gltf/how_to_impl_extension.md:9
|
||||
msgid "`extensions` (またはextras)"
|
||||
msgstr ""
|
||||
msgstr "`extensions` (or extras)"
|
||||
|
||||
#: ../../gltf/how_to_impl_extension.md:10
|
||||
msgid "`asset.extensions` (またはextras)"
|
||||
msgstr ""
|
||||
msgstr "`asset.extensions` (or extras)"
|
||||
|
||||
#: ../../gltf/how_to_impl_extension.md:11
|
||||
msgid "`meshes[*].extensions` (またはextras)"
|
||||
msgstr ""
|
||||
msgstr "`meshes[*].extensions` (or extras)"
|
||||
|
||||
#: ../../gltf/how_to_impl_extension.md:12
|
||||
msgid "`materials[*].extensions` (またはextras)"
|
||||
msgstr ""
|
||||
msgstr "`materials[*].extensions` (or extras)"
|
||||
|
||||
#: ../../gltf/how_to_impl_extension.md:14
|
||||
msgid "など。"
|
||||
msgstr ""
|
||||
msgstr "etc..."
|
||||
|
||||
#: ../../gltf/how_to_impl_extension.md:16
|
||||
msgid "`extensions` はオフィシャルに仕様を策定して `JsonSchema` として公開します。"
|
||||
msgstr ""
|
||||
msgstr "`extensions` is defined specification officially, and publish `JsonSchema`."
|
||||
|
||||
#: ../../gltf/how_to_impl_extension.md:18
|
||||
msgid "https://github.com/KhronosGroup/glTF/tree/master/extensions"
|
||||
|
|
@ -68,11 +68,13 @@ msgstr ""
|
|||
msgid ""
|
||||
"`extensions` は、`{ベンダー名}_{拡張名}` という命名規則です。 ベンダー名は、 "
|
||||
"https://github.com/KhronosGroup/glTF に申し込んで登録できます。"
|
||||
msgstr ""
|
||||
msgstr "`extensions` naming convention is `{VENDOR_NAME}_{EXTENSION_NAME}`.
|
||||
VENDOR_NAME can registered on https://github.com/KhronosGroup/glTF.
|
||||
"
|
||||
|
||||
#: ../../gltf/how_to_impl_extension.md:23
|
||||
msgid "`extras` は登録せずにアプリケーション独自に拡張する場合に用います。仕組みは同じです。"
|
||||
msgstr ""
|
||||
msgstr "`extras` is defined in application local."
|
||||
|
||||
#: ../../gltf/how_to_impl_extension.md:25
|
||||
msgid ""
|
||||
|
|
@ -82,13 +84,13 @@ msgstr ""
|
|||
|
||||
#: ../../gltf/how_to_impl_extension.md:27
|
||||
msgid "UniGLTF の extensions"
|
||||
msgstr ""
|
||||
msgstr "The extensions of UniGLTF"
|
||||
|
||||
#: ../../gltf/how_to_impl_extension.md:29
|
||||
msgid ""
|
||||
"`v0.63.0` 以前は、`GLTF 型` の `extensions` フィールドに、`GLTFExtensions` "
|
||||
"型を定義して、`VRM` フィールドを定義するという方法をとっていました。"
|
||||
msgstr ""
|
||||
msgstr "Before `v0.63.0`, `GLTF type` 's `extensions` field is statically extended as `GLTFExtensions Type`, and had `VRM type` field."
|
||||
|
||||
#: ../../gltf/how_to_impl_extension.md:49
|
||||
msgid "この設計だと GLTF と拡張を別ライブラリとして分離することができませんでした。"
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ msgstr ""
|
|||
|
||||
#: ../../history.md
|
||||
msgid "`materialGenerator(URP対応)` 引き数と `VrmData`"
|
||||
msgstr ""
|
||||
msgstr "`materialGenerator(for URP)` argument and `VrmData`"
|
||||
|
||||
#: ../../history.md
|
||||
msgid "v0.79"
|
||||
|
|
@ -64,7 +64,7 @@ msgstr ""
|
|||
|
||||
#: ../../history.md
|
||||
msgid "gltf の extension の実装方法を変更"
|
||||
msgstr ""
|
||||
msgstr "Update gltf extensions implementation"
|
||||
|
||||
#: ../../history.md
|
||||
msgid "v0.56"
|
||||
|
|
@ -72,5 +72,5 @@ msgstr ""
|
|||
|
||||
#: ../../history.md
|
||||
msgid "BlendShapeKey の仕様変更"
|
||||
msgstr ""
|
||||
msgstr "Update BlendShapeKey spec"
|
||||
|
||||
|
|
|
|||
|
|
@ -24,17 +24,17 @@ msgstr ""
|
|||
|
||||
#: ../../index.md:3
|
||||
msgid "これは、開発者(UniVRMを使ったアプリケーションを作成する人)向けのドキュメントです。"
|
||||
msgstr ""
|
||||
msgstr "This is a document for developer that using UniVRM."
|
||||
|
||||
#: ../../index.md:5
|
||||
msgid ""
|
||||
"UnityでVRMをエクスポートする方法などについては [manual](https://vrm.dev/docs/univrm/) "
|
||||
"を参照してください。"
|
||||
msgstr ""
|
||||
msgstr "Please see [manual](https://vrm.dev/en/docs//univrm/) about how to export VRM."
|
||||
|
||||
#: ../../index.md:7
|
||||
msgid "概要"
|
||||
msgstr ""
|
||||
msgstr "Overview"
|
||||
|
||||
#: ../../index.md:16
|
||||
msgid "glTF"
|
||||
|
|
|
|||
|
|
@ -20,11 +20,11 @@ msgstr ""
|
|||
|
||||
#: ../../package.md:1
|
||||
msgid "パッケージ構成"
|
||||
msgstr ""
|
||||
msgstr "Package Structure"
|
||||
|
||||
#: ../../package.md:3
|
||||
msgid "パッケージ"
|
||||
msgstr ""
|
||||
msgstr "Package"
|
||||
|
||||
#: ../../package.md
|
||||
msgid "unitypackage"
|
||||
|
|
@ -48,7 +48,7 @@ msgstr ""
|
|||
|
||||
#: ../../package.md
|
||||
msgid "VRMShaders と UniGLTF"
|
||||
msgstr ""
|
||||
msgstr "VRMShaders and UniGLTF"
|
||||
|
||||
#: ../../package.md
|
||||
msgid "UniVRM"
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: UniVRM Programming Document \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-09-14 13:46+0900\n"
|
||||
"POT-Creation-Date: 2021-09-14 14:37+0900\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
|
@ -24,19 +24,19 @@ msgstr ""
|
|||
|
||||
#: ../../vrm0/0_44_runtime_import.md:3
|
||||
msgid "`Version 0.44~` LoadAsyncの例"
|
||||
msgstr ""
|
||||
msgstr "`Version 0.44~` LoadAsync Example "
|
||||
|
||||
#: ../../vrm0/0_44_runtime_import.md:28
|
||||
msgid "LoadAsyncTaskを使う例"
|
||||
msgstr ""
|
||||
msgstr "LoadAsyncTask Example"
|
||||
|
||||
#: ../../vrm0/0_44_runtime_import.md:65
|
||||
msgid "関連する記事など"
|
||||
msgstr ""
|
||||
msgstr "Related-Article"
|
||||
|
||||
#: ../../vrm0/0_44_runtime_import.md:67
|
||||
msgid "こちらの記事がわかりやすいです。"
|
||||
msgstr ""
|
||||
msgstr "More details can be found in the link below (written in Japanese):"
|
||||
|
||||
#: ../../vrm0/0_44_runtime_import.md:69
|
||||
msgid "[UniVRMを使ってVRMモデルをランタイムロードする方法](https://qiita.com/sh_akira/items/8155e4b69107c2a7ede6)"
|
||||
|
|
@ -45,83 +45,87 @@ msgstr ""
|
|||
#: ../../vrm0/0_44_runtime_import.md:72
|
||||
msgid "最新バージョンは[こちら]({{< relref \"runtime_import.md\" >}})をご覧ください。"
|
||||
msgstr ""
|
||||
"Examples of importing the VRM model with the latest version [can be found"
|
||||
" here]({{< relref runtime_import.md >}})."
|
||||
|
||||
#: ../../vrm0/0_44_runtime_import.md:74
|
||||
msgid "Unityで実行時にモデルをインポートする方法です。"
|
||||
msgstr ""
|
||||
msgstr "The followings are the methods to import a VRM model at runtime in Unity:"
|
||||
|
||||
#: ../../vrm0/0_44_runtime_import.md:76
|
||||
msgid "ファイルパスからVRMを開く"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_44_runtime_import.md:78
|
||||
msgid ""
|
||||
"{{< highlight cs >}} var path=\"sample.vrm\"; var "
|
||||
"go=VRM.VRMImporter.LoadFromPath(path); Debug.LogFormat(\"loaded {0}\", "
|
||||
"go.name); {{< / highlight >}}"
|
||||
msgstr ""
|
||||
msgstr "Open VRM from a file path"
|
||||
|
||||
#: ../../vrm0/0_44_runtime_import.md:84
|
||||
msgid "ファイルパスから非同期にVRMを開く"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_44_runtime_import.md:86
|
||||
msgid ""
|
||||
"{{< highlight cs >}} var path=\"sample.vrm\"; "
|
||||
"VRMImporter.LoadVrmAsync(path, go => { Debug.LogFormat(\"loaded "
|
||||
"{0}\", go.name); }); {{< / highlight >}}"
|
||||
msgstr ""
|
||||
msgstr "Open VRM asynchronously from a file path"
|
||||
|
||||
#: ../../vrm0/0_44_runtime_import.md:93
|
||||
msgid "バイト列からVRM開く"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_44_runtime_import.md:95
|
||||
msgid ""
|
||||
"{{< highlight cs >}} var path=\"sample.vrm\"; var bytes = "
|
||||
"File.ReadAllBytes(path); var go=VRMImporter.LoadFromBytes(bytes); {{< / "
|
||||
"highlight >}}"
|
||||
msgstr ""
|
||||
msgstr "Open VRM from a byte array"
|
||||
|
||||
#: ../../vrm0/0_44_runtime_import.md:101
|
||||
msgid "バイト列から非同期にVRMを開く"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_44_runtime_import.md:103
|
||||
msgid ""
|
||||
"{{< highlight cs >}} VRMImporter.LoadVrmAsync(bytes, go => { "
|
||||
"Debug.LogFormat(\"loaded {0}\", go.name); }); {{< / highlight >}}"
|
||||
msgstr ""
|
||||
msgstr "Open VRM asynchronously from a byte array"
|
||||
|
||||
#: ../../vrm0/0_44_runtime_import.md:109
|
||||
msgid "VRMから情報を取り出す"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_44_runtime_import.md:111
|
||||
msgid ""
|
||||
"{{< highlight cs >}} #if UNITY_STANDALONE_WIN var path = "
|
||||
"FileDialogForWindows.FileDialog(\"open VRM\", \".vrm\"); #else"
|
||||
" var path = Application.dataPath + \"/default.vrm\"; #endif"
|
||||
" if (string.IsNullOrEmpty(path)) {"
|
||||
" return; }"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_44_runtime_import.md:154
|
||||
msgid "{{< / highlight >}}"
|
||||
msgstr ""
|
||||
msgstr "Get the information form VRM"
|
||||
|
||||
#: ../../vrm0/0_44_runtime_import.md:156
|
||||
msgid "Thumbnailを取得する(v0.37から)"
|
||||
msgstr ""
|
||||
msgstr "Get the thumbnail (From v0.37)"
|
||||
|
||||
#: ../../vrm0/0_44_runtime_import.md:158
|
||||
msgid "ReadMetaに引数を渡すことでThumbnailテクスチャを作成できます。"
|
||||
msgstr ""
|
||||
msgstr "A thumbnail texture can be created by passing arguments to ReadMeta. "
|
||||
|
||||
#: ../../vrm0/0_44_runtime_import.md:160
|
||||
msgid ""
|
||||
"{{< highlight cs >}} var meta = context.ReadMeta(true); // "
|
||||
"Thumbnailテクスチャを作成する Texture2D thumbnail=meta.Thumbnail; {{< / "
|
||||
"highlight >}}"
|
||||
msgstr ""
|
||||
#~ msgid ""
|
||||
#~ "{{< highlight cs >}} var "
|
||||
#~ "path=\"sample.vrm\"; var "
|
||||
#~ "go=VRM.VRMImporter.LoadFromPath(path); Debug.LogFormat(\"loaded"
|
||||
#~ " {0}\", go.name); {{< / highlight >}}"
|
||||
#~ msgstr ""
|
||||
|
||||
#~ msgid ""
|
||||
#~ "{{< highlight cs >}} var "
|
||||
#~ "path=\"sample.vrm\"; VRMImporter.LoadVrmAsync(path, go "
|
||||
#~ "=> { Debug.LogFormat(\"loaded {0}\", "
|
||||
#~ "go.name); }); {{< / highlight >}}"
|
||||
#~ msgstr ""
|
||||
|
||||
#~ msgid ""
|
||||
#~ "{{< highlight cs >}} var "
|
||||
#~ "path=\"sample.vrm\"; var bytes = "
|
||||
#~ "File.ReadAllBytes(path); var "
|
||||
#~ "go=VRMImporter.LoadFromBytes(bytes); {{< / highlight"
|
||||
#~ " >}}"
|
||||
#~ msgstr ""
|
||||
|
||||
#~ msgid ""
|
||||
#~ "{{< highlight cs >}} "
|
||||
#~ "VRMImporter.LoadVrmAsync(bytes, go => { "
|
||||
#~ "Debug.LogFormat(\"loaded {0}\", go.name); }); "
|
||||
#~ "{{< / highlight >}}"
|
||||
#~ msgstr ""
|
||||
|
||||
#~ msgid ""
|
||||
#~ "{{< highlight cs >}} #if "
|
||||
#~ "UNITY_STANDALONE_WIN var path = "
|
||||
#~ "FileDialogForWindows.FileDialog(\"open VRM\", \".vrm\");"
|
||||
#~ " #else var path = "
|
||||
#~ "Application.dataPath + \"/default.vrm\"; #endif"
|
||||
#~ " if (string.IsNullOrEmpty(path)) "
|
||||
#~ "{ return; }"
|
||||
#~ msgstr ""
|
||||
|
||||
#~ msgid "{{< / highlight >}}"
|
||||
#~ msgstr ""
|
||||
|
||||
#~ msgid ""
|
||||
#~ "{{< highlight cs >}} var meta "
|
||||
#~ "= context.ReadMeta(true); // Thumbnailテクスチャを作成する"
|
||||
#~ " Texture2D thumbnail=meta.Thumbnail; {{< /"
|
||||
#~ " highlight >}}"
|
||||
#~ msgstr ""
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: UniVRM Programming Document \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-09-14 13:46+0900\n"
|
||||
"POT-Creation-Date: 2021-09-14 14:37+0900\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
|
@ -23,200 +23,236 @@ msgid "BlendShapeProxy(0.58)"
|
|||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:3
|
||||
msgid "環境"
|
||||
msgstr ""
|
||||
msgid "BlendShapeKeyのインタフェースを厳格化、整理"
|
||||
msgstr "Rework BlendShapeKey's Interface"
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:4
|
||||
msgid "UniVRM v0.58.0"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:6
|
||||
#, python-format
|
||||
msgid "[BlendShapeKeyのインタフェースを厳格化、整理](https://github.com/vrm-c/UniVRM/wiki/ReleaseNote-v0.56.0%28ja%29#blendshapekey%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%BF%E3%83%95%E3%82%A7%E3%83%BC%E3%82%B9%E3%82%92%E5%8E%B3%E6%A0%BC%E5%8C%96%E6%95%B4%E7%90%86)"
|
||||
#: ../../vrm0/0_58_blendshape.md:5
|
||||
msgid "BlendShapeKeyを作成する方法が不明瞭だったため、 より明示的な API に置き換えました。"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:8
|
||||
msgid "使用するメソッド"
|
||||
msgid "BlendShapeClip.Key 追加"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:10
|
||||
msgid "[推奨] `SetValues`"
|
||||
#: ../../vrm0/0_58_blendshape.md
|
||||
msgid "arguments"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:11
|
||||
msgid "[非推奨] `ImmediatelySetValue`"
|
||||
#: ../../vrm0/0_58_blendshape.md
|
||||
msgid "before"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:12
|
||||
msgid "[上級者向け] `AccumulateValue`"
|
||||
#: ../../vrm0/0_58_blendshape.md
|
||||
msgid "after"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:13
|
||||
msgid "[上級者向け] `Apply`"
|
||||
#: ../../vrm0/0_58_blendshape.md
|
||||
msgid "備考"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:15
|
||||
msgid "スクリプトから BlendShape weight を適用する"
|
||||
#: ../../vrm0/0_58_blendshape.md
|
||||
msgid "string name, BlendShapePreset preset"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md
|
||||
msgid "public constructor"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md
|
||||
msgid "private constructor"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md
|
||||
msgid ""
|
||||
"BlendShapePreset.Unknownのときの挙動が不明瞭だった。代わりに、CreateFromPreset または "
|
||||
"CreateUnknown を使用してください"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md
|
||||
msgid "BlendShapeClip"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md
|
||||
msgid "BlendShapeKey.CreateFrom"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md
|
||||
msgid "BlendShapeKey.CreateFromClip"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md
|
||||
msgid "他の関数に合わせて、名前を変更"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md
|
||||
msgid "BlendShapePreset"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md
|
||||
msgid "BlendShapeKey.CreateFromPreset"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md
|
||||
msgid "オーバーロードをやめて明示的な関数に変更"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md
|
||||
msgid "string"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md
|
||||
msgid "BlendShapeKey.CreateUnknown"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md
|
||||
msgid "オーバーロードをやめて明示的な関数に変更。"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:17
|
||||
msgid "使用するメソッド"
|
||||
msgstr "Methods"
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:19
|
||||
msgid "[推奨] `SetValues`"
|
||||
msgstr "[Recommended] `SetValues`"
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:20
|
||||
msgid "[非推奨] `ImmediatelySetValue`"
|
||||
msgstr "[Not Recommended] `ImmediatelySetValue`"
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:21
|
||||
msgid "[上級者向け] `AccumulateValue`"
|
||||
msgstr "[For Advanced Users] `AccumulateValue`"
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:22
|
||||
msgid "[上級者向け] `Apply`"
|
||||
msgstr "[For Advanced Users] `Apply`"
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:24
|
||||
msgid "スクリプトから BlendShape weight を適用する"
|
||||
msgstr "Apply BlendShape weight from script"
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:26
|
||||
msgid ""
|
||||
"`SetValues` 関数のみを使用します。 そのフレームで必要な表情の weight 値をすべて集めてから `SetValues` を 1 "
|
||||
"回だけ呼んで設定します。"
|
||||
msgstr ""
|
||||
"Call `SetValues` function once to create the specific expression (merged "
|
||||
"by multiple BlendShapes) in a frame"
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:20
|
||||
msgid "{{< highlight cs >}} var proxy = GetComponent<VRMBlendShapeProxy>();"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:23
|
||||
msgid ""
|
||||
"proxy.SetValues(new Dictionary<BlendShapeKey, float> { "
|
||||
"{BlendShapeKey.CreateFromPreset(BlendShapePreset.A), 1f}, // [0, 1] の範囲で "
|
||||
"Weight を指定 {BlendShapeKey.CreateFromPreset(BlendShapePreset.Joy), "
|
||||
"1f}, // システム定義の表情は enum で指定 "
|
||||
"{BlendShapeKey.CreateUnknown(\"USER_DEFINED_FACIAL\"), 1f}, // ユーザ定義の表情は "
|
||||
"string で指定 }); {{< / highlight >}}"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:31
|
||||
#: ../../vrm0/0_58_blendshape.md:40
|
||||
msgid "複数の BlendShape weight を適用する際の競合の問題について"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:33
|
||||
#: ../../vrm0/0_58_blendshape.md:42
|
||||
msgid "この節では、なぜ `SetValues` を使わなければならないのかという疑問に回答します。"
|
||||
msgstr ""
|
||||
msgstr "Why use `SetValues` for synthesizing multiple BlendShapes?"
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:35
|
||||
#: ../../vrm0/0_58_blendshape.md:44
|
||||
msgid "たとえば 2 つの VRMBlendShape `Blink_L` と `Blink_R` が"
|
||||
msgstr ""
|
||||
"We found that multiple BlendShapes compete with each other when the "
|
||||
"following expressions are specified"
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:37
|
||||
#: ../../vrm0/0_58_blendshape.md:46
|
||||
msgid "VRMBlendShape `Blink_L`"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:39
|
||||
#: ../../vrm0/0_58_blendshape.md:48
|
||||
msgid "Mesh `A` の Blendshape `eye_close_L` の weight 値 `100`"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:40
|
||||
#: ../../vrm0/0_58_blendshape.md:49
|
||||
msgid "Mesh `A` の Blendshape `eye_close_R` の weight 値 `1`"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:42
|
||||
#: ../../vrm0/0_58_blendshape.md:51
|
||||
msgid "VRMBlendShape `Blink_R`"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:44
|
||||
#: ../../vrm0/0_58_blendshape.md:53
|
||||
msgid "Mesh `A` の Blendshape `eye_close_L` の weight 値 `1`"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:45
|
||||
#: ../../vrm0/0_58_blendshape.md:54
|
||||
msgid "Mesh `A` の Blendshape `eye_close_R` の weight 値 `100`"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:47
|
||||
#: ../../vrm0/0_58_blendshape.md:56
|
||||
msgid "で定義されているとします。 このとき両目を閉じたいモチベーションから、両方を有効にする意図で下記のように実行します。"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:50
|
||||
msgid ""
|
||||
"{{< highlight cs >}} "
|
||||
"proxy.ImmediatelySetValue(BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_L),"
|
||||
" 1.0f); "
|
||||
"proxy.ImmediatelySetValue(BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_R),"
|
||||
" 1.0f); {{< / highlight >}}"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:55
|
||||
#: ../../vrm0/0_58_blendshape.md:64
|
||||
msgid ""
|
||||
"すると、左目だけが開いてしまいます。 これは後から `ImmediateSetValue` した `Blink_R` が `Blink_L` "
|
||||
"と競合して weight を上書きしてしまうからです。 したがって VRM の表情制御においては下記の 2 "
|
||||
"通りのどちらかの方法で書くことが求められます。 これらの方法はこの競合の問題を解決して表情を設定することができます。"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:60
|
||||
msgid ""
|
||||
"{{< highlight cs >}} proxy.SetValues(new Dictionary<BlendShapeKey, float>"
|
||||
" { {BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_L), 1.0f},"
|
||||
" {BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_R), 1.0f}, "
|
||||
"}); {{< / highlight >}}"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:68
|
||||
#: ../../vrm0/0_58_blendshape.md:77
|
||||
msgid "または"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:70
|
||||
msgid ""
|
||||
"{{< highlight cs >}} "
|
||||
"proxy.AccumulateValue(BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_L),"
|
||||
" 1.0f); // すぐに適用せずにたくわえる "
|
||||
"proxy.AccumulateValue(BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_R),"
|
||||
" 1.0f); proxy.Apply(); // 蓄積した値をまとめて適用する {{< / highlight >}}"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:76
|
||||
#: ../../vrm0/0_58_blendshape.md:85
|
||||
msgid "WIP"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:78
|
||||
#: ../../vrm0/0_58_blendshape.md:87
|
||||
msgid "何故、複数のSetterがあるのか"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:80
|
||||
#: ../../vrm0/0_58_blendshape.md:89
|
||||
msgid "LipSync"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:81
|
||||
#: ../../vrm0/0_58_blendshape.md:90
|
||||
msgid "瞬き"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:82
|
||||
#: ../../vrm0/0_58_blendshape.md:91
|
||||
msgid "視線制御(BlendShapeで視線を動かすタイプのモデル)"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:83
|
||||
#: ../../vrm0/0_58_blendshape.md:92
|
||||
msgid "プログラムによる喜怒哀楽"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:85
|
||||
#: ../../vrm0/0_58_blendshape.md:94
|
||||
msgid ""
|
||||
"上記のような複数のBlendShapeが別々のコンポーネントから設定された場合に、 BlendShape同士が競合することがわかりました。 "
|
||||
"後で設定した値で上書きされて希望のBlendShapeが適用されないという状態になります。 "
|
||||
"これを解決するために、一か所で中央集権的に制御する必要があります。"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:90
|
||||
#: ../../vrm0/0_58_blendshape.md:99
|
||||
msgid "合成したり排他制御した、BlendShapeClipの集合のスナップショットをまとめて適用することを想定して `SetValues`"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:92
|
||||
#: ../../vrm0/0_58_blendshape.md:101
|
||||
msgid "ImmediatelySetValue"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:94
|
||||
#: ../../vrm0/0_58_blendshape.md:103
|
||||
msgid "簡単なテストプログラムでの利用を想定しています。"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:96 ../../vrm0/0_58_blendshape.md:106
|
||||
#: ../../vrm0/0_58_blendshape.md:122
|
||||
#: ../../vrm0/0_58_blendshape.md:105 ../../vrm0/0_58_blendshape.md:115
|
||||
#: ../../vrm0/0_58_blendshape.md:131
|
||||
msgid "例:"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:104
|
||||
#: ../../vrm0/0_58_blendshape.md:113
|
||||
msgid "AccumulateValue + Apply"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:116
|
||||
#: ../../vrm0/0_58_blendshape.md:125
|
||||
msgid "下記のSetValuesを推奨しています。"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:118
|
||||
#: ../../vrm0/0_58_blendshape.md:127
|
||||
msgid "SetValues"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/0_58_blendshape.md:120
|
||||
#: ../../vrm0/0_58_blendshape.md:129
|
||||
msgid "BlendShape合成器が必要に応じ呼び出すことを想定しています。"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
|||
|
|
@ -24,63 +24,63 @@ msgstr ""
|
|||
|
||||
#: ../../vrm0/0_68_runtime_import.md:3
|
||||
msgid "過去バージョンからの仕様変更"
|
||||
msgstr ""
|
||||
msgstr "API Changes"
|
||||
|
||||
#: ../../vrm0/0_68_runtime_import.md:5
|
||||
msgid "`ImporterContext` の仕様を変更しました。"
|
||||
msgstr ""
|
||||
msgstr "ImporterContext has been reworked."
|
||||
|
||||
#: ../../vrm0/0_68_runtime_import.md:7
|
||||
msgid "ロード処理が Parse と Load の 2 ステップに分かれました。"
|
||||
msgstr ""
|
||||
msgstr "Loading processing has been divided into two steps: `Parse` and `Load`."
|
||||
|
||||
#: ../../vrm0/0_68_runtime_import.md:8
|
||||
msgid "Parse 処理をメインスレッド以外で処理することができます。"
|
||||
msgstr ""
|
||||
msgstr "`Parse` processing can be processed by other than the main thread."
|
||||
|
||||
#: ../../vrm0/0_68_runtime_import.md:9
|
||||
msgid "非同期ロード関数 `ImporterContext.LoadAsync` の実装を `Task` に変更しました。"
|
||||
msgstr ""
|
||||
msgstr "The implementation of asynchronous loading function `ImporterContext.LoadAsync` has changed to `Task`."
|
||||
|
||||
#: ../../vrm0/0_68_runtime_import.md:10
|
||||
msgid "これまで明示的に破棄できなかった `UnityEngine.Object` リソースを破棄できるようになりました。"
|
||||
msgstr ""
|
||||
msgstr "The method of explicitly destroying `UnityEngine.Object` resources is now available."
|
||||
|
||||
#: ../../vrm0/0_68_runtime_import.md:11
|
||||
msgid "リソースのリークを防ぐことができます。"
|
||||
msgstr ""
|
||||
msgstr " As such, resource leaks can be prevented."
|
||||
|
||||
#: ../../vrm0/0_68_runtime_import.md:12
|
||||
msgid "`ImporterContext.Dispose` を呼び出すべきタイミングを「ロード処理終了時」に変更しました。"
|
||||
msgstr ""
|
||||
msgstr "The timing of calling `ImporterContext.Dispose` has been changed to when the loading process ends"
|
||||
|
||||
#: ../../vrm0/0_68_runtime_import.md:13
|
||||
msgid "呼び出して破棄する前に、後述の `ImporterContext.DisposeOnGameObjectDestroyed` を呼び出してください。"
|
||||
msgstr ""
|
||||
msgstr "Call `ImporterContext.DisposeOnGameObjectDestroyed` function (described below) before `ImporterContext.Dispose` function is called."
|
||||
|
||||
#: ../../vrm0/0_68_runtime_import.md:14
|
||||
msgid "以前の仕様は「生成したモデルの破棄時」に呼び出すべき関数でした。"
|
||||
msgstr ""
|
||||
msgstr "In the previous versions, `ImporterContext.Dispose` is called when the generated VRM model is destroyed."
|
||||
|
||||
#: ../../vrm0/0_68_runtime_import.md:15
|
||||
msgid "`ImporterContext.DisposeOnGameObjectDestroyed` 関数を追加しました。"
|
||||
msgstr ""
|
||||
msgstr "Added `ImporterContext.DisposeOnGameObjectDestroyed` function"
|
||||
|
||||
#: ../../vrm0/0_68_runtime_import.md:16
|
||||
msgid ""
|
||||
"VRM モデルが必要とするリソース (Texture, Material, Mesh, etc) を破棄する責務を GameObject "
|
||||
"に移譲できます。"
|
||||
msgstr ""
|
||||
msgstr "The duty of destroying VRM resources (Texture, Material, Mesh, etc) has been transferred to GameObject."
|
||||
|
||||
#: ../../vrm0/0_68_runtime_import.md:17
|
||||
msgid "VRM の GameObject の破棄タイミングでリソース (Texture, Material, Mesh, etc) を破棄します。"
|
||||
msgstr ""
|
||||
msgstr "The resources (Texture, Material, Mesh, etc) will be destroyed when VRM's GameObject is destroyed."
|
||||
|
||||
#: ../../vrm0/0_68_runtime_import.md:20
|
||||
msgid "サンプルコード(同期的ロード)"
|
||||
msgstr ""
|
||||
msgstr "Sample Codes (Synchronous Loading)"
|
||||
|
||||
#: ../../vrm0/0_68_runtime_import.md:88
|
||||
msgid "サンプルコード(非同期ロード)"
|
||||
msgstr ""
|
||||
msgstr "Sample Codes (Asynchronous Loading)"
|
||||
|
||||
|
|
|
|||
|
|
@ -28,18 +28,18 @@ msgstr ""
|
|||
|
||||
#: ../../vrm0/0_77_runtime_import.md:5
|
||||
msgid "`ImporterContext` の仕様を変更しました。"
|
||||
msgstr ""
|
||||
msgstr "`ImporterContext` API has been modified."
|
||||
|
||||
#: ../../vrm0/0_77_runtime_import.md:7
|
||||
msgid ""
|
||||
"`Version 0.68` で導入した、 `ImporterContext.DisposeOnGameObjectDestroyed` "
|
||||
"が扱いづらかったためのでこれを取りやめ、 `ImporterContext.Load` が `RuntimeGltfInstance` "
|
||||
"を返すようにしました。"
|
||||
msgstr ""
|
||||
msgstr "The function `ImporterContext.DisposeOnGameObjectDestroyed` introduced in `Version 0.68` has been discarded. Instead, `ImporterContext.Load` and `RuntimeGltfInstance` are used in `v0.77`."
|
||||
|
||||
#: ../../vrm0/0_77_runtime_import.md:10
|
||||
msgid "`RuntimeGltfInstance` は、 `ImporterContext` の"
|
||||
msgstr ""
|
||||
msgstr "In addition, `ImporterContext`'s members have been moved to `RuntimeGltfInstance`:"
|
||||
|
||||
#: ../../vrm0/0_77_runtime_import.md:12
|
||||
msgid "Root"
|
||||
|
|
@ -58,5 +58,5 @@ msgid ""
|
|||
"を引き継ぎます。 Load の呼び出し後の任意のタイミングで ImporterContext.Dispose で Importer "
|
||||
"を破棄してください。 任意のタイミングで RuntimeGltfInstance を Destory することで紐づくリソース (Texture,"
|
||||
" Material, Mesh, etc) も破棄されます。"
|
||||
msgstr ""
|
||||
msgstr "To destroy the Importer, use `ImporterContext.Dispose` after `Load` is called. By destroying RuntimeGltfInstance, the resources associated with the RuntimeGltfInstance (Texture, Material, Mesh, etc) will be destroyed."
|
||||
|
||||
|
|
|
|||
|
|
@ -24,5 +24,5 @@ msgstr ""
|
|||
|
||||
#: ../../vrm0/0_79_runtime_import.md:3
|
||||
msgid "`GltfParser` と `GltfData` の分割"
|
||||
msgstr ""
|
||||
msgstr "Separate `GltfData` from `GltfParser`"
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ msgstr ""
|
|||
|
||||
#: ../../vrm0/0_82_runtime_import.md:3
|
||||
msgid "`Version 0.82.0` は `0.82.1` 以降を使ってください。"
|
||||
msgstr ""
|
||||
msgstr "`Version 0.82.0`: Please use `0.82.1` or later"
|
||||
|
||||
#: ../../vrm0/0_82_runtime_import.md:4
|
||||
msgid "`Version 0.82.1~`"
|
||||
|
|
@ -32,57 +32,57 @@ msgstr ""
|
|||
|
||||
#: ../../vrm0/0_82_runtime_import.md:6
|
||||
msgid "以下の手順で import します。"
|
||||
msgstr ""
|
||||
msgstr "Below step is needed"
|
||||
|
||||
#: ../../vrm0/0_82_runtime_import.md:8
|
||||
msgid "VRMをパースして、`GltfData` を得る。"
|
||||
msgstr ""
|
||||
msgstr "Parse VRM, and Get `GltfData`."
|
||||
|
||||
#: ../../vrm0/0_82_runtime_import.md:9
|
||||
msgid "`GltfData` から `VRMData` を得る。"
|
||||
msgstr ""
|
||||
msgstr "Get `VRMData` from `GltfData`."
|
||||
|
||||
#: ../../vrm0/0_82_runtime_import.md:10
|
||||
msgid "`VrmData` から `RuntimeGltfInstance` をロードする。"
|
||||
msgstr ""
|
||||
msgstr "Load a `RuntimeGltfInstance` from `VRMData`."
|
||||
|
||||
#: ../../vrm0/0_82_runtime_import.md:11
|
||||
msgid "`RuntimeGltfInstance` を使う。"
|
||||
msgstr ""
|
||||
msgstr "Use the `RuntimeGltfInstance`"
|
||||
|
||||
#: ../../vrm0/0_82_runtime_import.md:13
|
||||
msgid "サンプルの `Assets\\VRM\\Samples\\SimpleViewer\\ViewerUI.cs` も参照してください。"
|
||||
msgstr ""
|
||||
msgstr "See `Assets\VRM\Samples\SimpleViewer\ViewerUI.cs`"
|
||||
|
||||
#: ../../vrm0/0_82_runtime_import.md:15
|
||||
msgid "1. `GltfData` を得る"
|
||||
msgstr ""
|
||||
msgstr "1. Get `GltfData`"
|
||||
|
||||
#: ../../vrm0/0_82_runtime_import.md:24
|
||||
msgid "[GLB import](../gltf/0_82_glb_import.md) も参照してください。"
|
||||
msgstr ""
|
||||
msgstr "See [GLB import](../gltf/0_82_glb_import.md)."
|
||||
|
||||
#: ../../vrm0/0_82_runtime_import.md:26
|
||||
msgid "2. `VRMData` を得る"
|
||||
msgstr ""
|
||||
msgstr "2. Get `VRMData`"
|
||||
|
||||
#: ../../vrm0/0_82_runtime_import.md:32
|
||||
msgid "3. Load する"
|
||||
msgstr ""
|
||||
msgstr "3. Load"
|
||||
|
||||
#: ../../vrm0/0_82_runtime_import.md:46
|
||||
msgid "URP 向けに `materialGenerator` を指定する(実験)"
|
||||
msgstr ""
|
||||
msgstr "Set `materialGenerator` argument for URP(Experimental)"
|
||||
|
||||
#: ../../vrm0/0_82_runtime_import.md:48
|
||||
msgid ""
|
||||
"`materialGenerator` 引き数(省略可能)を指定することで URP マテリアルを生成するようにカスタムできます。 指定しない場合は"
|
||||
" `built-in` 向けのデフォルトが使用されます。"
|
||||
msgstr ""
|
||||
msgstr "Set `materialGenerator` Argument, material generation is could customized. If omitted, default `materialGenerator` for `built-in` pipeline is used."
|
||||
|
||||
#: ../../vrm0/0_82_runtime_import.md:63
|
||||
msgid "まだ URP 向け MToonShader が作成されていないので、`UniUnlit` にフォールバックします。"
|
||||
msgstr ""
|
||||
msgstr "`MToonShader for URP` has not been implemented yet, fallback to `UniUnlit`."
|
||||
|
||||
#: ../../vrm0/0_82_runtime_import.md:65
|
||||
msgid "4. Instance"
|
||||
|
|
@ -90,5 +90,5 @@ msgstr ""
|
|||
|
||||
#: ../../vrm0/0_82_runtime_import.md:74
|
||||
msgid "使用後に以下のように破棄してください。関連する Asset(Texture, Material, Meshなど)も破棄されます。"
|
||||
msgstr ""
|
||||
msgstr "When destroy, related assets(meshes, materials and textures etc...) is destroyed."
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: UniVRM Programming Document \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-09-14 13:46+0900\n"
|
||||
"POT-Creation-Date: 2021-09-14 14:37+0900\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
|
@ -20,17 +20,17 @@ msgstr ""
|
|||
|
||||
#: ../../vrm0/firstperson.md:1
|
||||
msgid "VRMFirstPersonの使い方"
|
||||
msgstr ""
|
||||
msgstr "How to use VRMFirstPerson"
|
||||
|
||||
#: ../../vrm0/firstperson.md:3
|
||||
msgid "VRMFirstPersonの設定"
|
||||
msgstr ""
|
||||
msgstr "VRMFirstPerson Settings"
|
||||
|
||||
#: ../../vrm0/firstperson.md:4
|
||||
msgid ""
|
||||
"[VRMFirstPerson]({{< relref \"univrm_firstperson.md\" "
|
||||
">}})ではRendererに対して設定があります。"
|
||||
msgstr ""
|
||||
msgstr "[VRMFirstPerson](univrm_firstperson.md) has the following settings for Renderer:"
|
||||
|
||||
#: ../../vrm0/firstperson.md
|
||||
msgid "FirstPersonFlag"
|
||||
|
|
@ -38,11 +38,11 @@ msgstr ""
|
|||
|
||||
#: ../../vrm0/firstperson.md
|
||||
msgid "レイヤー"
|
||||
msgstr ""
|
||||
msgstr "Layer"
|
||||
|
||||
#: ../../vrm0/firstperson.md
|
||||
msgid "備考"
|
||||
msgstr ""
|
||||
msgstr "Note"
|
||||
|
||||
#: ../../vrm0/firstperson.md
|
||||
msgid "Both"
|
||||
|
|
@ -54,7 +54,7 @@ msgstr ""
|
|||
|
||||
#: ../../vrm0/firstperson.md
|
||||
msgid "一人称と三人称で分ける必要のない部分に指定します"
|
||||
msgstr ""
|
||||
msgstr "Specify parts that are not necessarily separated between first-person view and third-person view."
|
||||
|
||||
#: ../../vrm0/firstperson.md
|
||||
msgid "ThirdPersonOnly"
|
||||
|
|
@ -66,7 +66,7 @@ msgstr ""
|
|||
|
||||
#: ../../vrm0/firstperson.md
|
||||
msgid "一人称時に描画したくない部分に指定します"
|
||||
msgstr ""
|
||||
msgstr "Specify parts that are not rendered in first-person view."
|
||||
|
||||
#: ../../vrm0/firstperson.md
|
||||
msgid "FirstPersonOnly"
|
||||
|
|
@ -78,7 +78,7 @@ msgstr ""
|
|||
|
||||
#: ../../vrm0/firstperson.md
|
||||
msgid "三人称時に描画したくない部分に指定します。自動作成した頭部無しモデルが使います"
|
||||
msgstr ""
|
||||
msgstr "Specify parts that are not rendered in third-person view. The auto-created headless model is used."
|
||||
|
||||
#: ../../vrm0/firstperson.md
|
||||
msgid "Auto"
|
||||
|
|
@ -86,30 +86,19 @@ msgstr ""
|
|||
|
||||
#: ../../vrm0/firstperson.md
|
||||
msgid "実行時に一人称用モデルを自動で作成し、それをFIRSTPERSON_ONLY_LAYERに設定します"
|
||||
msgstr ""
|
||||
msgstr "Automatically create the model in first-person view at runtime and set it to FIRSTPERSON_ONLY_LAYER."
|
||||
|
||||
#: ../../vrm0/firstperson.md:13
|
||||
msgid "実行時に**VRMFirstPerson.Setup**を呼び出すことで、上記のレイヤー設定を行うことができます。明示的に外部から呼び出してください。"
|
||||
msgstr ""
|
||||
msgstr "By calling **VRMFirstPerson.Setup** at runtime, the layer settings described above can be performed. Please call the function explicitly from outside."
|
||||
|
||||
#: ../../vrm0/firstperson.md:15
|
||||
msgid "アプリケーションに追加の描画レイヤーを指定する"
|
||||
msgstr ""
|
||||
msgstr "Specify the additional render layers for the application"
|
||||
|
||||
#: ../../vrm0/firstperson.md:17
|
||||
msgid "定数で以下のレイヤーを定義しています。"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/firstperson.md:19
|
||||
msgid ""
|
||||
"{{< highlight cs >}} public class VRMFirstPerson : MonoBehaviour { "
|
||||
"public const int FIRSTPERSON_ONLY_LAYER = 9; public const int "
|
||||
"THIRDPERSON_ONLY_LAYER = 10;"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/firstperson.md:26 ../../vrm0/firstperson.md:79
|
||||
msgid "} {{< / highlight >}}"
|
||||
msgstr ""
|
||||
msgstr "The following layers are defined as constant:"
|
||||
|
||||
#: ../../vrm0/firstperson.md
|
||||
msgid "{{< img src=\"images/vrm/layer_setting.png\" >}}"
|
||||
|
|
@ -117,29 +106,16 @@ msgstr ""
|
|||
|
||||
#: ../../vrm0/firstperson.md
|
||||
msgid "9番と10番にLayerを設定"
|
||||
msgstr ""
|
||||
msgstr "Set Layer in #9 and #10"
|
||||
|
||||
#: ../../vrm0/firstperson.md:33
|
||||
msgid "実行時にSetupを呼び出して、カメラにLayerMaskを設定する"
|
||||
msgstr ""
|
||||
msgstr "Call Setup function at runtime and set LayerMask in Camera"
|
||||
|
||||
#: ../../vrm0/firstperson.md:35
|
||||
msgid "VRMFirstPerson.Setupの呼び出し"
|
||||
msgstr ""
|
||||
msgstr "Call VRMFirstPerson.Setup"
|
||||
|
||||
#: ../../vrm0/firstperson.md:36
|
||||
msgid "一人称カメラとその他のカメラに対してLayerMask"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/firstperson.md:38
|
||||
msgid ""
|
||||
"{{< highlight cs >}} using System.Collections; using "
|
||||
"System.Collections.Generic; using UnityEngine; using VRM;"
|
||||
msgstr ""
|
||||
|
||||
#: ../../vrm0/firstperson.md:44
|
||||
msgid ""
|
||||
"public class SetupExample : MonoBehaviour { [SerializeField] "
|
||||
"Camera m_firstPersonCamera; // HMDのカメラ"
|
||||
msgstr ""
|
||||
|
||||
msgstr " Set LayerMask for first-person camera view and other camera views"
|
||||
|
|
|
|||
|
|
@ -24,29 +24,29 @@ msgstr ""
|
|||
|
||||
#: ../../vrm1/vrm1_firstperson.md:3
|
||||
msgid "Runtime に FirstPerson 機能を有効にする"
|
||||
msgstr ""
|
||||
msgstr "Enable FirstPerson function at runtime."
|
||||
|
||||
#: ../../vrm1/vrm1_firstperson.md:5
|
||||
msgid "VR向け FirstPerson 設定の初期化手順です。"
|
||||
msgstr ""
|
||||
msgstr "The VR First Person settings."
|
||||
|
||||
#: ../../vrm1/vrm1_firstperson.md:7
|
||||
msgid "Load する"
|
||||
msgstr ""
|
||||
msgstr "Load"
|
||||
|
||||
#: ../../vrm1/vrm1_firstperson.md:8
|
||||
msgid "VRM10Controller を取得する"
|
||||
msgstr ""
|
||||
msgstr "Get VRM10Controller"
|
||||
|
||||
#: ../../vrm1/vrm1_firstperson.md:9
|
||||
msgid "`controller.Vrm.FirstPerson.SetupAsync` を呼び出す"
|
||||
msgstr ""
|
||||
msgstr "Call `controller.Vrm.FirstPerson.SetupAsync`"
|
||||
|
||||
#: ../../vrm1/vrm1_firstperson.md:10
|
||||
msgid ""
|
||||
"`controller.Vrm.FirstPerson.SetupAsync` した結果新規に作成されたモデルを "
|
||||
"`RuntimeGltfInstance` に渡す"
|
||||
msgstr ""
|
||||
msgstr "Add the result of `controller.Vrm.FirstPerson.SetupAsync` to `RuntimeGltfInstance`"
|
||||
|
||||
#: ../../vrm1/vrm1_firstperson.md:11
|
||||
msgid "ShowMeshes"
|
||||
|
|
@ -54,43 +54,43 @@ msgstr ""
|
|||
|
||||
#: ../../vrm1/vrm1_firstperson.md:43
|
||||
msgid "VRMの推奨する VR 向けのカメラ構成"
|
||||
msgstr ""
|
||||
msgstr "Recommended camera layer settings"
|
||||
|
||||
#: ../../vrm1/vrm1_firstperson.md:45
|
||||
msgid "ヘッドマウントディスプレイを表すカメラ と その他のカメラという2種類のカメラを想定ます。 それぞれに対して、"
|
||||
msgstr ""
|
||||
msgstr "Suppose your scene has a camera that represents a head-mounted display and other cameras."
|
||||
|
||||
#: ../../vrm1/vrm1_firstperson.md:48
|
||||
msgid "FIRSTPERSON_ONLY_LAYER(このレイヤーを指定した gameObject はその他のカメラから消えます)"
|
||||
msgstr ""
|
||||
msgstr "FIRSTPERSON_ONLY_LAYER(The gameObject that specifies this layer disappears from other cameras)"
|
||||
|
||||
#: ../../vrm1/vrm1_firstperson.md:49
|
||||
msgid "THIRDPERSON_ONLY_LAYER(このレイヤーを指定した gameObject はヘッドマウントディスプレイから消えます)"
|
||||
msgstr ""
|
||||
msgstr "THIRDPERSON_ONLY_LAYER(The gameObject that specifies this layer disappears from the head-mounted display)"
|
||||
|
||||
#: ../../vrm1/vrm1_firstperson.md:51
|
||||
msgid "を定義します。 これにより、ヘッドマウント視点のアバターの描画を抑止しつつ、他者からは見えるようにします。"
|
||||
msgstr ""
|
||||
msgstr "Stops drawing the avatar from the head-mounted display perspective and makes it visible to other cameras."
|
||||
|
||||
#: ../../vrm1/vrm1_firstperson.md:54
|
||||
msgid "例: アバターの頭の描画を抑止して前が見えるようにする"
|
||||
msgstr ""
|
||||
msgstr "Example: Stop drawing the avatar's head so you can see the front"
|
||||
|
||||
#: ../../vrm1/vrm1_firstperson.md:56
|
||||
msgid "VRMは、`VRMFirstPersonOnly` と `VRMThirdPersonOnly` という名前のレイヤーを予約しています。"
|
||||
msgstr ""
|
||||
msgstr "VRM reserves layers named `VRMFirstPersonOnly` and` VRMThirdPersonOnly`."
|
||||
|
||||
#: ../../vrm1/vrm1_firstperson.md:58
|
||||
msgid ""
|
||||
"`Project Settings` - `Tags and Layers` に `VRMFirstPersonOnly` と "
|
||||
"`VRMThirdPersonOnly` を 設定してください。 サンプルでは、それぞれに `9` と `10` を割り当ています。"
|
||||
msgstr ""
|
||||
msgstr "Please set `VRMFirstPersonOnly` and` VRMThirdPersonOnly` to `Project Settings`-`Tags and Layers`. In the sample, we assign `9` and` 10` to each."
|
||||
|
||||
#: ../../vrm1/vrm1_firstperson.md:62
|
||||
msgid "初期化時に layer を明示する"
|
||||
msgstr ""
|
||||
msgstr "Specify layer at initialization"
|
||||
|
||||
#: ../../vrm1/vrm1_firstperson.md:64
|
||||
msgid "追加の引数で指定できます。"
|
||||
msgstr ""
|
||||
msgstr "It can be specified with an additional argument."
|
||||
|
||||
|
|
|
|||
|
|
@ -26,9 +26,9 @@ msgstr ""
|
|||
msgid ""
|
||||
"`VRM-1.0` は、 `VRM-0.x` もロードできます。 その場合、あたらしい meta への変換が発生し互換性の無い部分はすべて "
|
||||
"`不許可` の値になります。 このため、変換前のライセンスにアクセスする API を提供します。"
|
||||
msgstr ""
|
||||
msgstr "`VRM-1.0` can load `VRM-0.x`. In that case, incompatible migrated meta properties are not allowed. Therefore, we provide an API that allows you to access the original meta before migration."
|
||||
|
||||
#: ../../vrm1/vrm1_runtime_load.md:7
|
||||
msgid "サンプルの `Assets\\VRM10\\Samples\\VRM10Viewer\\VRM10ViewerUI.cs` も参照してください。"
|
||||
msgstr ""
|
||||
msgstr "See `Assets\VRM10\Samples\VRM10Viewer\VRM10ViewerUI.cs`."
|
||||
|
||||
|
|
|
|||
|
|
@ -75,40 +75,40 @@ Unityで実行時にモデルをインポートする方法です。
|
|||
|
||||
## ファイルパスからVRMを開く
|
||||
|
||||
{{< highlight cs >}}
|
||||
```csharp
|
||||
var path="sample.vrm";
|
||||
var go=VRM.VRMImporter.LoadFromPath(path);
|
||||
Debug.LogFormat("loaded {0}", go.name);
|
||||
{{< / highlight >}}
|
||||
```
|
||||
|
||||
## ファイルパスから非同期にVRMを開く
|
||||
|
||||
{{< highlight cs >}}
|
||||
```csharp
|
||||
var path="sample.vrm";
|
||||
VRMImporter.LoadVrmAsync(path, go => {
|
||||
Debug.LogFormat("loaded {0}", go.name);
|
||||
});
|
||||
{{< / highlight >}}
|
||||
```
|
||||
|
||||
## バイト列からVRM開く
|
||||
|
||||
{{< highlight cs >}}
|
||||
```csharp
|
||||
var path="sample.vrm";
|
||||
var bytes = File.ReadAllBytes(path);
|
||||
var go=VRMImporter.LoadFromBytes(bytes);
|
||||
{{< / highlight >}}
|
||||
```
|
||||
|
||||
## バイト列から非同期にVRMを開く
|
||||
|
||||
{{< highlight cs >}}
|
||||
```csharp
|
||||
VRMImporter.LoadVrmAsync(bytes, go => {
|
||||
Debug.LogFormat("loaded {0}", go.name);
|
||||
});
|
||||
{{< / highlight >}}
|
||||
```
|
||||
|
||||
## VRMから情報を取り出す
|
||||
|
||||
{{< highlight cs >}}
|
||||
```csharp
|
||||
#if UNITY_STANDALONE_WIN
|
||||
var path = FileDialogForWindows.FileDialog("open VRM", ".vrm");
|
||||
#else
|
||||
|
|
@ -151,13 +151,13 @@ VRMImporter.LoadVrmAsync(bytes, go => {
|
|||
VRMImporter.LoadFromBytes(context);
|
||||
OnLoaded(context.Root);
|
||||
}
|
||||
{{< / highlight >}}
|
||||
```
|
||||
|
||||
## Thumbnailを取得する(v0.37から)
|
||||
|
||||
ReadMetaに引数を渡すことでThumbnailテクスチャを作成できます。
|
||||
|
||||
{{< highlight cs >}}
|
||||
```csharp
|
||||
var meta = context.ReadMeta(true); // Thumbnailテクスチャを作成する
|
||||
Texture2D thumbnail=meta.Thumbnail;
|
||||
{{< / highlight >}}
|
||||
```
|
||||
|
|
|
|||
|
|
@ -1,9 +1,18 @@
|
|||
# BlendShapeProxy(0.58)
|
||||
|
||||
## 環境
|
||||
UniVRM v0.58.0
|
||||
## BlendShapeKeyのインタフェースを厳格化、整理
|
||||
|
||||
[BlendShapeKeyのインタフェースを厳格化、整理](https://github.com/vrm-c/UniVRM/wiki/ReleaseNote-v0.56.0%28ja%29#blendshapekey%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%BF%E3%83%95%E3%82%A7%E3%83%BC%E3%82%B9%E3%82%92%E5%8E%B3%E6%A0%BC%E5%8C%96%E6%95%B4%E7%90%86)
|
||||
BlendShapeKeyを作成する方法が不明瞭だったため、
|
||||
より明示的な API に置き換えました。
|
||||
|
||||
* BlendShapeClip.Key 追加
|
||||
|
||||
| arguments | before | after | 備考 |
|
||||
|--------------------------------------|--------------------------|--------------------------------|------------------------------------------------------------------------------------------------------------------------|
|
||||
| string name, BlendShapePreset preset | public constructor | private constructor | BlendShapePreset.Unknownのときの挙動が不明瞭だった。代わりに、CreateFromPreset または CreateUnknown を使用してください |
|
||||
| BlendShapeClip | BlendShapeKey.CreateFrom | BlendShapeKey.CreateFromClip | 他の関数に合わせて、名前を変更 |
|
||||
| BlendShapePreset | public constructor | BlendShapeKey.CreateFromPreset | オーバーロードをやめて明示的な関数に変更 |
|
||||
| string | public constructor | BlendShapeKey.CreateUnknown | オーバーロードをやめて明示的な関数に変更。 |
|
||||
|
||||
## 使用するメソッド
|
||||
|
||||
|
|
@ -17,7 +26,7 @@ UniVRM v0.58.0
|
|||
`SetValues` 関数のみを使用します。
|
||||
そのフレームで必要な表情の weight 値をすべて集めてから `SetValues` を 1 回だけ呼んで設定します。
|
||||
|
||||
{{< highlight cs >}}
|
||||
```csharp
|
||||
var proxy = GetComponent<VRMBlendShapeProxy>();
|
||||
|
||||
proxy.SetValues(new Dictionary<BlendShapeKey, float>
|
||||
|
|
@ -26,7 +35,7 @@ proxy.SetValues(new Dictionary<BlendShapeKey, float>
|
|||
{BlendShapeKey.CreateFromPreset(BlendShapePreset.Joy), 1f}, // システム定義の表情は enum で指定
|
||||
{BlendShapeKey.CreateUnknown("USER_DEFINED_FACIAL"), 1f}, // ユーザ定義の表情は string で指定
|
||||
});
|
||||
{{< / highlight >}}
|
||||
```
|
||||
|
||||
## 複数の BlendShape weight を適用する際の競合の問題について
|
||||
|
||||
|
|
@ -47,31 +56,31 @@ VRMBlendShape `Blink_R`
|
|||
で定義されているとします。
|
||||
このとき両目を閉じたいモチベーションから、両方を有効にする意図で下記のように実行します。
|
||||
|
||||
{{< highlight cs >}}
|
||||
```csharp
|
||||
proxy.ImmediatelySetValue(BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_L), 1.0f);
|
||||
proxy.ImmediatelySetValue(BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_R), 1.0f);
|
||||
{{< / highlight >}}
|
||||
```
|
||||
|
||||
すると、左目だけが開いてしまいます。
|
||||
これは後から `ImmediateSetValue` した `Blink_R` が `Blink_L` と競合して weight を上書きしてしまうからです。
|
||||
したがって VRM の表情制御においては下記の 2 通りのどちらかの方法で書くことが求められます。
|
||||
これらの方法はこの競合の問題を解決して表情を設定することができます。
|
||||
|
||||
{{< highlight cs >}}
|
||||
```csharp
|
||||
proxy.SetValues(new Dictionary<BlendShapeKey, float>
|
||||
{
|
||||
{BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_L), 1.0f},
|
||||
{BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_R), 1.0f},
|
||||
});
|
||||
{{< / highlight >}}
|
||||
```
|
||||
|
||||
または
|
||||
|
||||
{{< highlight cs >}}
|
||||
```csharp
|
||||
proxy.AccumulateValue(BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_L), 1.0f); // すぐに適用せずにたくわえる
|
||||
proxy.AccumulateValue(BlendShapeKey.CreateFromPreset(BlendShapePreset.Blink_R), 1.0f);
|
||||
proxy.Apply(); // 蓄積した値をまとめて適用する
|
||||
{{< / highlight >}}
|
||||
```
|
||||
|
||||
WIP
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
定数で以下のレイヤーを定義しています。
|
||||
|
||||
{{< highlight cs >}}
|
||||
```csharp
|
||||
public class VRMFirstPerson : MonoBehaviour
|
||||
{
|
||||
public const int FIRSTPERSON_ONLY_LAYER = 9;
|
||||
|
|
@ -24,7 +24,7 @@ public class VRMFirstPerson : MonoBehaviour
|
|||
|
||||
// 省略
|
||||
}
|
||||
{{< / highlight >}}
|
||||
```
|
||||
|
||||
|{{< img src="images/vrm/layer_setting.png" >}}|
|
||||
|-----|
|
||||
|
|
@ -35,7 +35,7 @@ public class VRMFirstPerson : MonoBehaviour
|
|||
* VRMFirstPerson.Setupの呼び出し
|
||||
* 一人称カメラとその他のカメラに対してLayerMask
|
||||
|
||||
{{< highlight cs >}}
|
||||
```csharp
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
|
@ -77,4 +77,4 @@ public class SetupExample : MonoBehaviour
|
|||
}
|
||||
}
|
||||
}
|
||||
{{< / highlight >}}
|
||||
```
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user