From ba6a5f477804a012e797fa7fba4fb245a5895299 Mon Sep 17 00:00:00 2001 From: NotAKidoS <37721153+NotAKidOnSteam@users.noreply.github.com> Date: Sun, 30 Jul 2023 21:45:37 -0500 Subject: [PATCH] [DesktopVRIK] Remove bone reset mask stuff. Game has IKTweaks built in. Might as well use it. Don't really think this is needed, but I am including it solely for limb grabber. --- DesktopVRIK/IK/IKManager.cs | 63 +++++--------------------- DesktopVRIK/Properties/AssemblyInfo.cs | 2 +- DesktopVRIK/format.json | 4 +- 3 files changed, 14 insertions(+), 55 deletions(-) diff --git a/DesktopVRIK/IK/IKManager.cs b/DesktopVRIK/IK/IKManager.cs index 4e66e4d..313e35c 100644 --- a/DesktopVRIK/IK/IKManager.cs +++ b/DesktopVRIK/IK/IKManager.cs @@ -251,28 +251,23 @@ public class IKManager : MonoBehaviour for (var i = 0; i < _humanPose.muscles.Length; i++) { - //if (IkTweaksSettings.IgnoreAnimationsModeParsed == IgnoreAnimationsMode.All && IKTweaksMod.ourRandomPuck.activeInHierarchy) - //{ - // muscles[i] *= ourBoneResetMasks[i] == BoneResetMask.Never ? 1 : 0; - // continue; - //} - switch (ourBoneResetMasks[i]) + switch (BodySystem.boneResetMasks[i]) { - case BoneResetMask.Never: + case BodySystem.BoneResetMask.Never: break; - case BoneResetMask.Spine: + case BodySystem.BoneResetMask.Spine: _humanPose.muscles[i] *= 1 - _solver.spine.pelvisPositionWeight; break; - case BoneResetMask.LeftArm: + case BodySystem.BoneResetMask.LeftArm: _humanPose.muscles[i] *= 1 - _solver.leftArm.positionWeight; break; - case BoneResetMask.RightArm: + case BodySystem.BoneResetMask.RightArm: _humanPose.muscles[i] *= 1 - _solver.rightArm.positionWeight; break; - case BoneResetMask.LeftLeg: + case BodySystem.BoneResetMask.LeftLeg: _humanPose.muscles[i] *= 1 - _solver.leftLeg.positionWeight; break; - case BoneResetMask.RightLeg: + case BodySystem.BoneResetMask.RightLeg: _humanPose.muscles[i] *= 1 - _solver.rightLeg.positionWeight; break; default: @@ -357,9 +352,9 @@ public class IKManager : MonoBehaviour { _humanPoseHandler.GetHumanPose(ref _humanPose); - for (var i = 0; i < ourBoneResetMasks.Length; i++) + for (var i = 0; i < BodySystem.boneResetMasks.Length; i++) { - if (ourBoneResetMasks[i] != BoneResetMask.Never) + if (BodySystem.boneResetMasks[i] != BodySystem.BoneResetMask.Never) _humanPose.muscles[i] = value; } @@ -372,9 +367,9 @@ public class IKManager : MonoBehaviour { _humanPoseHandler.GetHumanPose(ref _humanPose); - for (var i = 0; i < ourBoneResetMasks.Length; i++) + for (var i = 0; i < BodySystem.boneResetMasks.Length; i++) { - if (ourBoneResetMasks[i] != BoneResetMask.Never) + if (BodySystem.boneResetMasks[i] != BodySystem.BoneResetMask.Never) _humanPose.muscles[i] = muscles[i]; } @@ -384,40 +379,4 @@ public class IKManager : MonoBehaviour } #endregion - - #region BodyHandling - - public enum BoneResetMask - { - Never, - Spine, - LeftArm, - RightArm, - LeftLeg, - RightLeg, - } - - private static readonly string[] ourNeverBones = { "Index", "Thumb", "Middle", "Ring", "Little", "Jaw", "Eye" }; - private static readonly string[] ourArmBones = { "Arm", "Forearm", "Hand", "Shoulder" }; - private static readonly string[] ourLegBones = { "Leg", "Foot", "Toes" }; - - private static BoneResetMask JudgeBone(string name) - { - if (ourNeverBones.Any(name.Contains)) - return BoneResetMask.Never; - - if (ourArmBones.Any(name.Contains)) - { - return name.Contains("Left") ? BoneResetMask.LeftArm : BoneResetMask.RightArm; - } - - if (ourLegBones.Any(name.Contains)) - return name.Contains("Left") ? BoneResetMask.LeftLeg : BoneResetMask.RightLeg; - - return BoneResetMask.Spine; - } - - internal static readonly BoneResetMask[] ourBoneResetMasks = HumanTrait.MuscleName.Select(JudgeBone).ToArray(); - - #endregion } \ No newline at end of file diff --git a/DesktopVRIK/Properties/AssemblyInfo.cs b/DesktopVRIK/Properties/AssemblyInfo.cs index 438a0d5..a11999c 100644 --- a/DesktopVRIK/Properties/AssemblyInfo.cs +++ b/DesktopVRIK/Properties/AssemblyInfo.cs @@ -28,6 +28,6 @@ using System.Reflection; namespace NAK.DesktopVRIK.Properties; internal static class AssemblyInfoParams { - public const string Version = "4.2.3"; + public const string Version = "4.2.4"; public const string Author = "NotAKidoS"; } \ No newline at end of file diff --git a/DesktopVRIK/format.json b/DesktopVRIK/format.json index 632be3b..69d7ff4 100644 --- a/DesktopVRIK/format.json +++ b/DesktopVRIK/format.json @@ -1,7 +1,7 @@ { "_id": 117, "name": "DesktopVRIK", - "modversion": "4.2.3", + "modversion": "4.2.4", "gameversion": "2023r171", "loaderversion": "0.6.1", "modtype": "Mod", @@ -19,6 +19,6 @@ ], "downloadlink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/releases/download/r17/DesktopVRIK.dll", "sourcelink": "https://github.com/NotAKidOnSteam/NAK_CVR_Mods/tree/main/DesktopVRIK/", - "changelog": "- Fixed an issue where tracking status would update a frame late.", + "changelog": "- Fixed an issue where tracking status would update a frame late.\n- Fixed an error with getting muscle traits on start (i was lazy).", "embedcolor": "#9b59b6" } \ No newline at end of file