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

@onready with static type not providing suggestion to name parameter for play() method in AnimationPlayer #99211

Closed
adibzter opened this issue Nov 14, 2024 · 7 comments · Fixed by #99277

Comments

@adibzter
Copy link

adibzter commented Nov 14, 2024

Tested versions

  • Reproducible in v4.3.stable.official [77dcf97]

System information

Godot v4.3.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 6GB (NVIDIA; 32.0.15.6590) - AMD Ryzen 5 1600 Six-Core Processor (12 Threads)

Issue description

Below are three different declarations of animation players. All of them do not provide suggestions for the name parameter for play() method except the last one. Even when pressing Ctrl-space, the suggestion does not show up.

image

image

Declaration with := syntax works
image

Steps to reproduce

  1. Create a new scene with a Node3D as the root
  2. Add AnimationPlayer as the child
  3. Create a new animation and give it a proper name
  4. Attach a script to Node3D with this code:
@onready var animation_player1: AnimationPlayer = $AnimationPlayer
@onready var animation_player2: AnimationPlayer = $AnimationPlayer as AnimationPlayer
@onready var animation_player3 := $AnimationPlayer

func test():
	animation_player1.play()
	animation_player2.play()
	animation_player3.play()
  1. Put your cursor inside play() method and press Ctrl-space to get suggestions for your animation name

Minimal reproduction project (MRP)

mrp.zip

@PhairZ
Copy link
Contributor

PhairZ commented Nov 14, 2024

I can't get it to suggest at all. Tested in v4.4.dev.custom_build [277cb68].

@github-project-automation github-project-automation bot moved this to For team assessment in GDScript Issue Triage Nov 14, 2024
@dalexeev dalexeev moved this from For team assessment to Up for grabs in GDScript Issue Triage Nov 14, 2024
@HolonProduction
Copy link
Member

#92263 was supposed to fix that. Do you have a script attached to the animation player?

@adibzter
Copy link
Author

I can't get it to suggest at all. Tested in v4.4.dev.custom_build [277cb68].

Did you create a new animation before testing the intellisense? Btw, I added MRP

@adibzter
Copy link
Author

adibzter commented Nov 14, 2024

#92263 was supposed to fix that. Do you have a script attached to the animation player?

No script is attached to the animation player. Only one script is attached to Node3D. I added MRP to this issue. hope it helps

@PhairZ
Copy link
Contributor

PhairZ commented Nov 14, 2024

Did you create a new animation before testing the intellisense? Btw, I added MRP

@adibzter I did. Still nothing.

@btgs-0
Copy link
Contributor

btgs-0 commented Nov 14, 2024

I can't get it to suggest at all. Tested in v4.4.dev.custom_build [277cb68].

I also had this issue in v4.4.dev.custom_build [673f396].

After I switched back to v4.3.1.rc.custom_build [33c02a5] I could reproduce the original issue

@btgs-0
Copy link
Contributor

btgs-0 commented Nov 15, 2024

I had a look at this one for a bit. It looks the _guess_expression_type at line 3092 is not setting a value on the completion identifier ci:
image
This is then being passed into the _find_call_arguments defined on line 2716:
image
Finally, because the type is 'NIL' it fails this check on line 2783:
image
which means it does not run the obj get_argument_options method which produces the options hint and dropdown values. This happens for animation_player1 and animation_player2 but not animation_player3

It looks like the above problem is fixed in master, but master has a different issue that is causing the same outcome. The get_argument_options method has been removed from AnimationPlayer in master
image
As such, the method being called is AnimationMixer::get_argument_options:
image
This method does not handle the "play" argument and therefore doesn't run get_animation_list and return the animation options

@HolonProduction HolonProduction moved this from Up for grabs to Fix pending review in GDScript Issue Triage Nov 15, 2024
@github-project-automation github-project-automation bot moved this from Fix pending review to Done in GDScript Issue Triage Nov 15, 2024
@AThousandShips AThousandShips added this to the 4.4 milestone Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants