From a955c35ac30fe034742be95c7ae2845579a1ab24 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Wed, 1 Jul 2020 12:27:58 +0900 Subject: [PATCH 1/2] update m_notSetValueApply default value to true --- .../Scripts/LookAt/VRMLookAtBlendShapeApplyer.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Assets/VRM/UniVRM/Scripts/LookAt/VRMLookAtBlendShapeApplyer.cs b/Assets/VRM/UniVRM/Scripts/LookAt/VRMLookAtBlendShapeApplyer.cs index a859e532a..252fd9350 100644 --- a/Assets/VRM/UniVRM/Scripts/LookAt/VRMLookAtBlendShapeApplyer.cs +++ b/Assets/VRM/UniVRM/Scripts/LookAt/VRMLookAtBlendShapeApplyer.cs @@ -17,8 +17,21 @@ namespace VRM [SerializeField] public CurveMapper VerticalUp = new CurveMapper(90.0f, 1.0f); + /// + /// v0.56 からデフォルト値を true に変更 + /// + /// true の場合: BlendShapeProxy.AccumulateValue を使う(推奨) + /// 別途 BlendShapeProxy.Apply を別の場所で呼び出す必要があります + /// false の場合: BlendShapeProxy.ImmediatelySetValueを使う + /// 目をテクスチャUVのOffset値の変更で表現するモデルの場合に、 + /// Material.SetVector("_MainTex_ST", new Vector4(1, 1, 横の移動値, 0)) + /// Material.SetVector("_MainTex_ST", new Vector4(1, 1, 0, 縦の移動値)) + /// と連続で呼ばれることで、横の移動値が打ち消されてしまいます。 + /// BlendShapeProxy.AccumulateValue はこの値を加算して new Vector4(1, 1, 横の移動値, 縦の移動値) + /// となるように扱えます。 + /// [SerializeField] - public bool m_notSetValueApply; + public bool m_notSetValueApply = true; public void OnImported(VRMImporterContext context) { From ebe0c67a2b4db6a62edc69dd3d3aa301fe3d258c Mon Sep 17 00:00:00 2001 From: ousttrue Date: Wed, 1 Jul 2020 12:32:45 +0900 Subject: [PATCH 2/2] add VRMBlendShapeProxy.Apply --- Assets/VRM.Samples/Scripts/ViewerUI.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Assets/VRM.Samples/Scripts/ViewerUI.cs b/Assets/VRM.Samples/Scripts/ViewerUI.cs index a754a720b..5a1b21c06 100644 --- a/Assets/VRM.Samples/Scripts/ViewerUI.cs +++ b/Assets/VRM.Samples/Scripts/ViewerUI.cs @@ -167,6 +167,7 @@ namespace VRM.Samples } HumanPoseTransfer m_loaded; + VRMBlendShapeProxy m_proxy; AIUEO m_lipSync; bool m_enableLipSyncValue; @@ -235,6 +236,11 @@ namespace VRM.Samples } m_ui.UpdateToggle(EnableBvh, EnableTPose); + + if (m_proxy != null) + { + m_proxy.Apply(); + } } void EnableBvh() @@ -361,6 +367,8 @@ namespace VRM.Samples { animation.Play(animation.clip.name); } + + m_proxy = go.GetComponent(); } }