godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.12k stars 69 forks source link

Getting AnimationStateMachineNodeTransition from the NodeAnimations it connects #1052

Open jcarlosrc opened 4 years ago

jcarlosrc commented 4 years ago

Describe the project you are working on: Working in a 3D project TPS play

Describe the problem or limitation you are having in your project: I need to manage AnimationStateMachineNode transitions from code. I can only get a transition from its index with the _gettransition(idx: int) method. However, transition's idx is nowhere to be found in the editor, so that I have to gess what such index is. Of course it makes sense to get a transition from the nodes names it connects.

Describe the feature / enhancement and how it helps to overcome the problem or limitation: Just add a _get_transition(node_from: String, nodeto: String) method to get transitions in a natural way. I does not seem to be a complex addition to the API.

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

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

Is there a reason why this should be core and not an add-on in the asset library?: It is a core API function.

jcarlosrc commented 4 years ago

I can see a int get_transition(const char from, const char to) in the c++ code in 3.2 branch. Any chance for this function to get into the GD API?