From 4e1806078661e3d0798fa4ea4ab2495439eda05d Mon Sep 17 00:00:00 2001 From: ousttrue Date: Thu, 26 Oct 2023 15:03:53 +0900 Subject: [PATCH] add ForceUniqueName. not implemented --- .../MeshUtility/Vrm10MeshUtilityDialog.cs | 7 ++++--- .../Runtime/MeshUtility/Vrm10MeshUtility.cs | 20 +++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/Assets/VRM10/Editor/MeshUtility/Vrm10MeshUtilityDialog.cs b/Assets/VRM10/Editor/MeshUtility/Vrm10MeshUtilityDialog.cs index 2b485805b..a7a58bcd9 100644 --- a/Assets/VRM10/Editor/MeshUtility/Vrm10MeshUtilityDialog.cs +++ b/Assets/VRM10/Editor/MeshUtility/Vrm10MeshUtilityDialog.cs @@ -80,7 +80,7 @@ namespace UniVRM10 { case Tabs.MeshFreeze: { - if (MeshBakeGui()) + if (MeshFreezeGui()) { modified = true; } @@ -135,12 +135,13 @@ namespace UniVRM10 return true; } - bool MeshBakeGui() + bool MeshFreezeGui() { + var forceUniqueName = ToggleIsModified("ForceUniqueName", ref _meshUtility.ForceUniqueName); var blendShape = ToggleIsModified("BlendShape", ref _meshUtility.FreezeBlendShape); var scale = ToggleIsModified("Scale", ref _meshUtility.FreezeScaling); var rotation = ToggleIsModified("Rotation", ref _meshUtility.FreezeRotation); - return blendShape || scale || rotation; + return forceUniqueName || blendShape || scale || rotation; } bool MeshIntegrateGui() diff --git a/Assets/VRM10/Runtime/MeshUtility/Vrm10MeshUtility.cs b/Assets/VRM10/Runtime/MeshUtility/Vrm10MeshUtility.cs index 883bfc674..e6df1aaad 100644 --- a/Assets/VRM10/Runtime/MeshUtility/Vrm10MeshUtility.cs +++ b/Assets/VRM10/Runtime/MeshUtility/Vrm10MeshUtility.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using System.Linq; using UniGLTF.MeshUtility; @@ -17,6 +18,12 @@ namespace UniVRM10 /// public class Vrm10MeshUtility { + /// + /// GameObject 名が重複している場合にリネームする。 + /// 最初に実行(Avatar生成時のエラーを回避?) + /// + public bool ForceUniqueName = false; + /// /// Same as VRM-0 normalization /// - Mesh @@ -124,6 +131,11 @@ namespace UniVRM10 { // TODO: UNDO + if (ForceUniqueName) + { + throw new NotImplementedException(); + } + // 正規化されたヒエラルキーを作る var (normalized, boneMap) = BoneNormalizer.CreateNormalizedHierarchy(go, removeScaling: FreezeScaling, @@ -138,6 +150,14 @@ namespace UniVRM10 newAnimator.avatar = newAvatar; // TODO: write back normalized transform to boneMap + + foreach (var group in MeshIntegrationGroups) + { + foreach (var renderer in group.Renderers) + { + + } + } } } }