From c6b51e12683455befdfc831abde8ec409d4604fc Mon Sep 17 00:00:00 2001 From: ousttrue Date: Thu, 19 May 2022 12:54:59 +0900 Subject: [PATCH 1/2] impl unknown + surprised migration. --- .../Migration/MigrationVrmExpression.cs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Assets/VRM10/Runtime/Migration/MigrationVrmExpression.cs b/Assets/VRM10/Runtime/Migration/MigrationVrmExpression.cs index 3352b1d72..89ee2e43b 100644 --- a/Assets/VRM10/Runtime/Migration/MigrationVrmExpression.cs +++ b/Assets/VRM10/Runtime/Migration/MigrationVrmExpression.cs @@ -27,6 +27,12 @@ namespace UniVRM10 // Preset が unknown で Name が Joy の表情があったときに // それは Preset が Joy であるとみなしてロードしていた。 src = name.ToLowerInvariant(); + + if (src == "surprised") + { + // unknown + surprised を preset に昇格 + return ExpressionPreset.surprised; + } } switch (src) @@ -163,8 +169,8 @@ namespace UniVRM10 expression.TextureTransformBinds.Add(new UniGLTF.Extensions.VRMC_vrm.TextureTransformBind { Material = materialIndex, - Scale = new float[] {scale.x, scale.y}, - Offset = new float[] {offset.x, offset.y} + Scale = new float[] { scale.x, scale.y }, + Offset = new float[] { offset.x, offset.y } }); } } @@ -180,8 +186,8 @@ namespace UniVRM10 expression.TextureTransformBinds.Add(new UniGLTF.Extensions.VRMC_vrm.TextureTransformBind { Material = materialIndex, - Scale = new float[] {scale.x, scale.y}, - Offset = new float[] {offset.x, offset.y} + Scale = new float[] { scale.x, scale.y }, + Offset = new float[] { offset.x, offset.y } }); } } @@ -197,8 +203,8 @@ namespace UniVRM10 expression.TextureTransformBinds.Add(new UniGLTF.Extensions.VRMC_vrm.TextureTransformBind { Material = materialIndex, - Scale = new float[] {scale.x, scale.y}, - Offset = new float[] {offset.x, offset.y} + Scale = new float[] { scale.x, scale.y }, + Offset = new float[] { offset.x, offset.y } }); } } From 66586bdbe2bd64e294ce1b84773f00b0999f3c20 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Thu, 19 May 2022 13:02:34 +0900 Subject: [PATCH 2/2] =?UTF-8?q?switch=20=E6=96=87=E3=81=AB=E7=A7=BB?= =?UTF-8?q?=E5=8B=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/VRM10/Runtime/Migration/MigrationVrmExpression.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Assets/VRM10/Runtime/Migration/MigrationVrmExpression.cs b/Assets/VRM10/Runtime/Migration/MigrationVrmExpression.cs index 89ee2e43b..649ebe035 100644 --- a/Assets/VRM10/Runtime/Migration/MigrationVrmExpression.cs +++ b/Assets/VRM10/Runtime/Migration/MigrationVrmExpression.cs @@ -27,12 +27,6 @@ namespace UniVRM10 // Preset が unknown で Name が Joy の表情があったときに // それは Preset が Joy であるとみなしてロードしていた。 src = name.ToLowerInvariant(); - - if (src == "surprised") - { - // unknown + surprised を preset に昇格 - return ExpressionPreset.surprised; - } } switch (src) @@ -56,6 +50,7 @@ namespace UniVRM10 case "angry": return ExpressionPreset.angry; case "sorrow": return ExpressionPreset.sad; case "fun": return ExpressionPreset.relaxed; + case "surprised": return ExpressionPreset.surprised; case "lookup": return ExpressionPreset.lookUp; case "lookdown": return ExpressionPreset.lookDown;