mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
quickly add custom IKPose animation support
This commit is contained in:
parent
6433dd7c78
commit
06dc5cec08
3 changed files with 23 additions and 24 deletions
|
@ -1,6 +1,6 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using BTKUILib;
|
||||
using BTKUILib;
|
||||
using BTKUILib.UIObjects;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace NAK.Melons.DesktopVRIK.BTKUI_Integration;
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ public class DesktopVRIK : MonoBehaviour
|
|||
// create the shared Head IK Target
|
||||
headIKTarget = new GameObject("[DesktopVRIK] Head IK Target").transform;
|
||||
headIKTarget.parent = PlayerSetup.Instance.transform;
|
||||
headIKTarget.localPosition = new Vector3(0f,1.8f,0f);
|
||||
headIKTarget.localPosition = new Vector3(0f, 1.8f, 0f);
|
||||
headIKTarget.localRotation = Quaternion.identity;
|
||||
}
|
||||
|
||||
|
@ -88,18 +88,17 @@ public class DesktopVRIK : MonoBehaviour
|
|||
//avatar.transform.rotation = Quaternion.identity;
|
||||
|
||||
//ikpose layer (specified by avatar author)
|
||||
//int? ikposeLayerIndex = PlayerSetup.Instance.animatorManager.GetAnimatorLayerIndex("IKPose");
|
||||
//int? locoLayerIndex = PlayerSetup.Instance.animatorManager.GetAnimatorLayerIndex("Locomotion/Emotes");
|
||||
|
||||
//if (ikposeLayerIndex != -1)
|
||||
//{
|
||||
// PlayerSetup.Instance.animatorManager.SetAnimatorLayerWeight("IKPose", 1f);
|
||||
// if (locoLayerIndex != -1)
|
||||
// {
|
||||
// PlayerSetup.Instance.animatorManager.SetAnimatorLayerWeight("Locomotion/Emotes", 0f);
|
||||
// }
|
||||
// IKSystem.Instance.animator.Update(0f);
|
||||
//}
|
||||
int ikposeLayerIndex = animator.GetLayerIndex("IKPose");
|
||||
int locoLayerIndex = animator.GetLayerIndex("Locomotion/Emotes");
|
||||
if (ikposeLayerIndex != -1)
|
||||
{
|
||||
animator.SetLayerWeight(ikposeLayerIndex, 1f);
|
||||
if (locoLayerIndex != -1)
|
||||
{
|
||||
animator.SetLayerWeight(locoLayerIndex, 0f);
|
||||
}
|
||||
animator.Update(0f);
|
||||
}
|
||||
|
||||
//Generic VRIK calibration shit
|
||||
VRIK vrik = avatar.gameObject.AddComponent<VRIK>();
|
||||
|
@ -149,14 +148,14 @@ public class DesktopVRIK : MonoBehaviour
|
|||
vrik.solver.SetToReferences(vrik.references);
|
||||
vrik.solver.Initiate(vrik.transform);
|
||||
|
||||
//if (ikposeLayerIndex != -1)
|
||||
//{
|
||||
// PlayerSetup.Instance.animatorManager.SetAnimatorLayerWeight("IKPose", 0f);
|
||||
// if (locoLayerIndex != -1)
|
||||
// {
|
||||
// PlayerSetup.Instance.animatorManager.SetAnimatorLayerWeight("Locomotion/Emotes", 1f);
|
||||
// }
|
||||
//}
|
||||
if (ikposeLayerIndex != -1)
|
||||
{
|
||||
animator.SetLayerWeight(ikposeLayerIndex, 0f);
|
||||
if (locoLayerIndex != -1)
|
||||
{
|
||||
animator.SetLayerWeight(locoLayerIndex, 1f);
|
||||
}
|
||||
}
|
||||
|
||||
//Find eyeoffset
|
||||
initialCamPos = PlayerSetup.Instance.desktopCamera.transform.localPosition;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue