Fingers values reset

Hips transform restore after pose modification
This commit is contained in:
SDraw 2023-04-24 22:18:30 +03:00
parent 7ef112d02c
commit 0440baa84f
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
5 changed files with 96 additions and 6 deletions

View file

@ -132,6 +132,15 @@ namespace ml_pam
if(PlayerSetup.Instance._animator.isHuman)
{
Vector3 l_hipsPos = Vector3.zero;
Quaternion l_hipsRot = Quaternion.identity;
Transform l_hips = PlayerSetup.Instance._animator.GetBoneTransform(HumanBodyBones.Hips);
if(l_hips != null)
{
l_hipsPos = l_hips.localPosition;
l_hipsRot = l_hips.localRotation;
}
HumanPose l_currentPose = new HumanPose();
HumanPoseHandler l_poseHandler = null;
@ -190,6 +199,12 @@ namespace ml_pam
l_poseHandler?.SetHumanPose(ref l_currentPose);
l_poseHandler?.Dispose();
if(l_hips != null)
{
l_hips.localPosition = l_hipsPos;
l_hips.localRotation = l_hipsRot;
}
}
if(m_enabled)

View file

@ -1,10 +1,10 @@
using System.Reflection;
[assembly: AssemblyTitle("PickupArmMovement")]
[assembly: AssemblyVersion("1.0.3")]
[assembly: AssemblyFileVersion("1.0.3")]
[assembly: AssemblyVersion("1.0.4")]
[assembly: AssemblyFileVersion("1.0.4")]
[assembly: MelonLoader.MelonInfo(typeof(ml_pam.PickupArmMovement), "PickupArmMovement", "1.0.3", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
[assembly: MelonLoader.MelonInfo(typeof(ml_pam.PickupArmMovement), "PickupArmMovement", "1.0.4", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
[assembly: MelonLoader.MelonGame(null, "ChilloutVR")]
[assembly: MelonLoader.MelonPriority(1)]
[assembly: MelonLoader.MelonPlatform(MelonLoader.MelonPlatformAttribute.CompatiblePlatforms.WINDOWS_X64)]