godot-proposals icon indicating copy to clipboard operation
godot-proposals copied to clipboard

Add a global parameter input node for AnimationTree

Open mrzapp opened this issue 4 years ago • 8 comments

Describe the project you are working on: A general purpose framework for RPGs

Describe the problem or limitation you are having in your project: The AnimationTree requires parameters to be set on individual nodes with specific paths

  • This makes generalisation impossible
  • When there are structural changes to the AnimationTree, the code has to be changed too
  • If a single parameter value is used in several places in the AnimationTree, it has to be set multiple times

Describe the feature / enhancement and how it helps to overcome the problem or limitation: A "global" parameter input node added to the AnimationTree, so we can set parameters once and use them anywhere.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:

Current UI, parameter values have no dynamic input:

image

Possible future UI, parameter values can use dynamic inputs:

image

Usage:

animation_tree.set("global_parameters/collider_height", my_collider.shape.height)

If this enhancement will not be used often, can it be worked around with a few lines of script?: No

Is there a reason why this should be core and not an add-on in the asset library?: This is would be deeply integrated with the AnimationTree

mrzapp avatar Jul 26 '20 12:07 mrzapp