From bc22d48a4f7ad856a336b34728143cb525314b6d Mon Sep 17 00:00:00 2001 From: BlueRose <378100977@qq.com> Date: Wed, 9 Oct 2024 19:16:48 +0800 Subject: [PATCH] vault backup: 2024-10-09 19:16:48 --- .../导出PSK_PSA脚本 & 部分UModel AES Key.md | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/06-DCC/Blender/导出PSK_PSA脚本 & 部分UModel AES Key.md b/06-DCC/Blender/导出PSK_PSA脚本 & 部分UModel AES Key.md index 5fcfe3c..742e86f 100644 --- a/06-DCC/Blender/导出PSK_PSA脚本 & 部分UModel AES Key.md +++ b/06-DCC/Blender/导出PSK_PSA脚本 & 部分UModel AES Key.md @@ -667,6 +667,7 @@ fn CalculateAddRotation index = //导入AdditiveAnim importFile Anims[index].Address #noPrompt using:Wavefront_Object local bones = FindAllBones() + //清空数组 BoneRotationArray = #() //遍历骨骼,从第二根骨骼,也就是Pelvis开始。(仅仅针对UE骨骼,Bip得重新考虑) @@ -678,7 +679,7 @@ fn CalculateAddRotation index = local Value_X = ((at time 0 bones[j].rotInParent).x - (at time 0 bones[j].parent.rotInParent).x) local Value_Y = ((at time 0 bones[j].rotInParent).y - (at time 0 bones[j].parent.rotInParent).y) local Value_Z = ((at time 0 bones[j].rotInParent).z - (at time 0 bones[j].parent.rotInParent).z) - //针对XYZ抖动情况的不同传入不同的形参并调用BoneRotationArray。 + //针对XYZ情况的不同,将数据存入BoneRotationArray数组。 if (abs Value_X) > 0.05 then ( if (abs Value_Y) > 0.05 then @@ -760,4 +761,26 @@ fn CalculateAddRotation index = ExportAnim Anims[index].Address ) ) +``` + +RotationBone(): +```c++ +fn RotationBone X Y Z BoneArray Map BaseAnimBones = +( + local RotationValue = 0 + for a=1 to BoneArray.count do + ( + case Map of + ( + 1:(RotationValue = BoneArray[a].ValueX) + 2:(RotationValue = BoneArray[a].ValueY) + 3:(RotationValue = BoneArray[a].ValueZ) + 4:(RotationValue = (BoneArray[a].ValueX)*(-1)) + 5:(RotationValue = (BoneArray[a].ValueY)*(-1)) + 6:(RotationValue = (BoneArray[a].ValueZ)*(-1)) + --default:(RotationValue = BoneRotationArray[a].ValueX) + ) + in coordsys world rotate BaseAnimBones[(BoneArray[a].Index)] (EulerAngles (RotationValue*X) (RotationValue*Y) (RotationValue*Z)) + ) +) ``` \ No newline at end of file