修复导出问题

This commit is contained in:
tianmo committed 2026-10-22 17:19:09 +08:00
1 parent d224939efd
commit 5d12bf895b
8 files changed
+90 -56

No files matched your search

+5 -3
View File
@@ -222,7 +222,6 @@ function bakeSystemFrames(system: ParticleSystem, emitter: ParticleEmitter, fps:
function ensureFramesBaked(fps: number) {
const totalFrames = Math.max(2, Math.floor(store.timeline.totalFrames) || 2)
const subEmitterIds = collectSubEmitterIds(store.systems)
let complete = true
// 烘焙预热会大量出生/死亡粒子,期间暂停跨系统事件,避免注入预热粒子。
emitterSync.suspendEvents(true)
try {
@@ -231,13 +230,16 @@ function ensureFramesBaked(fps: number) {
if (subEmitterIds.has(system.id)) continue
if ((system.frames?.length || 0) >= totalFrames) continue
const emitter = emitterSync.emitters.get(system.id)
if (!emitter) { complete = false; continue }
if (!emitter) continue
bakeSystemFrames(system as unknown as ParticleSystem, emitter, fps, totalFrames)
}
} finally {
emitterSync.suspendEvents(false)
}
if (complete) store.timeline.recorded = true
// 子发射器必须通过父事件逐帧录制;只补齐根系统时不能把整段烘焙标记为完成。
if (store.systems.every((system) => (system.frames?.length || 0) >= totalFrames)) {
store.timeline.recorded = true
}
}
function loop() {