vault backup: 2024-10-09 19:16:48

This commit is contained in:
BlueRose 2024-10-09 19:16:48 +08:00
parent 2c3ed32222
commit bc22d48a4f

View File

@ -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))
)
)
```