Skip to content

Commit ecae2eb

Browse files
committed
update animation notify in unreal
1 parent b060295 commit ecae2eb

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

_posts/UE/Animation/2025-05-17 Animation Notify in Unreal.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* [UE 动画系统框架源码解析](https://zhuanlan.zhihu.com/p/673924647)
77

88
TODO:解释当 notify 用在 montage 上时,多出来的 Link Method 选项
9-
### Notes
9+
### Notes 1
1010
montage 的 notify 和组成它的 sequence 的 notify 都会触发,见 `FAnimMontageInstance::HandleEvents`
1111

1212
notify 按调用方式可以分为三类
@@ -17,6 +17,12 @@ notify 按调用方式可以分为三类
1717
如果按照调用时机可以分为两类
1818
* queue
1919
* branch point(仅在 montage 中适用)
20+
### Notes 2
21+
在每一帧 tick 中, notify 的收集逻辑是只要它的 start time 和 end time 构成的区间与 tick 的 previous time 和 current time 构成的区别有重叠,就会把它加入到 notify queue 中(普通的 notify start time 和 end time 是一样的)
22+
23+
这意味着,即使 current time 越过了 notify state 的 end time,也得等下一帧 previous time 越过 notify state 的 endtime 后才能触发 end notify 回调,这也是为什么 [UE4/UE5 动画通知AnimNotify AnimNotifyState源码解析](https://zhuanlan.zhihu.com/p/664976581) 中强调即使 notify state A 的 start notify 时间在 notify state B 的 end notify 后边,但是可能先于 notify state B 触发的原因
24+
25+
另一方面,在 montage 播放时,从一个 notify state 中间跳走了,这个 notify state 的 end notify 也依然会触发。因为一旦 start notify 触发了,这个 notify state 就会加入到 `UAnimInstance``ActiveAnimNotifyState` 中,下次检测到 notify state 没有加入到 notify queue 时,end notify 就触发了
2026
### Graph Node Functions
2127
[Node Functions](https://dev.epicgames.com/documentation/en-us/unreal-engine/graphing-in-animation-blueprints-in-unreal-engine) 的文档来看,它主要是方便逻辑的拆分。对于一整个动画蓝图而言,同一时刻可能只有一小部分的动画节点是活跃的,因此也只有一部分的计算逻辑需要执行。传统的做法是用户在 update function 中写一堆的 if else,根据当前的状态进行相应部分逻辑的计算,现在引入 [Node Functions](https://dev.epicgames.com/documentation/en-us/unreal-engine/graphing-in-animation-blueprints-in-unreal-engine) 后,那我可以把这个节点对应的计算逻辑直接写到这个 node 的 update function 里,而不再需要写 if else 了
2228

_posts/UE/Small Goals.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ crazy game 上那个碰碰球游戏的复刻,加入本地双人,远程双人
6565
实现:锥形视角可视化,血条跟随人物,战争迷雾
6666

6767
看的类型:rogue like,3D 平台,独立游戏?
68+
### RPG Notes
69+
拔剑混合的时候不好处理跳跃的情形
70+
6871
#### 面试问题
6972
UE 的遮挡剔除:PVS,hierarchical z buffer
7073
UE 的 LOD 优化:hierachical LOD

0 commit comments

Comments
 (0)