fix for skeleton poser

This commit is contained in:
Legonzaur 2023-01-13 16:40:29 +01:00
parent 10a19eb2bc
commit 1d936f4868

View File

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEditor;
using UnityEditor;
using UnityEngine;
namespace Valve.VR
@ -405,8 +400,15 @@ namespace Valve.VR
dest.rightHand.rotation = source.rightHand.rotation;
for (int boneIndex = 0; boneIndex < boneNum; boneIndex++)
{
dest.rightHand.bonePositions[boneIndex] = source.rightHand.bonePositions[boneIndex];
dest.rightHand.boneRotations[boneIndex] = source.rightHand.boneRotations[boneIndex];
if (boneIndex < dest.rightHand.bonePositions.Length && boneIndex < source.rightHand.bonePositions.Length)
{
dest.rightHand.bonePositions[boneIndex] = source.rightHand.bonePositions[boneIndex];
}
if (boneIndex < dest.rightHand.boneRotations.Length && boneIndex < source.rightHand.boneRotations.Length)
{
dest.rightHand.boneRotations[boneIndex] = source.rightHand.boneRotations[boneIndex];
}
EditorUtility.DisplayProgressBar("Copying...", "Copying right hand pose", (float)boneIndex / (float)boneNum / 2f);
}
dest.rightHand.thumbFingerMovementType = source.rightHand.thumbFingerMovementType;
@ -421,8 +423,14 @@ namespace Valve.VR
dest.leftHand.rotation = source.leftHand.rotation;
for (int boneIndex = 0; boneIndex < boneNum; boneIndex++)
{
dest.leftHand.bonePositions[boneIndex] = source.leftHand.bonePositions[boneIndex];
dest.leftHand.boneRotations[boneIndex] = source.leftHand.boneRotations[boneIndex];
if (boneIndex < dest.rightHand.bonePositions.Length && boneIndex < source.rightHand.bonePositions.Length)
{
dest.rightHand.bonePositions[boneIndex] = source.rightHand.bonePositions[boneIndex];
}
if (boneIndex < dest.rightHand.boneRotations.Length && boneIndex < source.rightHand.boneRotations.Length)
{
dest.rightHand.boneRotations[boneIndex] = source.rightHand.boneRotations[boneIndex];
}
EditorUtility.DisplayProgressBar("Copying...", "Copying left hand pose", (float)boneIndex / (float)boneNum / 2f);
}
dest.leftHand.thumbFingerMovementType = source.leftHand.thumbFingerMovementType;