godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
86.79k stars 19.42k forks source link

Animation tab sizes single-digit columns differently from multi-digit columns #78592

Open hunterloftis opened 1 year ago

hunterloftis commented 1 year ago

Godot version

4.1.beta3

System information

Godot v4.1.beta3 - Fedora Linux 37 (Workstation Edition) - Vulkan (Forward+) - integrated Intel(R) Graphics (ADL GT2) () - 12th Gen Intel(R) Core(TM) i7-1280P (20 Threads)

Issue description

Expected behavior: all animation frame columns are rendered at the same width, representing their identical timespans.

Actual behavior: columns for frames below 10 are compressed, distorting the timeline.

image

Steps to reproduce

  1. Create an AnimationPlayer
  2. Add a new animation
  3. In the Animation tab, set Snap to "60 FPS"

Minimal reproduction project

N/A

brno32 commented 1 year ago

It seems the zoom is a factor too.

High zoom

Cap

Low zoom

cap2
jonatan1986 commented 1 year ago

how can i get the version? can i get link please?

tuto193 commented 1 year ago

how can i get the version? can i get link please?

https://godotengine.org/article/dev-snapshot-godot-4-1-beta-3/

atlas-wheatear commented 1 year ago

Replicated on an M1 Pro MacBook Pro, Forward+ renderer. Here is a minimal reproduction project, for anybody else that wants to try 😅

Issue78592.zip

Brawmario commented 1 year ago

Also easily replicated on my Windows Desktop, I identified the problem, it's is in the following line:

https://github.com/godotengine/godot/blob/cdd2313ba27d0a2600a18e849b4c5d1fd6a6e351/editor/animation_track_editor.cpp#L1501

The itos(frame) part should be something like the frame with the longest width, I'm trying to cook up a solution

atlas-wheatear commented 1 year ago

Also easily replicated on my Windows Desktop, I identified the problem, it's is in the following line:

https://github.com/godotengine/godot/blob/cdd2313ba27d0a2600a18e849b4c5d1fd6a6e351/editor/animation_track_editor.cpp#L1501

The itos(frame) part should be something like the frame with the longest width, I'm trying to cook up a solution

I remain unconvinced 😅, and offer an additional observation.

(Sorry for my bad terminology)

It doesn't seem to only "bunch up" in the interval [0, 10) - setting a high fps, and zooming out maximally leads to the vertical dividers becoming increasingly separated horizontally with increasing time.

Interestingly, everything looks the correct width against time, using my flawed eyesight. i.e. frames aren't more densely packed on the left. This suggests the lines are getting further apart because they are including more frames per "interval", so to speak.

Hopefully this helps your investigation.

(I'll attach a screenshot when I finish work.)

Brawmario commented 1 year ago

Thanks for the input, I zeroed in on that line precisely because the logic when using time (which looks entirely correct) doesn't use this prev_frame_ofs method of calculating the positions, hence why I thought this was the case. The comment on my PR #79047 shows that changing this didn't seem to fix this problem entirely, so I'll try some other approaches.