Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method track shows lines between keys #80924

Closed
KoBeWi opened this issue Aug 23, 2023 · 1 comment · Fixed by #81563
Closed

Method track shows lines between keys #80924

KoBeWi opened this issue Aug 23, 2023 · 1 comment · Fixed by #81563

Comments

@KoBeWi
Copy link
Member

KoBeWi commented Aug 23, 2023

Godot version

4.2 dev3

System information

Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 30.0.15.1403) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)

Issue description

If you have a Method Track with multiple calls to the same method, they are joined together and makes things unreadable:
image
The horizontal line shouldn't be used here. I think it might be a regression.

Steps to reproduce

  1. Add AnimationPlayer
  2. Add a Method Track (with Add Track button)
  3. Add some key to the track
  4. Add another key with the same method

Minimal reproduction project

N/A

@jsjtxietian
Copy link
Contributor

I think I can see where the bug is.

When drawing keyframes, the editor will call draw_key_link, and it will decide whether to draw a line based on the comparison below. Unfortunately, for method track , track_get_key_value will return a dictionary with methods and args, "multiple calls to the same method" is same in this comparison.

Variant current = animation->track_get_key_value(get_track(), p_index);
Variant next = animation->track_get_key_value(get_track(), p_index + 1);
if (current != next) {
	return;
}

For a quick fix I guess I can add a if here and if it's a method track then return. Any suggestions ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants