[UE4/UE5] 虚幻的动画多线程
参考教程4 - Animation Layer Interface and Linked Anim Layers - Bow And Arrow - UE5 Blueprints - YouTube
lyra的一些动画设计
event graph
ABP_Mannequin_Base
为什么不使用event graph?因为event graph每秒都会跑一次,如果用这个就会有巨大的开销。所以我们要使用BlueprintThreadsafeUpdateAnimation来更新动画,这个可以在worker thread同时运行多个AnimBP,减少game thread开销。
animation layer interface和linked anim layers
ALI_ItemAnimLayers
ABP_Mannequin_Base
随着动画功能不断增多,如果我们把动画都放到一个动画蓝图里,这个就会看起来非常糟糕。所以animation layer interface和linked animation blueprint就派上用场了。
BlueprintThreadsafeUpdateAnimation
在线程安全更新动画时,必须用线程安全的函数,否则会报错。
直接加函数
但是如果你在detail面板点击thread safe,依然会报错。
点击thread safe
我们用了不是线程安全的函数。这里需要通过一种proxy来解决。就是这些变量的copy。
property access
property access让我们接触到一些变量的cache,当线程安全执行完之后,就会更新这些变量。
通过property access来访问这些变量
怎样把一个动画蓝图改为多线程
其实就是把event graph里的操作流程放到函数里,把函数改为多线程,然后在blueprintThreadsUpdateAnimation里调用。怎么把函数改为多线程,就是把一些变量通过访问property access来解决。
在event graph里
全部放到BlueprintThreadsUpdateAnimation里
放到event graph里的都是只会更新一次的
linked animation blueprint
把一部分的动画状态机放到另一个动画蓝图里。
创建一些linked animation blueprint
Animation layer interface
Animation layer interface顾名思义就是个接口,定义了函数的名字等,给距离animation blue print去实现。在运行时,可以用别的实现方法来替换。
可以替换成别的blueprint实现的方法
最后的问题
这个教程我遇到个问题,就是切换layer interface出现了不自然的过渡。
这个怎么解决?
https://www.zhihu.com/video/1623730607078211584 LinkLayer可以独立配置blend,走惯性化混合~ 你是说惯性化混合可以解决最后的那个问题? [飙泪笑]可以试试看,引擎提供的默认方案估计只有这个,要是过渡还不够自然就只能通过别的方式规避了 其实这里的情况,我觉得用蒙太奇更好一点。 嗯那确实~
页:
[1]