fix(core): use totalDuration for GSAP repeat/yoyo tween introspection#872
Closed
miguel-heygen wants to merge 2 commits into
Closed
fix(core): use totalDuration for GSAP repeat/yoyo tween introspection#872miguel-heygen wants to merge 2 commits into
miguel-heygen wants to merge 2 commits into
Conversation
WebAudio synth (oscillators, noise channels) can't be captured by the headless renderer — it only picks up file-based <audio> tracks via FFmpeg. This composition demonstrates the fix: a bake-audio.ts script pre-renders chiptune BGM and SFX offline into WAV files using square/ triangle wave math, then the composition references them as standard <audio> elements with data-start/data-duration/data-volume attributes. Composition: 1080×1920 vertical, 28s, 4 scenes — QR scan → console boot → Tetris gameplay (Penrose cursor AI, line clears, score counter) → game over + attribution. Glitch + chromatic aberration transitions.
… payload The GSAP introspection in collectRuntimeTimelinePayload used tween.duration() to compute scene clip ranges, which returns the base duration of a single cycle. For tweens with repeat/yoyo, the actual time range is tween.totalDuration() (base * (repeat+1)). This caused scene clips to appear shorter than their visible duration in the timeline UI — e.g. a 12s repeating animation showed as 0.75s. Use totalDuration() when available (GSAP 3+), falling back to duration() for timelines that don't expose it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
collectRuntimeTimelinePayloadusedtween.duration()to compute scene clip time ranges. For tweens withrepeat/yoyo,duration()returns the base single-cycle duration — a 12s repeating animation (duration: 0.75, repeat: 15) was measured as 0.75s instead of 12s.totalDuration()(GSAP 3+) which accounts for repeat count and yoyo, falling back toduration()for older or non-standard timeline implementations.Test plan
bun run testpasses (862 core + 514 studio tests)