Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add useful functions to FilterEdit in AnimationBlendTreeEditor #76654

Merged

Conversation

TokageItLab
Copy link
Member

Editing filters in AnimationBlendTreeEditor was a pain since we had to make individual selections and switches for every bone when editing filters. This PR adds 3 useful options for editing filters.

  • Fill Selected Children
    • Propagate that the filter is enabled to the children of the bones for which it is enabled
  • Invert
    • Toggle enable and disable for all bones
  • Clear
    • Disable filter for all bones

image

@TokageItLab TokageItLab added this to the 4.1 milestone May 1, 2023
@TokageItLab TokageItLab requested a review from a team May 1, 2023 19:05
@TokageItLab TokageItLab changed the title Add useful function to FilterEdit in AnimationBlendTreeEditor Add useful functions to FilterEdit in AnimationBlendTreeEditor May 1, 2023
@TokageItLab TokageItLab force-pushed the improve-filter-util-anim-tree branch from e7723e9 to e133f2e Compare May 1, 2023 19:06
@TokageItLab TokageItLab force-pushed the improve-filter-util-anim-tree branch from e133f2e to f3f2d3a Compare May 1, 2023 21:58
@TokageItLab TokageItLab requested review from fire and lyuma May 27, 2023 04:21
@TokageItLab TokageItLab modified the milestones: 4.1, 4.2 Jun 1, 2023
@adamscott
Copy link
Member

As this is editor related, maybe the editor team should take a look at this, how to implement this PR editor-wide.
CC. @YuriSizov

@YuriSizov
Copy link
Contributor

I don't really know the workflow this touches on, so I can't say if this is the best way to do it or not. If you want to give me a few examples of how it would be used by users, I can offer an opinion. Otherwise, we can just roll with it.

@TokageItLab
Copy link
Member Author

The most common case is to select only the upper or lower body. For that currently, we needs to select all the bones, which is tedious. Also, due to the deep nesting, the ability to select children of the selected objects in the tree would make sense IMO.

Ideally, I would like to add multiple selections, but it is a bit complicated and will not be added in this PR.

@YuriSizov
Copy link
Contributor

Also, due to the deep nesting, the ability to select children of the selected objects in the tree would make sense IMO.

Trees have a method to propagate checks (both upwards and downwards), so this can be done without extra controls, if it would be acceptable to always select all child bones when a parent bone is checked.

@TokageItLab
Copy link
Member Author

@YuriSizov There is no such functionality in the current FillterEdit, so I assume it would need to be added. Do you mean to use call_recursive()?

@YuriSizov
Copy link
Contributor

@TokageItLab I don't know what FilterEdit is. I was referring to functionality of Trees. There is TreeItem::propagate_check which allows to check and uncheck children of a tree item when it itself is checked or unchecked, and it allows to set an "intermediate" status to the tree item's parent items to indicate that they are partially selected.

If this behavior makes sense in your workflow, you should use it.

@TokageItLab
Copy link
Member Author

Oh I see, I think FillSelectedChildren can be replaced with a bool option that determines if it uses propagate_check() or not, so I'll look at that later.

@YuriSizov YuriSizov marked this pull request as draft September 29, 2023 12:05
@YuriSizov
Copy link
Contributor

I'll convert it into draft for now. Feel free to undraft it once it's ready to be reviewed again :)

@TokageItLab TokageItLab force-pushed the improve-filter-util-anim-tree branch from f3f2d3a to afe2593 Compare September 29, 2023 18:41
@TokageItLab TokageItLab marked this pull request as ready for review September 29, 2023 20:22
@TokageItLab
Copy link
Member Author

@YuriSizov I found that propagate_check is unusable, FilterEdit is just using Tree for display purposes. Also Bone does not treat the children as a group, they are parent-child relationships, and since each is independent and has only 1 column, so propagate_check will not work.

Copy link
Member

@SaracenOne SaracenOne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While there's likely ways the usability of this can be improved further (I feel like it could benefit from keyboard shortcuts and maybe a right-click menu), this is still a massive usability improvement over the original filter track editor so I approve merging this.

@akien-mga akien-mga removed this from the 4.2 milestone Oct 16, 2023
@akien-mga akien-mga added this to the 4.3 milestone Oct 16, 2023
@akien-mga akien-mga merged commit 0d18a94 into godotengine:master Jan 4, 2024
15 checks passed
@akien-mga
Copy link
Member

Thanks!

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.

5 participants