add ForceUniqueName. not implemented

This commit is contained in:
ousttrue 2023-10-26 15:03:53 +09:00
parent 787dada27e
commit 4e18060786
2 changed files with 24 additions and 3 deletions

View File

@ -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()

View File

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using UniGLTF.MeshUtility;
@ -17,6 +18,12 @@ namespace UniVRM10
/// </summary>
public class Vrm10MeshUtility
{
/// <summary>
/// GameObject 名が重複している場合にリネームする。
/// 最初に実行(Avatar生成時のエラーを回避)
/// </summary>
public bool ForceUniqueName = false;
/// <summary>
/// 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)
{
}
}
}
}
}