godotengine / godot

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

Nonexistent function `get-parameter-list` in (base) AnimationNode #64539

Closed michael-nischt closed 2 years ago

michael-nischt commented 2 years ago

Godot version

v3.5.stable.official [991bb6ac7]

System information

Ubuntu 22.04, NVIDIA GeForce GTX 765M

Issue description

The AnmationNode function get-parameter-list is nonexistent in sub-classes.

E.g.: image

Consequently, get-parameter always returns null.

Steps to reproduce

  1. Run the attached minimal reproduction project.
  2. Note the errors in player_anim.gd attached to the AnimationTree node.
  3. Optional: set the WORKAROUND constant to false for am idea why we want that

Note: we don't want to iterate all parameters via the AnimationTree node and filter the nodes. This would be a error prone since the AnimationNodeBlendSpace1D sub-nodes are not sorted by their position! (they are in that example but we want to turn the script into a general plug-in).

Minimal reproduction project

AnimtionNodeBug-MissingMethods.zip

The purpose is to blend movement animations based on a single speed value. The animations on;y require matching animation cycles but can each have different duration.

A feature Unity's Mecanim BlendTree1D has built-in but Godots AnimationNodeBlendSpace1D can't since there's no way to query an AnimationNodes duration.

Calinou commented 2 years ago

Duplicate of https://github.com/godotengine/godot/issues/35272.

michael-nischt commented 2 years ago

@Calinou Can we please discuss this?

I understand that it originally wasn't intended to call based on the discussions in the duplicated report.

However, I hope the this report makes a good point why there is a lot of benefit to actually having them callable. I would at least expect a suggestion how to solve the problem I shared without those.

To be more precise. Querying the global parameter list doesn't help since AnimationNodeBlendSpace1D points are not named explicitly. They are numbers based on the node creation and not sorted. Understandably since there is not valid sorting for the 2D case, so explicit naming is the only option I can think of. This means there is not way to deterministically query the parameters matching a node. At least not in a generic way required (required for a plugin).

Or what am I missing?

Calinou commented 2 years ago

Can we please discuss this?

Use the https://github.com/godotengine/godot-proposals repository for that :slightly_smiling_face: