From 58e26ed07dca6e7cb85464b72c2206cfc9706ce5 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 2 Jun 2020 20:33:12 +0900 Subject: [PATCH] comment --- .../UniVRM/Editor/Format/VRMExportSettings.cs | 60 ++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/Assets/VRM/UniVRM/Editor/Format/VRMExportSettings.cs b/Assets/VRM/UniVRM/Editor/Format/VRMExportSettings.cs index c6ffe529d..2d8d3fa3b 100644 --- a/Assets/VRM/UniVRM/Editor/Format/VRMExportSettings.cs +++ b/Assets/VRM/UniVRM/Editor/Format/VRMExportSettings.cs @@ -10,28 +10,67 @@ namespace VRM [Serializable] public class VRMExportSettings { + /// + /// エクスポート対象 + /// public GameObject Source; + #region Meta + /// + /// エクスポート名 + /// public string Title; + /// + /// エクスポートバージョン(エクスポートするModelのバージョン) + /// public string Version; + /// + /// 作者 + /// public string Author; + /// + /// 作者連絡先 + /// public string ContactInformation; + /// + /// 作品引用 + /// public string Reference; + #endregion + #region Settings + /// + /// エクスポート時に強制的にT-Pose化する + /// public bool ForceTPose = true; + /// + /// エクスポート時にヒエラルキーの正規化を実施する + /// public bool PoseFreeze = true; + /// + /// エクスポート時に新しいJsonSerializerを使う + /// public bool UseExperimentalExporter = false; + /// + /// エクスポート時にBlendShapeを削減する + /// public bool ReduceBlendshapeSize = false; + #endregion public struct Validation { + /// + /// エクスポート可能か否か。 + /// true のメッセージは警告 + /// false のメッセージはエラー + /// public readonly bool CanExport; public readonly String Message; @@ -52,7 +91,10 @@ namespace VRM } } - //ここで重複ボーン名のチェックをする + /// + /// ボーン名の重複を確認 + /// + /// bool DuplicateBoneNameExists() { var bones = Source.transform.Traverse().ToArray(); @@ -64,6 +106,10 @@ namespace VRM return (duplicates.Any()); } + /// + /// エクスポート可能か検証する + /// + /// public IEnumerable Validate() { if (Source == null) @@ -150,23 +196,35 @@ namespace VRM } } + /// + /// 対象のモデルからMeta情報を取得し、エクスポート設定を初期する + /// + /// public void InitializeFrom(GameObject go) { if (Source == go) return; Source = go; + // + // initialize + // var desc = Source == null ? null : go.GetComponent(); if (desc == null) { + // 初回のVRMエクスポートとみなす ForceTPose = true; PoseFreeze = true; } else { + // すでに正規化済みとみなす ForceTPose = false; PoseFreeze = false; } + // + // Meta + // var meta = Source == null ? null : go.GetComponent(); if (meta != null && meta.Meta != null) {