From 01a833f46d376ef1b47d760ea33877e66116ad03 Mon Sep 17 00:00:00 2001 From: SDraw Date: Sun, 17 Aug 2025 09:37:39 +0300 Subject: [PATCH 1/2] Fix for PuppetMaster 1.4 Archived DesktopHeadTracking and ViveEyeTracking --- .../ml_dht}/.github/img_01.png | Bin {ml_dht => archived/ml_dht}/DataParser.cs | 58 +- {ml_dht => archived/ml_dht}/GameEvents.cs | 0 {ml_dht => archived/ml_dht}/HeadTracked.cs | 504 +++++++++--------- {ml_dht => archived/ml_dht}/Main.cs | 78 +-- .../ml_dht}/MemoryMapReader.cs | 0 .../ml_dht}/Properties/AssemblyInfo.cs | 6 +- {ml_dht => archived/ml_dht}/README.md | 0 .../ml_dht}/ResourcesHandler.cs | 0 {ml_dht => archived/ml_dht}/Settings.cs | 0 {ml_dht => archived/ml_dht}/TrackingData.cs | 0 {ml_dht => archived/ml_dht}/Utils.cs | 40 +- {ml_dht => archived/ml_dht}/ml_dht.csproj | 170 +++--- .../ml_dht}/resources/mod_menu.js | 0 {ml_vet => archived/ml_vet}/Main.cs | 0 .../ml_vet}/Properties/AssemblyInfo.cs | 0 {ml_vet => archived/ml_vet}/README.md | 0 .../ml_vet}/ResourcesHandler.cs | 0 {ml_vet => archived/ml_vet}/Settings.cs | 0 {ml_vet => archived/ml_vet}/Utils.cs | 0 {ml_vet => archived/ml_vet}/ml_vet.csproj | 0 .../ml_vet}/resources/mod_menu.js | 0 ml_mods_cvr.sln | 14 +- ml_prm/RagdollController.cs | 1 + 24 files changed, 430 insertions(+), 441 deletions(-) rename {ml_dht => archived/ml_dht}/.github/img_01.png (100%) rename {ml_dht => archived/ml_dht}/DataParser.cs (96%) rename {ml_dht => archived/ml_dht}/GameEvents.cs (100%) rename {ml_dht => archived/ml_dht}/HeadTracked.cs (97%) rename {ml_dht => archived/ml_dht}/Main.cs (96%) rename {ml_dht => archived/ml_dht}/MemoryMapReader.cs (100%) rename {ml_dht => archived/ml_dht}/Properties/AssemblyInfo.cs (99%) rename {ml_dht => archived/ml_dht}/README.md (100%) rename {ml_dht => archived/ml_dht}/ResourcesHandler.cs (100%) rename {ml_dht => archived/ml_dht}/Settings.cs (100%) rename {ml_dht => archived/ml_dht}/TrackingData.cs (100%) rename {ml_dht => archived/ml_dht}/Utils.cs (97%) rename {ml_dht => archived/ml_dht}/ml_dht.csproj (97%) rename {ml_dht => archived/ml_dht}/resources/mod_menu.js (100%) rename {ml_vet => archived/ml_vet}/Main.cs (100%) rename {ml_vet => archived/ml_vet}/Properties/AssemblyInfo.cs (100%) rename {ml_vet => archived/ml_vet}/README.md (100%) rename {ml_vet => archived/ml_vet}/ResourcesHandler.cs (100%) rename {ml_vet => archived/ml_vet}/Settings.cs (100%) rename {ml_vet => archived/ml_vet}/Utils.cs (100%) rename {ml_vet => archived/ml_vet}/ml_vet.csproj (100%) rename {ml_vet => archived/ml_vet}/resources/mod_menu.js (100%) diff --git a/ml_dht/.github/img_01.png b/archived/ml_dht/.github/img_01.png similarity index 100% rename from ml_dht/.github/img_01.png rename to archived/ml_dht/.github/img_01.png diff --git a/ml_dht/DataParser.cs b/archived/ml_dht/DataParser.cs similarity index 96% rename from ml_dht/DataParser.cs rename to archived/ml_dht/DataParser.cs index a1844ed..abcceaf 100644 --- a/ml_dht/DataParser.cs +++ b/archived/ml_dht/DataParser.cs @@ -1,29 +1,29 @@ -namespace ml_dht -{ - class DataParser - { - MemoryMapReader m_mapReader = null; - byte[] m_buffer = null; - TrackingData m_trackingData; - - public DataParser() - { - m_buffer = new byte[1024]; - m_mapReader = new MemoryMapReader(); - m_mapReader.Open("head/data"); - } - ~DataParser() - { - m_mapReader.Close(); - m_mapReader = null; - } - - public void Update() - { - if(m_mapReader.Read(ref m_buffer)) - m_trackingData = TrackingData.ToObject(m_buffer); - } - - public ref TrackingData GetLatestTrackingData() => ref m_trackingData; - } -} +namespace ml_dht +{ + class DataParser + { + MemoryMapReader m_mapReader = null; + byte[] m_buffer = null; + TrackingData m_trackingData; + + public DataParser() + { + m_buffer = new byte[1024]; + m_mapReader = new MemoryMapReader(); + m_mapReader.Open("head/data"); + } + ~DataParser() + { + m_mapReader.Close(); + m_mapReader = null; + } + + public void Update() + { + if(m_mapReader.Read(ref m_buffer)) + m_trackingData = TrackingData.ToObject(m_buffer); + } + + public ref TrackingData GetLatestTrackingData() => ref m_trackingData; + } +} diff --git a/ml_dht/GameEvents.cs b/archived/ml_dht/GameEvents.cs similarity index 100% rename from ml_dht/GameEvents.cs rename to archived/ml_dht/GameEvents.cs diff --git a/ml_dht/HeadTracked.cs b/archived/ml_dht/HeadTracked.cs similarity index 97% rename from ml_dht/HeadTracked.cs rename to archived/ml_dht/HeadTracked.cs index 858241d..bab2d2c 100644 --- a/ml_dht/HeadTracked.cs +++ b/archived/ml_dht/HeadTracked.cs @@ -1,252 +1,252 @@ -using ABI.CCK.Components; -using ABI_RC.Core.Player; -using ABI_RC.Core.Player.EyeMovement; -using ABI_RC.Systems.FaceTracking; -using ABI_RC.Systems.GameEventSystem; -using ABI_RC.Systems.IK; -using ABI_RC.Systems.VRModeSwitch; -using RootMotion.FinalIK; -using System; -using UnityEngine; -using ViveSR.anipal.Lip; - -namespace ml_dht -{ - [DisallowMultipleComponent] - class HeadTracked : MonoBehaviour - { - static HeadTracked ms_instance = null; - - CVRAvatar m_avatarDescriptor = null; - Transform m_camera = null; - LookAtIK m_lookIK = null; - Transform m_headBone = null; - - Vector3 m_headPosition; - Quaternion m_headRotation; - Vector2 m_gazeDirection; - float m_blinkProgress = 0f; - LipData_v2 m_lipData; - bool m_lipDataSent = false; - - Quaternion m_bindRotation; - Quaternion m_lastHeadRotation; - - DataParser m_dataParser = null; - float m_smoothing = 0.5f; - - internal HeadTracked() - { - m_lipData = new LipData_v2(); - m_lipData.frame = 0; - m_lipData.time = 0; - m_lipData.image = IntPtr.Zero; - m_lipData.prediction_data = new PredictionData_v2(); - m_lipData.prediction_data.blend_shape_weight = new float[(int)LipShape_v2.Max]; - } - - // Unity events - void Awake() - { - if(ms_instance != null) - { - DestroyImmediate(this); - return; - } - - ms_instance = this; - DontDestroyOnLoad(this); - - m_dataParser = new DataParser(); - } - - void Start() - { - OnSmoothingChanged(Settings.Smoothing); - - OnVRModeSwitch(true); - - Settings.OnEnabledChanged.AddListener(this.OnEnabledOrHeadTrackingChanged); - Settings.OnHeadTrackingChanged.AddListener(this.OnEnabledOrHeadTrackingChanged); - Settings.OnSmoothingChanged.AddListener(this.OnSmoothingChanged); - - CVRGameEventSystem.Avatar.OnLocalAvatarLoad.AddListener(this.OnAvatarSetup); - CVRGameEventSystem.Avatar.OnLocalAvatarClear.AddListener(this.OnAvatarClear); - GameEvents.OnAvatarReuse.AddListener(this.OnAvatarReuse); - GameEvents.OnEyeControllerUpdate.AddListener(this.OnEyeControllerUpdate); - GameEvents.OnFaceTrackingUpdate.AddListener(this.UpdateFaceTracking); - - VRModeSwitchEvents.OnCompletedVRModeSwitch.AddListener(this.OnVRModeSwitch); - } - - void OnDestroy() - { - if(ms_instance == this) - ms_instance = null; - - m_dataParser = null; - - Settings.OnEnabledChanged.RemoveListener(this.OnEnabledOrHeadTrackingChanged); - Settings.OnHeadTrackingChanged.RemoveListener(this.OnEnabledOrHeadTrackingChanged); - Settings.OnSmoothingChanged.RemoveListener(this.OnSmoothingChanged); - - CVRGameEventSystem.Avatar.OnLocalAvatarLoad.RemoveListener(this.OnAvatarSetup); - CVRGameEventSystem.Avatar.OnLocalAvatarClear.RemoveListener(this.OnAvatarClear); - GameEvents.OnAvatarReuse.RemoveListener(this.OnAvatarReuse); - GameEvents.OnEyeControllerUpdate.RemoveListener(this.OnEyeControllerUpdate); - GameEvents.OnFaceTrackingUpdate.RemoveListener(this.UpdateFaceTracking); - - VRModeSwitchEvents.OnCompletedVRModeSwitch.RemoveListener(this.OnVRModeSwitch); - } - - void Update() - { - if(m_lipDataSent) - m_lipDataSent = false; - - if(Settings.Enabled && (m_dataParser != null)) - { - m_dataParser.Update(); - UpdateTrackingData(ref m_dataParser.GetLatestTrackingData()); - } - } - - // Tracking updates - public void UpdateTrackingData(ref TrackingData p_data) - { - m_headPosition.Set(p_data.m_headPositionX * (Settings.Mirrored ? -1f : 1f), p_data.m_headPositionY, p_data.m_headPositionZ); - m_headRotation.Set(p_data.m_headRotationX, p_data.m_headRotationY * (Settings.Mirrored ? -1f : 1f), p_data.m_headRotationZ * (Settings.Mirrored ? -1f : 1f), p_data.m_headRotationW); - m_gazeDirection.Set(Settings.Mirrored ? (1f - p_data.m_gazeX) : p_data.m_gazeX, p_data.m_gazeY); - m_blinkProgress = p_data.m_blink; - - float l_weight = Mathf.Clamp01(Mathf.InverseLerp(0.25f, 1f, Mathf.Abs(p_data.m_mouthShape))); - m_lipData.prediction_data.blend_shape_weight[(int)LipShape_v2.Jaw_Open] = p_data.m_mouthOpen; - m_lipData.prediction_data.blend_shape_weight[(int)LipShape_v2.Mouth_Pout] = ((p_data.m_mouthShape > 0f) ? l_weight : 0f); - m_lipData.prediction_data.blend_shape_weight[(int)LipShape_v2.Mouth_Smile_Left] = ((p_data.m_mouthShape < 0f) ? l_weight : 0f); - m_lipData.prediction_data.blend_shape_weight[(int)LipShape_v2.Mouth_Smile_Right] = ((p_data.m_mouthShape < 0f) ? l_weight : 0f); - } - - void OnLookIKPostUpdate() - { - if(Settings.Enabled && Settings.HeadTracking && (m_headBone != null)) - { - m_lastHeadRotation = Quaternion.Slerp(m_lastHeadRotation, m_avatarDescriptor.transform.rotation * (m_headRotation * m_bindRotation), m_smoothing); - - if(!PlayerSetup.Instance.IsEmotePlaying) - m_headBone.rotation = m_lastHeadRotation; - } - } - - // Game events - internal void OnAvatarSetup(CVRAvatar p_avatar) - { - try - { - m_camera = PlayerSetup.Instance.activeCam.transform; - m_avatarDescriptor = PlayerSetup.Instance.AvatarObject.GetComponent(); - - if(PlayerSetup.Instance.Animator.isHuman) - { - IKSystem.Instance.SetAvatarPose(IKSystem.AvatarPose.TPose); - PlayerSetup.Instance.AvatarTransform.localPosition = Vector3.zero; - PlayerSetup.Instance.AvatarTransform.localRotation = Quaternion.identity; - - m_headBone = PlayerSetup.Instance.Animator.GetBoneTransform(HumanBodyBones.Head); - if(m_headBone != null) - m_bindRotation = Quaternion.Inverse(m_avatarDescriptor.transform.rotation) * m_headBone.rotation; - - m_lookIK = PlayerSetup.Instance.AvatarObject.GetComponent(); - if(m_lookIK != null) - m_lookIK.onPostSolverUpdate.AddListener(this.OnLookIKPostUpdate); - } - } - catch(Exception e) - { - MelonLoader.MelonLogger.Error(e); - } - } - void OnAvatarClear(CVRAvatar p_avatar) - { - try - { - m_avatarDescriptor = null; - m_lookIK = null; - m_headBone = null; - m_lastHeadRotation = Quaternion.identity; - m_bindRotation = Quaternion.identity; - } - catch(Exception e) - { - MelonLoader.MelonLogger.Error(e); - } - } - void OnAvatarReuse() - { - m_camera = PlayerSetup.Instance.activeCam.transform; - - m_lookIK = PlayerSetup.Instance.AvatarObject.GetComponent(); - if(m_lookIK != null) - m_lookIK.onPostSolverUpdate.AddListener(this.OnLookIKPostUpdate); - } - - void OnEyeControllerUpdate(EyeMovementController p_component) - { - if(this.enabled && Settings.Enabled) - { - // Gaze - if(Settings.EyeTracking && (m_camera != null)) - { - p_component.manualViewTarget = true; - p_component.targetViewPosition = m_camera.position + m_camera.rotation * new Vector3((m_gazeDirection.x - 0.5f) * 2f, (m_gazeDirection.y - 0.5f) * 2f, 1f); - } - - // Blink - if(Settings.Blinking) - { - p_component.manualBlinking = true; - p_component.blinkProgressLeft = m_blinkProgress; - p_component.blinkProgressRight = m_blinkProgress; - } - } - } - - void UpdateFaceTracking(CVRFaceTracking p_component, GameEvents.EventResult p_result) - { - if(this.enabled && Settings.Enabled && Settings.FaceTracking && p_component.isLocal && p_component.UseFacialTracking) - { - if(!m_lipDataSent) - { - FaceTrackingManager.Instance.SubmitNewFacialData(m_lipData); - m_lipDataSent = true; - } - p_component.LipSyncWasUpdated = true; - p_component.UpdateShapesLocal_Private(); - - p_result.m_result |= true; - } - } - - void OnVRModeSwitch(bool p_state) - { - try - { - this.enabled = !Utils.IsInVR(); - } - catch(Exception e) - { - MelonLoader.MelonLogger.Error(e); - } - } - - // Settings - void OnEnabledOrHeadTrackingChanged(bool p_state) - { - if(Settings.Enabled && Settings.HeadTracking) - m_lastHeadRotation = ((m_headBone != null) ? m_headBone.rotation : m_bindRotation); - } - void OnSmoothingChanged(float p_value) - { - m_smoothing = 1f - Mathf.Clamp(p_value, 0f, 0.99f); - } - } -} +using ABI.CCK.Components; +using ABI_RC.Core.Player; +using ABI_RC.Core.Player.EyeMovement; +using ABI_RC.Systems.FaceTracking; +using ABI_RC.Systems.GameEventSystem; +using ABI_RC.Systems.IK; +using ABI_RC.Systems.VRModeSwitch; +using RootMotion.FinalIK; +using System; +using UnityEngine; +using ViveSR.anipal.Lip; + +namespace ml_dht +{ + [DisallowMultipleComponent] + class HeadTracked : MonoBehaviour + { + static HeadTracked ms_instance = null; + + CVRAvatar m_avatarDescriptor = null; + Transform m_camera = null; + LookAtIK m_lookIK = null; + Transform m_headBone = null; + + Vector3 m_headPosition; + Quaternion m_headRotation; + Vector2 m_gazeDirection; + float m_blinkProgress = 0f; + LipData_v2 m_lipData; + bool m_lipDataSent = false; + + Quaternion m_bindRotation; + Quaternion m_lastHeadRotation; + + DataParser m_dataParser = null; + float m_smoothing = 0.5f; + + internal HeadTracked() + { + m_lipData = new LipData_v2(); + m_lipData.frame = 0; + m_lipData.time = 0; + m_lipData.image = IntPtr.Zero; + m_lipData.prediction_data = new PredictionData_v2(); + m_lipData.prediction_data.blend_shape_weight = new float[(int)LipShape_v2.Max]; + } + + // Unity events + void Awake() + { + if(ms_instance != null) + { + DestroyImmediate(this); + return; + } + + ms_instance = this; + DontDestroyOnLoad(this); + + m_dataParser = new DataParser(); + } + + void Start() + { + OnSmoothingChanged(Settings.Smoothing); + + OnVRModeSwitch(true); + + Settings.OnEnabledChanged.AddListener(this.OnEnabledOrHeadTrackingChanged); + Settings.OnHeadTrackingChanged.AddListener(this.OnEnabledOrHeadTrackingChanged); + Settings.OnSmoothingChanged.AddListener(this.OnSmoothingChanged); + + CVRGameEventSystem.Avatar.OnLocalAvatarLoad.AddListener(this.OnAvatarSetup); + CVRGameEventSystem.Avatar.OnLocalAvatarClear.AddListener(this.OnAvatarClear); + GameEvents.OnAvatarReuse.AddListener(this.OnAvatarReuse); + GameEvents.OnEyeControllerUpdate.AddListener(this.OnEyeControllerUpdate); + GameEvents.OnFaceTrackingUpdate.AddListener(this.UpdateFaceTracking); + + VRModeSwitchEvents.OnCompletedVRModeSwitch.AddListener(this.OnVRModeSwitch); + } + + void OnDestroy() + { + if(ms_instance == this) + ms_instance = null; + + m_dataParser = null; + + Settings.OnEnabledChanged.RemoveListener(this.OnEnabledOrHeadTrackingChanged); + Settings.OnHeadTrackingChanged.RemoveListener(this.OnEnabledOrHeadTrackingChanged); + Settings.OnSmoothingChanged.RemoveListener(this.OnSmoothingChanged); + + CVRGameEventSystem.Avatar.OnLocalAvatarLoad.RemoveListener(this.OnAvatarSetup); + CVRGameEventSystem.Avatar.OnLocalAvatarClear.RemoveListener(this.OnAvatarClear); + GameEvents.OnAvatarReuse.RemoveListener(this.OnAvatarReuse); + GameEvents.OnEyeControllerUpdate.RemoveListener(this.OnEyeControllerUpdate); + GameEvents.OnFaceTrackingUpdate.RemoveListener(this.UpdateFaceTracking); + + VRModeSwitchEvents.OnCompletedVRModeSwitch.RemoveListener(this.OnVRModeSwitch); + } + + void Update() + { + if(m_lipDataSent) + m_lipDataSent = false; + + if(Settings.Enabled && (m_dataParser != null)) + { + m_dataParser.Update(); + UpdateTrackingData(ref m_dataParser.GetLatestTrackingData()); + } + } + + // Tracking updates + public void UpdateTrackingData(ref TrackingData p_data) + { + m_headPosition.Set(p_data.m_headPositionX * (Settings.Mirrored ? -1f : 1f), p_data.m_headPositionY, p_data.m_headPositionZ); + m_headRotation.Set(p_data.m_headRotationX, p_data.m_headRotationY * (Settings.Mirrored ? -1f : 1f), p_data.m_headRotationZ * (Settings.Mirrored ? -1f : 1f), p_data.m_headRotationW); + m_gazeDirection.Set(Settings.Mirrored ? (1f - p_data.m_gazeX) : p_data.m_gazeX, p_data.m_gazeY); + m_blinkProgress = p_data.m_blink; + + float l_weight = Mathf.Clamp01(Mathf.InverseLerp(0.25f, 1f, Mathf.Abs(p_data.m_mouthShape))); + m_lipData.prediction_data.blend_shape_weight[(int)LipShape_v2.Jaw_Open] = p_data.m_mouthOpen; + m_lipData.prediction_data.blend_shape_weight[(int)LipShape_v2.Mouth_Pout] = ((p_data.m_mouthShape > 0f) ? l_weight : 0f); + m_lipData.prediction_data.blend_shape_weight[(int)LipShape_v2.Mouth_Smile_Left] = ((p_data.m_mouthShape < 0f) ? l_weight : 0f); + m_lipData.prediction_data.blend_shape_weight[(int)LipShape_v2.Mouth_Smile_Right] = ((p_data.m_mouthShape < 0f) ? l_weight : 0f); + } + + void OnLookIKPostUpdate() + { + if(Settings.Enabled && Settings.HeadTracking && (m_headBone != null)) + { + m_lastHeadRotation = Quaternion.Slerp(m_lastHeadRotation, m_avatarDescriptor.transform.rotation * (m_headRotation * m_bindRotation), m_smoothing); + + if(!PlayerSetup.Instance.IsEmotePlaying) + m_headBone.rotation = m_lastHeadRotation; + } + } + + // Game events + internal void OnAvatarSetup(CVRAvatar p_avatar) + { + try + { + m_camera = PlayerSetup.Instance.activeCam.transform; + m_avatarDescriptor = PlayerSetup.Instance.AvatarObject.GetComponent(); + + if(PlayerSetup.Instance.Animator.isHuman) + { + IKSystem.Instance.SetAvatarPose(IKSystem.AvatarPose.TPose); + PlayerSetup.Instance.AvatarTransform.localPosition = Vector3.zero; + PlayerSetup.Instance.AvatarTransform.localRotation = Quaternion.identity; + + m_headBone = PlayerSetup.Instance.Animator.GetBoneTransform(HumanBodyBones.Head); + if(m_headBone != null) + m_bindRotation = Quaternion.Inverse(m_avatarDescriptor.transform.rotation) * m_headBone.rotation; + + m_lookIK = PlayerSetup.Instance.AvatarObject.GetComponent(); + if(m_lookIK != null) + m_lookIK.onPostSolverUpdate.AddListener(this.OnLookIKPostUpdate); + } + } + catch(Exception e) + { + MelonLoader.MelonLogger.Error(e); + } + } + void OnAvatarClear(CVRAvatar p_avatar) + { + try + { + m_avatarDescriptor = null; + m_lookIK = null; + m_headBone = null; + m_lastHeadRotation = Quaternion.identity; + m_bindRotation = Quaternion.identity; + } + catch(Exception e) + { + MelonLoader.MelonLogger.Error(e); + } + } + void OnAvatarReuse() + { + m_camera = PlayerSetup.Instance.activeCam.transform; + + m_lookIK = PlayerSetup.Instance.AvatarObject.GetComponent(); + if(m_lookIK != null) + m_lookIK.onPostSolverUpdate.AddListener(this.OnLookIKPostUpdate); + } + + void OnEyeControllerUpdate(EyeMovementController p_component) + { + if(this.enabled && Settings.Enabled) + { + // Gaze + if(Settings.EyeTracking && (m_camera != null)) + { + p_component.manualViewTarget = true; + p_component.targetViewPosition = m_camera.position + m_camera.rotation * new Vector3((m_gazeDirection.x - 0.5f) * 2f, (m_gazeDirection.y - 0.5f) * 2f, 1f); + } + + // Blink + if(Settings.Blinking) + { + p_component.manualBlinking = true; + p_component.blinkProgressLeft = m_blinkProgress; + p_component.blinkProgressRight = m_blinkProgress; + } + } + } + + void UpdateFaceTracking(CVRFaceTracking p_component, GameEvents.EventResult p_result) + { + if(this.enabled && Settings.Enabled && Settings.FaceTracking && p_component.isLocal && p_component.UseFacialTracking) + { + if(!m_lipDataSent) + { + FaceTrackingManager.Instance.SubmitNewFacialData(m_lipData); + m_lipDataSent = true; + } + p_component.LipSyncWasUpdated = true; + p_component.UpdateShapesLocal_Private(); + + p_result.m_result |= true; + } + } + + void OnVRModeSwitch(bool p_state) + { + try + { + this.enabled = !Utils.IsInVR(); + } + catch(Exception e) + { + MelonLoader.MelonLogger.Error(e); + } + } + + // Settings + void OnEnabledOrHeadTrackingChanged(bool p_state) + { + if(Settings.Enabled && Settings.HeadTracking) + m_lastHeadRotation = ((m_headBone != null) ? m_headBone.rotation : m_bindRotation); + } + void OnSmoothingChanged(float p_value) + { + m_smoothing = 1f - Mathf.Clamp(p_value, 0f, 0.99f); + } + } +} diff --git a/ml_dht/Main.cs b/archived/ml_dht/Main.cs similarity index 96% rename from ml_dht/Main.cs rename to archived/ml_dht/Main.cs index a2675d2..0d184fb 100644 --- a/ml_dht/Main.cs +++ b/archived/ml_dht/Main.cs @@ -1,40 +1,40 @@ -using ABI_RC.Core.Player; -using ABI_RC.Core.Savior; -using UnityEngine; - -namespace ml_dht -{ - public class DesktopHeadTracking : MelonLoader.MelonMod - { - - HeadTracked m_tracked = null; - - public override void OnInitializeMelon() - { - Settings.Init(); - GameEvents.InitA(HarmonyInstance); - - MelonLoader.MelonCoroutines.Start(WaitForInstances()); - } - - System.Collections.IEnumerator WaitForInstances() - { - while(MetaPort.Instance == null) - yield return null; - - while(PlayerSetup.Instance == null) - yield return null; - - GameEvents.InitB(HarmonyInstance); - - m_tracked = new GameObject("[DesktopHeadTracking]").AddComponent(); - } - - public override void OnDeinitializeMelon() - { - if(m_tracked != null) - Object.Destroy(m_tracked.gameObject); - m_tracked = null; - } - } +using ABI_RC.Core.Player; +using ABI_RC.Core.Savior; +using UnityEngine; + +namespace ml_dht +{ + public class DesktopHeadTracking : MelonLoader.MelonMod + { + + HeadTracked m_tracked = null; + + public override void OnInitializeMelon() + { + Settings.Init(); + GameEvents.InitA(HarmonyInstance); + + MelonLoader.MelonCoroutines.Start(WaitForInstances()); + } + + System.Collections.IEnumerator WaitForInstances() + { + while(MetaPort.Instance == null) + yield return null; + + while(PlayerSetup.Instance == null) + yield return null; + + GameEvents.InitB(HarmonyInstance); + + m_tracked = new GameObject("[DesktopHeadTracking]").AddComponent(); + } + + public override void OnDeinitializeMelon() + { + if(m_tracked != null) + Object.Destroy(m_tracked.gameObject); + m_tracked = null; + } + } } \ No newline at end of file diff --git a/ml_dht/MemoryMapReader.cs b/archived/ml_dht/MemoryMapReader.cs similarity index 100% rename from ml_dht/MemoryMapReader.cs rename to archived/ml_dht/MemoryMapReader.cs diff --git a/ml_dht/Properties/AssemblyInfo.cs b/archived/ml_dht/Properties/AssemblyInfo.cs similarity index 99% rename from ml_dht/Properties/AssemblyInfo.cs rename to archived/ml_dht/Properties/AssemblyInfo.cs index 9013c5f..34ba934 100644 --- a/ml_dht/Properties/AssemblyInfo.cs +++ b/archived/ml_dht/Properties/AssemblyInfo.cs @@ -1,4 +1,4 @@ -[assembly: MelonLoader.MelonInfo(typeof(ml_dht.DesktopHeadTracking), "DesktopHeadTracking", "1.3.4", "SDraw", "https://github.com/SDraw/ml_mods_cvr")] -[assembly: MelonLoader.MelonGame(null, "ChilloutVR")] -[assembly: MelonLoader.MelonPlatform(MelonLoader.MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)] +[assembly: MelonLoader.MelonInfo(typeof(ml_dht.DesktopHeadTracking), "DesktopHeadTracking", "1.3.4", "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/archived/ml_dht/README.md similarity index 100% rename from ml_dht/README.md rename to archived/ml_dht/README.md diff --git a/ml_dht/ResourcesHandler.cs b/archived/ml_dht/ResourcesHandler.cs similarity index 100% rename from ml_dht/ResourcesHandler.cs rename to archived/ml_dht/ResourcesHandler.cs diff --git a/ml_dht/Settings.cs b/archived/ml_dht/Settings.cs similarity index 100% rename from ml_dht/Settings.cs rename to archived/ml_dht/Settings.cs diff --git a/ml_dht/TrackingData.cs b/archived/ml_dht/TrackingData.cs similarity index 100% rename from ml_dht/TrackingData.cs rename to archived/ml_dht/TrackingData.cs diff --git a/ml_dht/Utils.cs b/archived/ml_dht/Utils.cs similarity index 97% rename from ml_dht/Utils.cs rename to archived/ml_dht/Utils.cs index 1b5331b..e8aeac5 100644 --- a/ml_dht/Utils.cs +++ b/archived/ml_dht/Utils.cs @@ -1,20 +1,20 @@ -using ABI.CCK.Components; -using ABI_RC.Core.Savior; -using ABI_RC.Core.UI; -using System.Reflection; - -namespace ml_dht -{ - static class Utils - { - static readonly object[] ms_emptyArray = new object[0]; - static readonly FieldInfo ms_view = typeof(CohtmlControlledViewWrapper).GetField("_view", BindingFlags.Instance | BindingFlags.NonPublic); - static readonly MethodInfo ms_updateShapesLocal = typeof(CVRFaceTracking).GetMethod("UpdateShapesLocal", BindingFlags.Instance | BindingFlags.NonPublic); - - public static bool IsInVR() => ((MetaPort.Instance != null) && MetaPort.Instance.isUsingVr); - - public static void ExecuteScript(this CohtmlControlledViewWrapper p_instance, string p_script) => (ms_view?.GetValue(p_instance) as cohtml.Net.View)?.ExecuteScript(p_script); - - public static void UpdateShapesLocal_Private(this CVRFaceTracking p_instance) => ms_updateShapesLocal?.Invoke(p_instance, ms_emptyArray); - } -} +using ABI.CCK.Components; +using ABI_RC.Core.Savior; +using ABI_RC.Core.UI; +using System.Reflection; + +namespace ml_dht +{ + static class Utils + { + static readonly object[] ms_emptyArray = new object[0]; + static readonly FieldInfo ms_view = typeof(CohtmlControlledViewWrapper).GetField("_view", BindingFlags.Instance | BindingFlags.NonPublic); + static readonly MethodInfo ms_updateShapesLocal = typeof(CVRFaceTracking).GetMethod("UpdateShapesLocal", BindingFlags.Instance | BindingFlags.NonPublic); + + public static bool IsInVR() => ((MetaPort.Instance != null) && MetaPort.Instance.isUsingVr); + + public static void ExecuteScript(this CohtmlControlledViewWrapper p_instance, string p_script) => (ms_view?.GetValue(p_instance) as cohtml.Net.View)?.ExecuteScript(p_script); + + public static void UpdateShapesLocal_Private(this CVRFaceTracking p_instance) => ms_updateShapesLocal?.Invoke(p_instance, ms_emptyArray); + } +} diff --git a/ml_dht/ml_dht.csproj b/archived/ml_dht/ml_dht.csproj similarity index 97% rename from ml_dht/ml_dht.csproj rename to archived/ml_dht/ml_dht.csproj index 14161da..8f17a6d 100644 --- a/ml_dht/ml_dht.csproj +++ b/archived/ml_dht/ml_dht.csproj @@ -1,85 +1,85 @@ - - - - netstandard2.1 - DesktopHeadTracking - SDraw - SDraw - DesktopHeadTracking - 1.3.4 - x64 - DesktopHeadTracking - - - - x64 - embedded - true - - - - - - - - - - - - - - - - - - D:\games\Steam\steamapps\common\ChilloutVR\MelonLoader\net35\0Harmony.dll - false - false - - - D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\Assembly-CSharp.dll - false - false - - - D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\Assembly-CSharp-firstpass.dll - false - false - - - D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\cohtml.Net.dll - false - false - - - D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\Cohtml.Runtime.dll - false - false - - - D:\games\Steam\steamapps\common\ChilloutVR\MelonLoader\net35\MelonLoader.dll - false - false - - - D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.dll - false - false - - - D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.AnimationModule.dll - false - false - - - D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.CoreModule.dll - false - false - - - - - - - - + + + + netstandard2.1 + DesktopHeadTracking + SDraw + SDraw + DesktopHeadTracking + 1.3.4 + x64 + DesktopHeadTracking + + + + x64 + embedded + true + + + + + + + + + + + + + + + + + + D:\games\Steam\steamapps\common\ChilloutVR\MelonLoader\net35\0Harmony.dll + false + false + + + D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\Assembly-CSharp.dll + false + false + + + D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\Assembly-CSharp-firstpass.dll + false + false + + + D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\cohtml.Net.dll + false + false + + + D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\Cohtml.Runtime.dll + false + false + + + D:\games\Steam\steamapps\common\ChilloutVR\MelonLoader\net35\MelonLoader.dll + false + false + + + D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.dll + false + false + + + D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.AnimationModule.dll + false + false + + + D:\games\Steam\steamapps\common\ChilloutVR\ChilloutVR_Data\Managed\UnityEngine.CoreModule.dll + false + false + + + + + + + + diff --git a/ml_dht/resources/mod_menu.js b/archived/ml_dht/resources/mod_menu.js similarity index 100% rename from ml_dht/resources/mod_menu.js rename to archived/ml_dht/resources/mod_menu.js diff --git a/ml_vet/Main.cs b/archived/ml_vet/Main.cs similarity index 100% rename from ml_vet/Main.cs rename to archived/ml_vet/Main.cs diff --git a/ml_vet/Properties/AssemblyInfo.cs b/archived/ml_vet/Properties/AssemblyInfo.cs similarity index 100% rename from ml_vet/Properties/AssemblyInfo.cs rename to archived/ml_vet/Properties/AssemblyInfo.cs diff --git a/ml_vet/README.md b/archived/ml_vet/README.md similarity index 100% rename from ml_vet/README.md rename to archived/ml_vet/README.md diff --git a/ml_vet/ResourcesHandler.cs b/archived/ml_vet/ResourcesHandler.cs similarity index 100% rename from ml_vet/ResourcesHandler.cs rename to archived/ml_vet/ResourcesHandler.cs diff --git a/ml_vet/Settings.cs b/archived/ml_vet/Settings.cs similarity index 100% rename from ml_vet/Settings.cs rename to archived/ml_vet/Settings.cs diff --git a/ml_vet/Utils.cs b/archived/ml_vet/Utils.cs similarity index 100% rename from ml_vet/Utils.cs rename to archived/ml_vet/Utils.cs diff --git a/ml_vet/ml_vet.csproj b/archived/ml_vet/ml_vet.csproj similarity index 100% rename from ml_vet/ml_vet.csproj rename to archived/ml_vet/ml_vet.csproj diff --git a/ml_vet/resources/mod_menu.js b/archived/ml_vet/resources/mod_menu.js similarity index 100% rename from ml_vet/resources/mod_menu.js rename to archived/ml_vet/resources/mod_menu.js diff --git a/ml_mods_cvr.sln b/ml_mods_cvr.sln index df44b4a..7094403 100644 --- a/ml_mods_cvr.sln +++ b/ml_mods_cvr.sln @@ -22,17 +22,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ml_asl", "ml_asl\ml_asl.csp EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ml_pin", "ml_pin\ml_pin.csproj", "{7E493C28-7202-46F8-9789-D6C6FF7E5241}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ml_dht", "ml_dht\ml_dht.csproj", "{31987392-989C-40C1-A48B-7F6099816EBE}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ml_bft", "ml_bft\ml_bft.csproj", "{331C995D-9648-44AD-8B02-D5F3A89FDC1F}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ml_vpc", "ml_vpc\ml_vpc.csproj", "{7CF37B93-9341-422D-845C-9AB96DB4D0A1}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ml_ppu", "ml_ppu\ml_ppu.csproj", "{F16DF16B-D127-4A2A-81FF-2FD80F320E64}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ml_vet", "ml_vet\ml_vet.csproj", "{8DB32590-FC5B-46A8-9747-344E86B18ACF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ml_pah", "ml_pah\ml_pah.csproj", "{C4659F60-3FED-4F43-88E4-969907D4C7A6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ml_pah", "ml_pah\ml_pah.csproj", "{C4659F60-3FED-4F43-88E4-969907D4C7A6}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -66,10 +62,6 @@ Global {7E493C28-7202-46F8-9789-D6C6FF7E5241}.Debug|x64.ActiveCfg = Debug|x64 {7E493C28-7202-46F8-9789-D6C6FF7E5241}.Release|x64.ActiveCfg = Release|x64 {7E493C28-7202-46F8-9789-D6C6FF7E5241}.Release|x64.Build.0 = Release|x64 - {31987392-989C-40C1-A48B-7F6099816EBE}.Debug|x64.ActiveCfg = Debug|x64 - {31987392-989C-40C1-A48B-7F6099816EBE}.Debug|x64.Build.0 = Debug|x64 - {31987392-989C-40C1-A48B-7F6099816EBE}.Release|x64.ActiveCfg = Release|x64 - {31987392-989C-40C1-A48B-7F6099816EBE}.Release|x64.Build.0 = Release|x64 {331C995D-9648-44AD-8B02-D5F3A89FDC1F}.Debug|x64.ActiveCfg = Debug|x64 {331C995D-9648-44AD-8B02-D5F3A89FDC1F}.Release|x64.ActiveCfg = Release|x64 {331C995D-9648-44AD-8B02-D5F3A89FDC1F}.Release|x64.Build.0 = Release|x64 @@ -81,10 +73,6 @@ Global {F16DF16B-D127-4A2A-81FF-2FD80F320E64}.Debug|x64.Build.0 = Debug|x64 {F16DF16B-D127-4A2A-81FF-2FD80F320E64}.Release|x64.ActiveCfg = Release|x64 {F16DF16B-D127-4A2A-81FF-2FD80F320E64}.Release|x64.Build.0 = Release|x64 - {8DB32590-FC5B-46A8-9747-344E86B18ACF}.Debug|x64.ActiveCfg = Debug|x64 - {8DB32590-FC5B-46A8-9747-344E86B18ACF}.Debug|x64.Build.0 = Debug|x64 - {8DB32590-FC5B-46A8-9747-344E86B18ACF}.Release|x64.ActiveCfg = Release|x64 - {8DB32590-FC5B-46A8-9747-344E86B18ACF}.Release|x64.Build.0 = Release|x64 {C4659F60-3FED-4F43-88E4-969907D4C7A6}.Debug|x64.ActiveCfg = Debug|x64 {C4659F60-3FED-4F43-88E4-969907D4C7A6}.Release|x64.ActiveCfg = Release|x64 {C4659F60-3FED-4F43-88E4-969907D4C7A6}.Release|x64.Build.0 = Release|x64 diff --git a/ml_prm/RagdollController.cs b/ml_prm/RagdollController.cs index ef52f4b..805c32e 100644 --- a/ml_prm/RagdollController.cs +++ b/ml_prm/RagdollController.cs @@ -347,6 +347,7 @@ namespace ml_prm BipedRagdollCreator.Options l_options = BipedRagdollCreator.AutodetectOptions(m_puppetReferences); l_options.joints = RagdollCreator.JointType.Character; + l_options.fixFootColliderRotation = false; BipedRagdollCreator.Create(m_puppetReferences, l_options); Transform[] l_puppetTransforms = m_puppetReferences.GetRagdollTransforms(); From 95e1a687da28273acb5402da77adbd0d591e05ea Mon Sep 17 00:00:00 2001 From: SDraw Date: Sun, 17 Aug 2025 09:48:38 +0300 Subject: [PATCH 2/2] Info update --- README.md | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 6d23a4f..a0078dc 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,16 @@ Merged set of MelonLoader mods for ChilloutVR. -**Table for game build 2025r179:** +**Table for nightly game build 2025r180:** | Full name | Latest version | |:---------:|:--------------:| -|[Avatar Motion Tweaker](/ml_amt/README.md)|1.5.1 [:arrow_down:](../../releases/latest/download/AvatarMotionTweaker.dll)| -|[Avatar Synced Look](/ml_asl/README.md)|1.1.1 [:arrow_down:](../../releases/latest/download/AvatarSyncedLook.dll)| -|[Better Fingers Tracking](/ml_bft/README.md)|1.1.2 [:arrow_down:](../../releases/latest/download/BetterFingersTracking.dll)| -|[Desktop Head Tracking](/ml_dht/README.md)|1.3.2 [:arrow_down:](../../releases/latest/download/DesktopHeadTracking.dll)| -|[Leap Motion Extension](/ml_lme/README.md)| 1.6.1 [:arrow_down:](../../releases/latest/download/LeapMotionExtension.dll)| -|[Pickup Arm Movement](/ml_pam/README.md)|1.2.2 [:arrow_down:](../../releases/latest/download/PickupArmMovement.dll)| -|[Players Instance Notifier](/ml_pin/README.md)|1.1.1 [:arrow_down:](../../releases/latest/download/PlayersInstanceNotifier.dll)| -|[Player Movement Copycat](/ml_pmc/README.md)|1.1.1 [:arrow_down:](../../releases/latest/download/PlayerMovementCopycat.dll)| -|[Player Pick Up](/ml_ppu/README.md)|1.0.0 [:arrow_down:](../../releases/latest/download/PlayerPickUp.dll)| -|[Player Ragdoll Mod](/ml_prm/README.md)|1.2.3 [:arrow_down:](../../releases/latest/download/PlayerRagdollMod.dll)| -|[Video Player Cookies](/ml_vpc/README.md)|1.0.1 [:arrow_down:](../../releases/latest/download/VideoPlayerCookies.dll)| -|[Vive Eye Tracking](/ml_vet/README.md)|1.0.0 [:arrow_down:](../../releases/latest/download/ViveEyeTracking.dll)| -|[Vive Extended Input](/ml_vei/README.md)|1.1.1 [:arrow_down:](../../releases/latest/download/ViveExtendedInput.dll)| +|[Avatar Motion Tweaker](/ml_amt/README.md)|1.5.2 [:arrow_down:](../../releases/latest/download/r180n/AvatarMotionTweaker.dll)| +|[Avatar Synced Look](/ml_asl/README.md)|1.1.2 [:arrow_down:](../../releases/latest/download/r180n/AvatarSyncedLook.dll)| +|[Better Fingers Tracking](/ml_bft/README.md)|1.1.3 [:arrow_down:](../../releases/latest/download/r180n/BetterFingersTracking.dll)| +|[Leap Motion Extension](/ml_lme/README.md)| 1.6.2 [:arrow_down:](../../releases/latest/download/r180n/LeapMotionExtension.dll)| +|[Pickup Arm Movement](/ml_pam/README.md)|1.2.3 [:arrow_down:](../../releases/latest/download/r180n/PickupArmMovement.dll)| +|[Players Instance Notifier](/ml_pin/README.md)|1.1.2 [:arrow_down:](../../releases/latest/download/r180n/PlayersInstanceNotifier.dll)| +|[Player Movement Copycat](/ml_pmc/README.md)|1.1.2 [:arrow_down:](../../releases/latest/download/r180n/PlayerMovementCopycat.dll)| +|[Player Pick Up](/ml_ppu/README.md)|1.0.1 [:arrow_down:](../../releases/latest/download/r180n/PlayerPickUp.dll)| +|[Player Ragdoll Mod](/ml_prm/README.md)|1.2.4 [:arrow_down:](../../releases/latest/download/r180n/PlayerRagdollMod.dll)| +|[Vive Extended Input](/ml_vei/README.md)|1.1.2 [:arrow_down:](../../releases/latest/download/r180n/ViveExtendedInput.dll)| +|[Video Player Cookies](/ml_vpc/README.md)|1.0.2 [:arrow_down:](../../releases/latest/download/r180n/VideoPlayerCookies.dll)|