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 cut / copy / paste / duplicate functions to animation tree editors #83518

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

astillich
Copy link
Contributor

@astillich astillich commented Oct 17, 2023

Add cut / copy / paste / duplicate functions to animation tree editors

Adds the above functions to the animation blend tree, state machine and 1D / 2D blend space editors. Also exposes the existing delete function in the context menu and implements duplicate via menu and keyboard shortcut (CTRL+D), and CTRL+Drag for copying animation nodes.

Fixes #80009
Fixes godotengine/godot-proposals#8146

@astillich astillich marked this pull request as draft October 17, 2023 18:44
@fire fire requested a review from a team October 17, 2023 19:01
@AThousandShips AThousandShips added this to the 4.x milestone Oct 17, 2023
@astillich astillich changed the title [WIP] Add duplicate / cut / copy / paste to animation tree editors Add cut / copy / paste / duplicate functions to animation tree editors Oct 22, 2023
@astillich astillich marked this pull request as ready for review October 22, 2023 12:29
@astillich astillich requested a review from a team as a code owner October 22, 2023 12:29
Adds the above functions to the animation blend tree, state machine and 1D / 2D blend space editors. Also exposes the existing delete function in the context menu and implements duplicate via menu and keyboard shortcut (CTRL+D), and CTRL+Drag for copying animation nodes.
@astillich astillich force-pushed the 80009-animation-tree-editor-copy-paste branch from 909ca08 to b99ad56 Compare October 22, 2023 12:53
@KoBeWi
Copy link
Member

KoBeWi commented Nov 8, 2023

When I cut with Ctrl+X shortcut in the blend tree editor, I can't paste.

Duplicate in BlendSpace1D is confusing. The new point is created at the same position and when you try to drag it, the point behind is selected instead and lacks selection highlight.
EDIT: Seems like the point is inserted at the cursor position, which can be the same as the old point. It's still confusing to interact. BlendSpace2D has the same problem, but it's less prominent, because the points have more space to appear.

When you cut and paste a node in StateMachine, undo is incorrect. Undoing paste does not delete the node.
EDIT: Duplicate has the same problem.
EDIT2: Ok it's deleted, the view is just not updated and requires manual refresh.

@astillich
Copy link
Contributor Author

Thanks for looking at it. I wasn't sure how to handle duplicate in the blend space editors. Do you think the current version should be removed? Do you have a suggestion on how to improve it? I'll look at the issues you found in the coming days.

@KoBeWi
Copy link
Member

KoBeWi commented Nov 8, 2023

I think it's fine currently, what I reported looks like existing selection bug. Clicking a stack of points will select the one added earlier, but the later one is on top, which looks like the point can't be selected. Maybe you could improve that somehow, as it's more important when duplicating.

@fire
Copy link
Member

fire commented Dec 12, 2023

Are we able to merge partial the cut / copy / paste functions support for 4.3? What is missing?

@KoBeWi
Copy link
Member

KoBeWi commented Dec 17, 2023

The last problem I mentioned (preview not refreshing after adding node) needs to be resolved.

@astillich
Copy link
Contributor Author

I'll find some time over the (German) Christmas holidays. I wasn't in a hurry because this wasn't assigned to a milestone and I was busy with other things.

@colinmbo
Copy link

colinmbo commented Aug 4, 2024

Really hoping this gets resolved soon. AnimationTree state machines are unnecessarily difficult to work with currently because you have to manually rebuild every single node that you want to move inside a nest. I've already had to rebuild the same state machine over and over again in order to get the nested structure set up how I want. If not this, there needs to be some other way to move nodes inside sibling state machines instead of manually deleting them and recreating them every time they need to be moved around.

@Calinou
Copy link
Member

Calinou commented Aug 4, 2024

4.3 is currently in release freeze, so new features can only be merged in 4.4 at the earliest. Also, this PR needs to be rebased to resolve merge conflicts.

@Calinou
Copy link
Member

Calinou commented Jan 17, 2025

@astillich Could you look into rebasing this PR on master to fix merge conflicts? Thanks in advance 🙂

If you aren't available to do this, let us know and we can mark this PR as salvageable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants