godotengine / godot-docs

Godot Engine official documentation
https://docs.godotengine.org
Other
3.91k stars 3.2k forks source link

setting parameters in AnimationTree is not obvious #9590

Open yankscally opened 3 months ago

yankscally commented 3 months ago

Your Godot version:

godot 4.3 beta 2

Issue description:

There should be soemthing in the docs about setting parameters with set() in AnimationTree so its obvious how to modify parameters. The rest of the workflow was obvious and intuitive but i had to watch a video to figure out the last part.

the second highest comment on this youtube video reads the same issue: https://www.youtube.com/watch?v=WY2cN9uG6W8&

URL to the documentation page:

AnimationTree

AThousandShips commented 3 months ago

What would you add to the existing code to make it better?

yankscally commented 3 months ago

that looks good I just missed it when I'm running the engine and looking at the docs, it would be nice and quick to see an example of this set() so that you immediately know what you need to do, or at least a hyperlink to the code part. without having to leave the engine. A simple sentence with an example would be fine. I wasn't sure what I was supposed to be looking for once I finished the blend tree.

AThousandShips commented 3 months ago

There is a link, you have it at the very top of AnimationTree, under "Using AnimationTree"

I don't think we should duplicate a lot of complex code though

LordMcMutton commented 2 months ago

The best thing to do would be to add set() to the Class Documentation for AnimationTree, alongside a list of the parameter names for each AnimationTree Node type, and a basic example of the path setup to access one

EDIT

Something like:

void set(property: StringName, value: Variant)

[property]: Tells Godot the path to the parameter that you want to modify

[value]: Tells Godot what you want the parameter to be changed to

[Property] uses a format similar to a normal NodePath: 
    "parameters/[the name you gave the AnimationTree Node]/[Specific Parameter Name]

Parameter Names are specific to each Node type. You can find the name of each Value in the table below:

TimeScale | scale
BlendSpace | blend_position
etc
AThousandShips commented 2 months ago

You can't add an entry for set, as it's inherited from Object, so all you could do would be to add a note about it

LordMcMutton commented 2 months ago

Wait, so the only things listed in a Node's code documentation are items that are completely unique to that Node? That makes sense from a purely systemic point of view, but it's a complete nightmare in terms of user friendliness.

At the very least, the code documentation needs to list the important items for any given Node's functionality. If the current method of organization is required, then a link to that particular entry in the Node's parent type's documentation and the specifics of its usage for this Node will work.

So something like:

Animation Tree parameters can be modified using [Object.set()]

[Property] uses a format similar to a normal NodePath: 
    "parameters/[the name you gave the AnimationTree Node]/[Specific Parameter Name]

Parameter Names are specific to each Node type. You can find the name of each Value in the table below:

TimeScale | scale
BlendSpace | blend_position
etc

You would have to detail the unique method for Animation Tree's property path because Object's set() entry doesn't use a similar setup, and you would have to have the list of parameter names because there's nowhere they can be found, to my knowledge.

Basically, the code documentation should have all of the information a user needs to be able to work with scripting any given node- no wandering around parent types, no trawling through giant tutorial pages.

AThousandShips commented 2 months ago

You would have to detail the unique method

There's no unique method here, it's the exact same method as in Object

This should be added to the main description of AnimationTree, but it is also already available in the specific AnimationNodes, like here, here, here, here, etc.

Which is arguably where that information belongs, with the nodes it is about

LordMcMutton commented 2 months ago

There's no unique method here, it's the exact same method as in Object

Curse you, programming terminology! I don't mean "method" as in a programming Method, I mean "method" as in the process by which it's done. (If that's where the confusion is coming from)

The way you utilize the String part of Object.set() is different from the way you utilize the String part of AnimationTree.set(), more specifically- at least in terms of what the documentation is showing, which is why looking at Object.set() is unhelpful when working with AnimationTree.set()

This should be added to the main description of AnimationTree, but it is also already available in the specific AnimationNodes

Exactly, yeah.

Though it looks like I was mistakenly advocating for everything going into the AnimationTree documentation when I should have been advocating for it going in the specific AnimationTree Node documentation- my confusion stemming from having to call an AnimationTree Object to get its nodes.

It looks like a lot of AnimationTree Node pages are missing example details. I can write up missing examples, but I would need a way to figure out what the system name of values that you can't find in the AnimationTree Parameters window are.

For example, the Transition Node has this section in the Inspector where you can find the system names for its features: image

But TimeScale does not- how would you find the system name for 'scale' ?

yankscally commented 2 months ago

just to note my original problem was about the docs in the editor, not the online docs. Also I was specifically using a blend tree, and it seems the only way to change any blend nodes is with set(). Using the set method in godot 4 is lot rarer than in godot 3.

A simple example of using set() in the editor would be great anyway

LordMcMutton commented 2 months ago

The two should be the same, I think, right? Like, the editor documentation pulls from the website's, or they both pull from the same source?

There are a few Nodes with examples of how to use set() for their specific purpose- I'm not sure why every Node's documentation doesn't have an entry.