[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.
This commit is contained in:
NotAKidoS 2023-07-30 21:45:37 -05:00
parent 9dde916bb6
commit ba6a5f4778
3 changed files with 14 additions and 55 deletions

View file

@ -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
}

View file

@ -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";
}

View file

@ -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"
}