From 24849e25cab12019638c3ed321b838b931cd52d8 Mon Sep 17 00:00:00 2001 From: SDraw Date: Sun, 2 Oct 2022 02:25:51 +0300 Subject: [PATCH] Fixes for build 2022r169 --- README.md | 10 ++++----- ml_amt/Main.cs | 13 ++++++------ ml_amt/MotionTweaker.cs | 2 +- ml_amt/Properties/AssemblyInfo.cs | 6 +++--- ml_dht/FaceTracked.cs | 2 +- ml_dht/Main.cs | 10 ++++----- ml_dht/Properties/AssemblyInfo.cs | 6 +++--- ml_dht/README.md | 3 --- ml_fpt/Main.cs | 34 +++++++++++++++---------------- ml_fpt/Properties/AssemblyInfo.cs | 6 +++--- 10 files changed, 44 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index 10588c3..56c2065 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ Merged set of MelonLoader mods for ChilloutVR. -**State table for game build 2022r168p2:** +**State table for game build 2022r169:** | Full name | Short name | Latest version | Available in [CVRMA](https://github.com/knah/CVRMelonAssistant) | Current Status | Notes | |-----------|------------|----------------|-----------------------------------------------------------------|----------------|-------| | Avatar Change Info | ml_aci | 1.0.2 | Yes | Working | -| Avatar Motion Tweaker | ml_amt | 1.1.0 | Yes | Working | -| Desktop Head Tracking | ml_dht | 1.0.2 | Yes | Working | +| Avatar Motion Tweaker | ml_amt | 1.1.1 | On review | Working | +| Desktop Head Tracking | ml_dht | 1.0.3 | On review | Working | | Desktop Reticle Switch | ml_drs | 1.0.0 | Yes | Working | -| Four Point Tracking | ml_fpt | 1.0.6 | Yes | Working | -| Leap Motion Extension | ml_lme | 1.1.8 | Yes | Working | +| Four Point Tracking | ml_fpt | 1.0.7 | On review | Working | +| Leap Motion Extension | ml_lme | 1.1.8 | Yes | Working partially | No tracking in VR | | Server Connection Info | ml_sci | 1.0.1 | Yes | Working | diff --git a/ml_amt/Main.cs b/ml_amt/Main.cs index a95dc0e..eba1fab 100644 --- a/ml_amt/Main.cs +++ b/ml_amt/Main.cs @@ -10,7 +10,8 @@ namespace ml_amt public override void OnApplicationStart() { - ms_instance = this; + if(ms_instance == null) + ms_instance = this; Settings.Init(); Settings.IKOverrideCrouchChange += this.OnIKOverrideCrouchChange; @@ -27,9 +28,9 @@ namespace ml_amt new HarmonyLib.HarmonyMethod(typeof(AvatarMotionTweaker).GetMethod(nameof(OnAvatarClear_Postfix), System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static)) ); HarmonyInstance.Patch( - typeof(PlayerSetup).GetMethod("SetupAvatarGeneral", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic), + typeof(PlayerSetup).GetMethod(nameof(PlayerSetup.CalibrateAvatar)), null, - new HarmonyLib.HarmonyMethod(typeof(AvatarMotionTweaker).GetMethod(nameof(OnSetupAvatarGeneral_Postfix), System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic)) + new HarmonyLib.HarmonyMethod(typeof(AvatarMotionTweaker).GetMethod(nameof(OnCalibrateAvatar_Postfix), System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic)) ); MelonLoader.MelonCoroutines.Start(WaitForLocalPlayer()); @@ -100,13 +101,13 @@ namespace ml_amt } } - static void OnSetupAvatarGeneral_Postfix() => ms_instance?.OnSetupAvatarGeneral(); - void OnSetupAvatarGeneral() + static void OnCalibrateAvatar_Postfix() => ms_instance?.OnCalibrateAvatar(); + void OnCalibrateAvatar() { try { if(m_localTweaker != null) - m_localTweaker.OnSetupAvatarGeneral(); + m_localTweaker.OnCalibrateAvatar(); } catch(System.Exception l_exception) { diff --git a/ml_amt/MotionTweaker.cs b/ml_amt/MotionTweaker.cs index 3e59cf5..91b204d 100644 --- a/ml_amt/MotionTweaker.cs +++ b/ml_amt/MotionTweaker.cs @@ -168,7 +168,7 @@ namespace ml_amt m_parameters.Clear(); } - public void OnSetupAvatarGeneral() + public void OnCalibrateAvatar() { m_vrIk = PlayerSetup.Instance._avatar.GetComponent(); diff --git a/ml_amt/Properties/AssemblyInfo.cs b/ml_amt/Properties/AssemblyInfo.cs index 4649714..a7e9775 100644 --- a/ml_amt/Properties/AssemblyInfo.cs +++ b/ml_amt/Properties/AssemblyInfo.cs @@ -1,10 +1,10 @@ using System.Reflection; [assembly: AssemblyTitle("AvatarMotionTweaker")] -[assembly: AssemblyVersion("1.1.0")] -[assembly: AssemblyFileVersion("1.1.0")] +[assembly: AssemblyVersion("1.1.1")] +[assembly: AssemblyFileVersion("1.1.1")] -[assembly: MelonLoader.MelonInfo(typeof(ml_amt.AvatarMotionTweaker), "AvatarMotionTweaker", "1.1.0", "SDraw", "https://github.com/SDraw/ml_mods_cvr")] +[assembly: MelonLoader.MelonInfo(typeof(ml_amt.AvatarMotionTweaker), "AvatarMotionTweaker", "1.1.1", "SDraw", "https://github.com/SDraw/ml_mods_cvr")] [assembly: MelonLoader.MelonGame(null, "ChilloutVR")] [assembly: MelonLoader.MelonPlatform(MelonLoader.MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)] [assembly: MelonLoader.MelonPlatformDomain(MelonLoader.MelonPlatformDomainAttribute.CompatibleDomains.MONO)] \ No newline at end of file diff --git a/ml_dht/FaceTracked.cs b/ml_dht/FaceTracked.cs index 2373f3c..7ce29c6 100644 --- a/ml_dht/FaceTracked.cs +++ b/ml_dht/FaceTracked.cs @@ -93,7 +93,7 @@ namespace ml_dht } } - public void OnSetupAvatarGeneral() + public void OnCalibrateAvatar() { m_avatarDescriptior = PlayerSetup.Instance._avatar.GetComponent(); m_headBone = PlayerSetup.Instance._animator.GetBoneTransform(HumanBodyBones.Head); diff --git a/ml_dht/Main.cs b/ml_dht/Main.cs index e1c30a2..549c227 100644 --- a/ml_dht/Main.cs +++ b/ml_dht/Main.cs @@ -36,9 +36,9 @@ namespace ml_dht new HarmonyLib.HarmonyMethod(typeof(DesktopHeadTracking).GetMethod(nameof(OnAvatarClear_Postfix), System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic)) ); HarmonyInstance.Patch( - typeof(PlayerSetup).GetMethod("SetupAvatarGeneral", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic), + typeof(PlayerSetup).GetMethod(nameof(PlayerSetup.CalibrateAvatar)), null, - new HarmonyLib.HarmonyMethod(typeof(DesktopHeadTracking).GetMethod(nameof(OnSetupAvatarGeneral_Postfix), System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic)) + new HarmonyLib.HarmonyMethod(typeof(DesktopHeadTracking).GetMethod(nameof(OnCalibrateAvatar_Postfix), System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic)) ); HarmonyInstance.Patch( typeof(CVREyeController).GetMethod("Update", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic), @@ -96,13 +96,13 @@ namespace ml_dht m_localTracked.SetFaceOverride(p_state); } - static void OnSetupAvatarGeneral_Postfix() => ms_instance?.OnSetupAvatarGeneral(); - void OnSetupAvatarGeneral() + static void OnCalibrateAvatar_Postfix() => ms_instance?.OnCalibrateAvatar(); + void OnCalibrateAvatar() { try { if(m_localTracked != null) - m_localTracked.OnSetupAvatarGeneral(); + m_localTracked.OnCalibrateAvatar(); } catch(System.Exception e) { diff --git a/ml_dht/Properties/AssemblyInfo.cs b/ml_dht/Properties/AssemblyInfo.cs index a1ab7a9..3de679d 100644 --- a/ml_dht/Properties/AssemblyInfo.cs +++ b/ml_dht/Properties/AssemblyInfo.cs @@ -1,10 +1,10 @@ using System.Reflection; [assembly: AssemblyTitle("DesktopHeadTracking")] -[assembly: AssemblyVersion("1.0.2")] -[assembly: AssemblyFileVersion("1.0.2")] +[assembly: AssemblyVersion("1.0.3")] +[assembly: AssemblyFileVersion("1.0.3")] -[assembly: MelonLoader.MelonInfo(typeof(ml_dht.DesktopHeadTracking), "DesktopHeadTracking", "1.0.2", "SDraw", "https://github.com/SDraw/ml_mods_cvr")] +[assembly: MelonLoader.MelonInfo(typeof(ml_dht.DesktopHeadTracking), "DesktopHeadTracking", "1.0.3", "SDraw", "https://github.com/SDraw/ml_mods_cvr")] [assembly: MelonLoader.MelonGame(null, "ChilloutVR")] [assembly: MelonLoader.MelonPlatform(MelonLoader.MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)] [assembly: MelonLoader.MelonPlatformDomain(MelonLoader.MelonPlatformDomainAttribute.CompatibleDomains.MONO)] \ No newline at end of file diff --git a/ml_dht/README.md b/ml_dht/README.md index b670375..0b33aad 100644 --- a/ml_dht/README.md +++ b/ml_dht/README.md @@ -24,6 +24,3 @@ Available mod's settings in `Settings - Implementation - Desktop Head Tracking`: # Known compatible tracking software * [VSeeFace](https://www.vseeface.icu) with [Tracking Data Parser mod](https://github.com/SDraw/ml_mods_vsf) - -# Notes -* Blinking doesn't work for remote players due to [game's bug](https://feedback.abinteractive.net/p/overrided-blinking-state-isn-t-copied-to-movement-data-from-network). diff --git a/ml_fpt/Main.cs b/ml_fpt/Main.cs index 26bf8a4..a660771 100644 --- a/ml_fpt/Main.cs +++ b/ml_fpt/Main.cs @@ -3,6 +3,8 @@ using ABI_RC.Core.InteractionSystem; using ABI_RC.Core.Player; using ABI_RC.Core.Savior; using ABI_RC.Core.UI; +using ABI_RC.Systems.IK; +using ABI_RC.Systems.IK.SubSystems; using System.Collections.Generic; using UnityEngine; @@ -15,7 +17,6 @@ namespace ml_fpt bool m_ready = false; IndexIK m_indexIk = null; - CVR_IK_Calibrator m_ikCalibrator = null; RootMotion.FinalIK.VRIK m_vrIK = null; RuntimeAnimatorController m_runtimeAnimator = null; List m_aasParameters = null; @@ -30,7 +31,8 @@ namespace ml_fpt public override void OnApplicationStart() { - ms_instance = this; + if(ms_instance == null) + ms_instance = this; m_avatarCalibrations = new Dictionary>(); @@ -40,9 +42,9 @@ namespace ml_fpt new HarmonyLib.HarmonyMethod(typeof(FourPointTracking).GetMethod(nameof(OnAvatarClear_Postfix), System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static)) ); HarmonyInstance.Patch( - typeof(PlayerSetup).GetMethod("SetupAvatarGeneral", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic), + typeof(PlayerSetup).GetMethod(nameof(PlayerSetup.CalibrateAvatar)), null, - new HarmonyLib.HarmonyMethod(typeof(FourPointTracking).GetMethod(nameof(OnSetupAvatarGeneral_Postfix), System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic)) + new HarmonyLib.HarmonyMethod(typeof(FourPointTracking).GetMethod(nameof(OnCalibrateAvatar_Postfix), System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic)) ); MelonLoader.MelonCoroutines.Start(WaitForMainMenuView()); @@ -75,14 +77,13 @@ namespace ml_fpt yield return null; m_indexIk = PlayerSetup.Instance.gameObject.GetComponent(); - m_ikCalibrator = PlayerSetup.Instance.gameObject.GetComponent(); m_ready = true; } void StartCalibration() { - if(m_ready && !m_calibrationActive && PlayerSetup.Instance._inVr && !PlayerSetup.Instance.avatarIsLoading && PlayerSetup.Instance._animator.isHuman && !m_ikCalibrator.inFullbodyCalibration && !m_ikCalibrator.avatarCalibratedAsFullBody) + if(m_ready && !m_calibrationActive && PlayerSetup.Instance._inVr && !PlayerSetup.Instance.avatarIsLoading && PlayerSetup.Instance._animator.isHuman && !BodySystem.isCalibrating && !BodySystem.isCalibratedAsFullBody) { m_hipsTrackerIndex = GetHipsTracker(); if(m_hipsTrackerIndex != -1) @@ -100,8 +101,8 @@ namespace ml_fpt if(m_vrIK != null) m_vrIK.solver.OnPreUpdate += this.OverrideIKWeight; - m_ikCalibrator.leftHandModel.SetActive(true); - m_ikCalibrator.rightHandModel.SetActive(true); + IKSystem.Instance.leftHandModel.SetActive(true); + IKSystem.Instance.rightHandModel.SetActive(true); PlayerSetup.Instance._trackerManager.trackers[m_hipsTrackerIndex].ShowTracker(true); CVR_InteractableManager.enableInteractions = false; @@ -125,7 +126,6 @@ namespace ml_fpt if(m_vrIK != null) m_vrIK.enabled = false; - m_ikCalibrator.enabled = false; m_indexIk.enabled = false; PlayerSetup.Instance._trackerManager.trackers[m_hipsTrackerIndex].ShowLine(true, m_hips); @@ -154,7 +154,6 @@ namespace ml_fpt } m_indexIk.enabled = true; - m_ikCalibrator.enabled = true; PlayerSetup.Instance._animator.runtimeAnimatorController = m_runtimeAnimator; PlayerSetup.Instance.animatorManager.SetAnimator(PlayerSetup.Instance._animator, m_runtimeAnimator); @@ -166,8 +165,8 @@ namespace ml_fpt } } - m_ikCalibrator.leftHandModel.SetActive(false); - m_ikCalibrator.rightHandModel.SetActive(false); + IKSystem.Instance.leftHandModel.SetActive(false); + IKSystem.Instance.rightHandModel.SetActive(false); PlayerSetup.Instance._trackerManager.trackers[m_hipsTrackerIndex].ShowTracker(false); PlayerSetup.Instance._trackerManager.trackers[m_hipsTrackerIndex].ShowLine(false); CVR_InteractableManager.enableInteractions = true; @@ -213,10 +212,9 @@ namespace ml_fpt MelonLoader.MelonCoroutines.Stop(m_calibrationTask); m_indexIk.enabled = true; - m_ikCalibrator.enabled = true; - m_ikCalibrator.leftHandModel.SetActive(false); - m_ikCalibrator.rightHandModel.SetActive(false); + IKSystem.Instance.leftHandModel.SetActive(false); + IKSystem.Instance.rightHandModel.SetActive(false); if(m_hipsTrackerIndex != -1) { @@ -236,12 +234,12 @@ namespace ml_fpt } } - static void OnSetupAvatarGeneral_Postfix() => ms_instance?.OnSetupAvatarGeneral(); - void OnSetupAvatarGeneral() + static void OnCalibrateAvatar_Postfix() => ms_instance?.OnCalibrateAvatar(); + void OnCalibrateAvatar() { try { - if(m_ready && PlayerSetup.Instance._inVr && PlayerSetup.Instance._animator.isHuman && !m_ikCalibrator.avatarCalibratedAsFullBody) + if(m_ready && PlayerSetup.Instance._inVr && PlayerSetup.Instance._animator.isHuman && !VRTrackerManager.Instance.CheckFullBody()) { int l_hipsTracker = GetHipsTracker(); if((l_hipsTracker != -1) && m_avatarCalibrations.TryGetValue(MetaPort.Instance.currentAvatarGuid, out var l_stored)) diff --git a/ml_fpt/Properties/AssemblyInfo.cs b/ml_fpt/Properties/AssemblyInfo.cs index 4d1a158..65b5525 100644 --- a/ml_fpt/Properties/AssemblyInfo.cs +++ b/ml_fpt/Properties/AssemblyInfo.cs @@ -1,10 +1,10 @@ using System.Reflection; [assembly: AssemblyTitle("FourPointTracking")] -[assembly: AssemblyVersion("1.0.6")] -[assembly: AssemblyFileVersion("1.0.6")] +[assembly: AssemblyVersion("1.0.7")] +[assembly: AssemblyFileVersion("1.0.7")] -[assembly: MelonLoader.MelonInfo(typeof(ml_fpt.FourPointTracking), "FourPointTracking", "1.0.6", "SDraw", "https://github.com/SDraw/ml_mods_cvr")] +[assembly: MelonLoader.MelonInfo(typeof(ml_fpt.FourPointTracking), "FourPointTracking", "1.0.7", "SDraw", "https://github.com/SDraw/ml_mods_cvr")] [assembly: MelonLoader.MelonGame(null, "ChilloutVR")] [assembly: MelonLoader.MelonPlatform(MelonLoader.MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)] [assembly: MelonLoader.MelonPlatformDomain(MelonLoader.MelonPlatformDomainAttribute.CompatibleDomains.MONO)] \ No newline at end of file