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

Adding Copy/Paste/Cut options for AnimationTree Editor #8146

Open
CsloudX opened this issue Oct 16, 2023 · 7 comments · May be fixed by godotengine/godot#83518
Open

Adding Copy/Paste/Cut options for AnimationTree Editor #8146

CsloudX opened this issue Oct 16, 2023 · 7 comments · May be fixed by godotengine/godot#83518

Comments

@CsloudX
Copy link

CsloudX commented Oct 16, 2023

Describe the project you are working on

a fps game

Describe the problem or limitation you are having in your project

First, my graph like this:
image
then, I change my graph to this:
image
And want to reuse my RunningLocomotion BlendSpace in Locomotion StateMachine
image

I want to move a BlendSpace2d node into another blending node. However, there is no way to move a node into another without re-making it. It would be good some simple options such as copy, paste, cut, duplicate and similar.

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

Adding the options when right mouse input is pressed and enable keys such as Ctrl + C

Describe how your proposal will work, with code, pseudo-code, mock-ups, 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?

/

@astillich
Copy link

astillich commented Oct 17, 2023

I ran into this, too and I'm thinking about giving an implementation a try. I think it needs #7899 and #4336 first, but instead of using weird paths I'd just extend ResourceSaver / ResourceLoader with methods dealing with PackedByteArray.

Then the various animation editors could serialize data for the clipboard and deserialize clipboard data, making copy paste across the different editors possible.

I haven't checked yet, but if the editor instances are not recreated each time you switch to a blend tree / state machine, I could get away with just cloning stuff like the visual shader editor seems to do. I'll have a closer look in the evening, but maybe somebody can provide some pointers.

EDIT: this issue godotengine/godot#80009 is related.

@astillich
Copy link

My lunch break investigation showed that the editors are only created once. The approach the visual shader editor uses can be used here, including supporting copy & paste between different trees / state machines / etc. The only real disadvantage is that you can't copy & paste between different Godot editor instances, but that's something people can live with, I think.

@colinmbo

This comment was marked as off-topic.

@Calinou
Copy link
Member

Calinou commented Aug 4, 2024

@colinmbo Please don't bump issues without contributing significant new information. Use the 👍 reaction button on the first post instead.

@romlok
Copy link

romlok commented Oct 23, 2024

Note that you can copy the tree_root value of an AnimationTree from the inspector, and paste that into the AnimationTree editor as a state or blend node.

So if you want to extract an animation node from inside an animation tree, one workaround for now is:

  1. Create a new AnimationTree node in the scene and save;
  2. Open the .tscn file in a text editor;
  3. Find the id of the desired AnimationNode* resource in the scene;
  4. Set the tree_root of the new AnimationTree to that value, eg:
[node name="AnimationTree2" type="AnimationTree" parent="."]
tree_root=SubResource("AnimationNodeStateMachine_mhyt5")
  1. Go back to Godot, and let it reopen the scene file;
  2. Copy the new AnimationTree's Tree Root value from the inspector;
  3. Paste into the original animation tree.

@dfendt
Copy link

dfendt commented Jan 16, 2025

Are there any updates on this? There are multiple entries on this topic, some are open and some are closed, and there's at least one pull but that seems to be stuck since 4.3 was being released, and it's pointing to
this issue that was closed in favour of this issue.

Would love to see some traction here :)

@Calinou
Copy link
Member

Calinou commented Jan 17, 2025

@dfendt 4.4.beta1 was released yesterday, so 4.4 is now in feature freeze. Any new features can now only be merged in 4.5 at the earliest.

The linked PR also still needs to be rebased before it can be reviewed.

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

Successfully merging a pull request may close this issue.

7 participants