Skip to content

Improve conditionals across AnimationTree#118970

Open
vaner-org wants to merge 1 commit into
godotengine:masterfrom
vaner-org:animationtree-improve-conditionals
Open

Improve conditionals across AnimationTree#118970
vaner-org wants to merge 1 commit into
godotengine:masterfrom
vaner-org:animationtree-improve-conditionals

Conversation

@vaner-org
Copy link
Copy Markdown
Contributor

@vaner-org vaner-org commented Apr 26, 2026

Follow up to #109792.

The triangle tool in BlendSpace2D's editor has a few problems.

  1. Its purpose is to allow the user to manually draw their triangles, but for some reason it attempts to autogenerate triangles when selected, and usually fails since they likely all exist already, throwing an error. This PR not only removes that triangulation code, but also offers a "Reset Triangles" button to allow users to clear all current triangles, and get to work drawing them.
image
  1. The triangle tool is one of the four available, but is superseded by the auto toggle. However, that toggle hides the button, reducing general awareness of the tool, and, when toggled on, does not switch back to the select tool, which may leave the user in a suspended state, with no tool appearing to be selected. This PR disables the tool button rather than hiding it, and switches to select tool instead if auto triangles is toggled on.
image
  1. There doesn't appear to be a way to cancel triangle creation once started, which is unusual. This PR allows pressing Escape to do so.

The rest of the improvements serve as a succession of #110369, which moved editor-specific tools to the left side of the toolbar and edited item-specific tools to the right, only for BlendSpaces. This PR finishes that job, with some considerations.

  1. The "Play Mode" setting, which was equivalent to BlendSpace's Blend Mode setting, has been moved to the left.
image
  1. The delete button's conditional disappearance has been removed across the board. Now, it is always seen on the right edge, and it is only disabled (not hidden) depending on context. Doing this allows reliably for muscle memory to be built, versus a button that would disappear often, and sat at a different x pos in BlendSpace2D, between two buttons with extremely linked functionality.
  2. Doing this allows us to treat selection, which was previously exclusive to the select tool but unguarded, with a little more thoughtfulness; for BlendSpace2D, the triangle tool now allows selecting triangles, so that they can be both created and removed (with delete, or the now visible delete button) with the tool. Conversely, selecting of neither points nor triangles is possible with the other two tools, and they will clear selection upon being chosen. Same for BlendSpace1D and StateMachine.
image
  • Finally, there was a chunk of code in StateMachine's editor file that resided outside the ordinary left click selection block that was not functioning correctly: it was supposed to allow for holding shift to select multiple items. It was part of my first pair of pull requests, but I don't think I realised at the time that making that distinction on mousedown isn't possible. It also unnecessarily duplicated earlier code. The gate on that block was incorrect, and was responsible for a bug: when clicking over another node when in the create state tool, selection happened.
image

While the last one has been fixed correctly, the whole block can't be removed yet. The broken feature that it tried to add is possible to fix with a refactor of selection in StateMachine that is ready to follow this PR, that will allow for both shift-clicking to add nodes to selection as well as shift-dragging to move them, by deferring to mouseup and mouse drag.

Even though feature freeze is on, almost all of the above lead to unexpected dead ends, broken functionality, or errors. The refactor has been held back so that this may have a chance to make it to 4.7 to accompany #110369. If that isn't possible, I can split up what can make it, and save the rest and the refactor for later.

@vaner-org vaner-org requested review from a team as code owners April 26, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants