generated from VR-Sexe/Unity3DTemplate
fix for skeleton poser
This commit is contained in:
parent
10a19eb2bc
commit
1d936f4868
@ -1,9 +1,4 @@
|
|||||||
using System;
|
using UnityEditor;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
using UnityEditor;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Valve.VR
|
namespace Valve.VR
|
||||||
@ -405,8 +400,15 @@ namespace Valve.VR
|
|||||||
dest.rightHand.rotation = source.rightHand.rotation;
|
dest.rightHand.rotation = source.rightHand.rotation;
|
||||||
for (int boneIndex = 0; boneIndex < boneNum; boneIndex++)
|
for (int boneIndex = 0; boneIndex < boneNum; boneIndex++)
|
||||||
{
|
{
|
||||||
dest.rightHand.bonePositions[boneIndex] = source.rightHand.bonePositions[boneIndex];
|
if (boneIndex < dest.rightHand.bonePositions.Length && boneIndex < source.rightHand.bonePositions.Length)
|
||||||
dest.rightHand.boneRotations[boneIndex] = source.rightHand.boneRotations[boneIndex];
|
{
|
||||||
|
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);
|
EditorUtility.DisplayProgressBar("Copying...", "Copying right hand pose", (float)boneIndex / (float)boneNum / 2f);
|
||||||
}
|
}
|
||||||
dest.rightHand.thumbFingerMovementType = source.rightHand.thumbFingerMovementType;
|
dest.rightHand.thumbFingerMovementType = source.rightHand.thumbFingerMovementType;
|
||||||
@ -421,8 +423,14 @@ namespace Valve.VR
|
|||||||
dest.leftHand.rotation = source.leftHand.rotation;
|
dest.leftHand.rotation = source.leftHand.rotation;
|
||||||
for (int boneIndex = 0; boneIndex < boneNum; boneIndex++)
|
for (int boneIndex = 0; boneIndex < boneNum; boneIndex++)
|
||||||
{
|
{
|
||||||
dest.leftHand.bonePositions[boneIndex] = source.leftHand.bonePositions[boneIndex];
|
if (boneIndex < dest.rightHand.bonePositions.Length && boneIndex < source.rightHand.bonePositions.Length)
|
||||||
dest.leftHand.boneRotations[boneIndex] = source.leftHand.boneRotations[boneIndex];
|
{
|
||||||
|
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);
|
EditorUtility.DisplayProgressBar("Copying...", "Copying left hand pose", (float)boneIndex / (float)boneNum / 2f);
|
||||||
}
|
}
|
||||||
dest.leftHand.thumbFingerMovementType = source.leftHand.thumbFingerMovementType;
|
dest.leftHand.thumbFingerMovementType = source.leftHand.thumbFingerMovementType;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user