From a8ad814ac083942a31e7dc75671a3443c4f44b26 Mon Sep 17 00:00:00 2001 From: NotAKidoS <37721153+NotAKidOnSteam@users.noreply.github.com> Date: Sun, 16 Apr 2023 21:21:43 -0500 Subject: [PATCH] useAnimatedBendNormal --- DesktopVRIK/DesktopVRIKSystem.cs | 7 ++++++- DesktopVRIK/HarmonyPatches.cs | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/DesktopVRIK/DesktopVRIKSystem.cs b/DesktopVRIK/DesktopVRIKSystem.cs index 7c25cd4..b879af9 100644 --- a/DesktopVRIK/DesktopVRIKSystem.cs +++ b/DesktopVRIK/DesktopVRIKSystem.cs @@ -200,7 +200,7 @@ internal class DesktopVRIKSystem : MonoBehaviour DesktopVRIKMod.UpdateAllSettings(); } - + void Update() { if (avatarVRIK == null) return; @@ -283,6 +283,9 @@ internal class DesktopVRIKSystem : MonoBehaviour avatarIKSolver.IKPositionWeight = BodySystem.TrackingPositionWeight; avatarIKSolver.locomotion.weight = _locomotionWeight; + bool useAnimatedBendNormal = _locomotionWeight <= 0f; + avatarIKSolver.leftLeg.useAnimatedBendNormal = useAnimatedBendNormal; + avatarIKSolver.rightLeg.useAnimatedBendNormal = useAnimatedBendNormal; SetArmWeight(avatarIKSolver.leftArm, BodySystem.TrackingLeftArmEnabled && avatarIKSolver.leftArm.target != null); SetArmWeight(avatarIKSolver.rightArm, BodySystem.TrackingRightArmEnabled && avatarIKSolver.rightArm.target != null); SetLegWeight(avatarIKSolver.leftLeg, BodySystem.TrackingLeftLegEnabled && avatarIKSolver.leftLeg.target != null); @@ -294,6 +297,8 @@ internal class DesktopVRIKSystem : MonoBehaviour avatarIKSolver.IKPositionWeight = 0f; avatarIKSolver.locomotion.weight = 0f; + avatarIKSolver.leftLeg.useAnimatedBendNormal = false; + avatarIKSolver.rightLeg.useAnimatedBendNormal = false; SetArmWeight(avatarIKSolver.leftArm, false); SetArmWeight(avatarIKSolver.rightArm, false); SetLegWeight(avatarIKSolver.leftLeg, false); diff --git a/DesktopVRIK/HarmonyPatches.cs b/DesktopVRIK/HarmonyPatches.cs index a72b331..69bf391 100644 --- a/DesktopVRIK/HarmonyPatches.cs +++ b/DesktopVRIK/HarmonyPatches.cs @@ -15,6 +15,10 @@ using UnityEngine; Freddy (gmod)- Doesn't have any fingers, wristToPalmAxis & palmToThumbAxis needed to be set manually. Small Cheese- Emotes are angled wrong due to maxRootAngle..??? + Custom knee bend normal is needed for avatars that scale incredibly small. Using animated knee bend will cause + knees to bend in completely wrong directions. We turn it off though when in crouch/prone, as it can bleed + into animations. + Most other avatars play just fine. **/