Skip to content

Fix animation event editor runtime FPS scale - #9

Merged
Eerrly merged 1 commit into
dev_4.0from
codex/github-mention-dev-4.0
Jun 2, 2026
Merged

Fix animation event editor runtime FPS scale#9
Eerrly merged 1 commit into
dev_4.0from
codex/github-mention-dev-4.0

Conversation

@Eerrly

@Eerrly Eerrly commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Motivation

  • The editor previously used a clip's sample rate for event frame numbers which causes exported events to be mis-timed because the runtime converts Event.frame on a fixed 30fps scale.
  • When a clip has FPS != 30, adding events in the editor produces frame values that the runtime interprets at the 30fps domain, shifting event times.
  • Keep the editor working in the same runtime frame domain to avoid manual user adjustments and incorrect generated AnimationData timing.

Description

  • Introduced a RuntimeEventFrameRate constant set to 30 and initialized the editor's _frameRate from it instead of the clip sample rate.
  • Made the FPS control a read-only IntegerField labeled Runtime Event FPS and added a tooltip that explains events are stored on the runtime 30fps scale.
  • Updated ResetForClip to restore the runtime FPS instead of reading AnimationClip.frameRate so loading clips no longer changes the editor's event-frame domain.
  • No other behavioral changes to event storage, curve generation, or runtime AnimationManager behavior were made.

Testing

  • Ran git diff --check to validate no whitespace/conflict issues and it passed.
  • Checked for a local Unity/.NET toolchain with command -v Unity || command -v unity-editor || command -v dotnet || true and none was available so an editor/compile run could not be performed in this environment.
  • No automated editor/unit tests were executed in this environment.

Codex Task

@Eerrly
Eerrly merged commit 88ccac8 into dev_4.0 Jun 2, 2026
@Eerrly
Eerrly deleted the codex/github-mention-dev-4.0 branch June 2, 2026 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant