Skip to content

Add copy/pasting of nodes to/from clipboard in JSON#560

Merged
Zehir merged 6 commits intogaea-godot:2.0from
Zehir:magic
Feb 15, 2026
Merged

Add copy/pasting of nodes to/from clipboard in JSON#560
Zehir merged 6 commits intogaea-godot:2.0from
Zehir:magic

Conversation

@Zehir
Copy link
Collaborator

@Zehir Zehir commented Jan 6, 2026

This PR add the ability to copy/paste nodes to string that can be shared on discord or other media.
It's based on the idea of Factorio blueprints.
You just select node and click Copy to clipboard
image
And you will get a string in the clipboard like this :

{"origin":"(740.0, 80.0)","nodes":{"6":[0,{"arguments":{"material":null,"reference_data":{},"rules":{"(0, -1, 0)":false,"(0, 0, 0)":true}},"position":"(740.0, 80.0)","salt":581472843,"type":0,"uid":"uid://br8gcsyc04ksj"}]},"connections":[]}

Then when you can paste nodes from the clipboard like usual node pasting.

I also had to remove the add node popup by default on the right click for 2 reasons;

  • I need to be able to always have the context menu to past from clipboard
  • It's annoying to have different beavior if you have a node selected or not or an empty copy buffer

Like currently copy/paste node, the material resource is not copied but I guess we can change that in the future

@BenjaTK BenjaTK changed the title Add copy/past nodes from clipboard in base64 Add copy/pasting of nodes to/from clipboard in base64 Jan 11, 2026
@BenjaTK BenjaTK added ✨ enhancement New feature or request topic: editor Changes to the UI or UX of the editor. topic: graph Changes to GaeaGraph. labels Jan 11, 2026
@Zehir Zehir requested a review from BenjaTK February 1, 2026 15:15
cullumi
cullumi previously requested changes Feb 9, 2026
Copy link
Collaborator

@cullumi cullumi left a comment

Choose a reason for hiding this comment

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

A couple things:

  • I can't actually seem to get it to put anything into my clipboard.
  • Could this be part of normal Ctrl-C / Ctrl-V behavior? I realize there'd be a slight conflict between the editor's "clipboard" and the system's clipboard, though I suspect that could be resolved.
  • A "Ctrl-Shift-C / Ctrl-Shift-V" shortcut or similar might be nice, otherwise.

@Zehir
Copy link
Collaborator Author

Zehir commented Feb 11, 2026

A couple things:

  • I can't actually seem to get it to put anything into my clipboard.
  • Could this be part of normal Ctrl-C / Ctrl-V behavior? I realize there'd be a slight conflict between the editor's "clipboard" and the system's clipboard, though I suspect that could be resolved.
  • A "Ctrl-Shift-C / Ctrl-Shift-V" shortcut or similar might be nice, otherwise.

It could but we already talk about this on discord if I remember correctly and we don't want to mess with the clipboard with the ctrl+c and ctrl+v shorcuts. We can still add shorcuts with #562 later

@Zehir Zehir changed the title Add copy/pasting of nodes to/from clipboard in base64 Add copy/pasting of nodes to/from clipboard in JSON Feb 11, 2026
@BenjaTK
Copy link
Collaborator

BenjaTK commented Feb 15, 2026

I like Ctrl+Shift+V/C for the shortcuts. We can add them in #562 though.

Copy link
Collaborator

@BenjaTK BenjaTK left a comment

Choose a reason for hiding this comment

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

LGTM

@BenjaTK
Copy link
Collaborator

BenjaTK commented Feb 15, 2026

Just saw this:

I also had to remove the add node popup by default on the right click for 2 reasons;
and I disagree. I like how fast it is when you don't have a copy buffer, and it matches the functionality of the shader editor.

Zehir and others added 5 commits February 15, 2026 22:30
@Zehir Zehir requested a review from BenjaTK February 15, 2026 21:35
Copy link
Collaborator

@BenjaTK BenjaTK left a comment

Choose a reason for hiding this comment

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

LGTM

@Zehir Zehir merged commit 9f7763d into gaea-godot:2.0 Feb 15, 2026
5 checks passed
@Zehir Zehir deleted the magic branch February 15, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ enhancement New feature or request topic: editor Changes to the UI or UX of the editor. topic: graph Changes to GaeaGraph.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants