godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.06k stars 65 forks source link

Add More Editing Functionality to AnimationTree's Advance Expression Interface #9696

Open Kalcen opened 3 weeks ago

Kalcen commented 3 weeks ago

Describe the project you are working on

My project is a top down 3D action adventure game with some simple real time combat.

Describe the problem or limitation you are having in your project

I have a considerable amount of transitions set up in my AnimationTree node, but as the number increases the harder it is for me to make adjustments to each of their advance expression's logic. For example if I decide to change the name of a variable or a function in the script that my AnimationTree samples from, I have to manually hunt down and edit every single transition that uses it which is pretty tedious. It discourages me from wanting to add any more animations as it would compound the process even further. This is not how I feel when making a new GDscript for example since the script editor makes it much easier to make these kinds of changes over a large amount of scripts.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Make the Advance Expression editor resemble the built in script editor more. Maybe something like the shader editor would even be enough. I think the key features that would help would be: Find, Find And Replace, and Find In Files.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

featureMockup01

This is a rough mockup based on the shader editor. Some issues with this layout would be the length of the state machine and transition titles on the left side. This could be avoided by dragging out the left view a bit more, since the expression window doesn't need to be as big as a typical script window.

Also I think the navigation on the left side could be more elegant than this, but it's a lot better than having to manually click through and open every transition like it is currently.

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

I suppose I could try to open all the .tmp files in an external code editor and try to make the edits that I want with the features present in that editor, but those files aren't very readable, and I worry about potentially corrupting them.

Is there a reason why this should be core and not an add-on in the asset library?

The Advance Expression feature already has an interface, I think this proposal makes sense as core since it seeks to increase the quality of an already existing core feature.