功能修复
This commit is contained in:
1 parent
fed1015849
commit
bae179eb93
13 files changed
+274
-81
No files matched your search
@@ -10,7 +10,7 @@ import { collectSubEmitterIds } from '../core/subEmitterIds'
|
||||
import { translate } from '../i18n'
|
||||
|
||||
type Track = { key: string; name: string; states: Array<ParticleState | null> }
|
||||
type ExportInput = { systems: ParticleSystem[]; timeline: TimelineState; settings: SpineExportSettings }
|
||||
type ExportInput = { systems: ParticleSystem[]; timeline: TimelineState; settings: SpineExportSettings; playbackEnd?: number }
|
||||
|
||||
const BLENDS = { normal: 'normal', add: 'additive', multiply: 'multiply', screen: 'screen' } as const
|
||||
const PARTICLE_POSITION_TOLERANCE = 0.1
|
||||
@@ -343,9 +343,12 @@ export function buildSpineJson(input: ExportInput): SpineExportResult {
|
||||
|
||||
for (const system of visibleSystems) {
|
||||
const frameLength = system.frames?.length || 0
|
||||
const playbackFrameCount = Number.isFinite(input.playbackEnd)
|
||||
? Math.min(frameLength, Math.max(1, Math.floor(Number(input.playbackEnd)) + 1))
|
||||
: frameLength
|
||||
const sourceCount = subEmitterIds.has(system.id)
|
||||
? frameLength
|
||||
: Math.min(frameLength, particleDurationFrames(system, sourceFps))
|
||||
? playbackFrameCount
|
||||
: Math.min(playbackFrameCount, particleDurationFrames(system, sourceFps))
|
||||
const frames = (system.frames || []).slice(0, sourceCount)
|
||||
if (!frames.length) warnings.push({ code: 'empty-cache', message: translate('errors.emptyCacheWarning', { name: system.config.name }) })
|
||||
const prefix = uniqueName(safeName(system.config.name, `system_${system.id}`), usedNames)
|
||||
|
||||
Reference in new issue
Block a user