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 an ability to copy and paste signal connections #3775

Open
me2beats opened this issue Jan 9, 2022 · 3 comments
Open

Add an ability to copy and paste signal connections #3775

me2beats opened this issue Jan 9, 2022 · 3 comments

Comments

@me2beats
Copy link

me2beats commented Jan 9, 2022

Describe the project you are working on

A plugin that has UI scenes with many connections. Signals are connected mainly with editor (Node-Signals tab)

Describe the problem or limitation you are having in your project

connection_example

I created a connection for signal item_selected of node OptionButton
so that when the signal is emmited, the root node (AnyAll) update_title() method called.

Now I want to create the same connection but for node OptionButton2 (and maybe OptionButton3 if I will create it).

If I do this from Editor, I would create these connections "from scratch", there is no way to copy a signal connection from one node to another.

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

An ability to copy/paste signal connections would solve the problem

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

2 buttons - copy connection and paste connection could be added to connections right-click context menus

copy_connection

Edit
Go to Method
Disconnect
Copy Connection

paste_connection

Connect
Disconnect All
Paste Connection

All connections settings (deferred, oneshot, arguments etc) could be copied too

If this enhancement will not be used often, can it be worked around with a few lines of script?

options could be

  • do this "from scratch" each time
  • connect from the script (using connect() method).

Is there a reason why this should be core and not an add-on in the asset library?

I don's see an easy way implementing this as a plugin. There is a lack of exposed API for that

@Zireael07
Copy link

I had the same use case problem recently. Another solution would be to allow adding a Node (or NodePath) parameter from the GUI, this would let you reuse the same signal connection for different nodes.

@me2beats
Copy link
Author

made it as a plugin
https://github.com/me2beats/copy-paste-connections

@rossunger
Copy link

made it as a plugin https://github.com/me2beats/copy-paste-connections

This is great! I think this should be core? any reason this shouldn't be core? can someone C++ this please? :)

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

No branches or pull requests

4 participants