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

Sockets do not accept more than one plug #20

Open
hgmeyer opened this issue Nov 28, 2017 · 10 comments
Open

Sockets do not accept more than one plug #20

hgmeyer opened this issue Nov 28, 2017 · 10 comments

Comments

@hgmeyer
Copy link

hgmeyer commented Nov 28, 2017

Hi,
currently sockets do not accept more than one plug. However, I would like to be able to connect several plugs to a socket (e.g. for routing MIDI messages). I found an if statement in the accepts method of the SocketItem class (line 1833) which returns False if more than one plug is connected. However, uncommenting the corresponding line does not seem to do the trick. Can you give me a hint which lines of code I have to change?

Best,
Hanno

@LeGoffLoic
Copy link
Owner

Hi,

I will take a look when I have some free time

@morganloomis
Copy link
Contributor

This would be a nice feature so long as it could be enabled or disabled by an argument when creating a socket.

@LeGoffLoic
Copy link
Owner

Sorry guys, I really don't have time to look into this.
@morganloomis, feel free to submit a pull request if you can get it to work.

@glm-ypinczon
Copy link
Contributor

I'll need that too, so I'll start working on it.
Did anyone already started something about it ?

@LeGoffLoic
Copy link
Owner

Can you do it with a flag to enable/disable directly exposed at attribute creation ?
Thanks ;)

@glm-ypinczon
Copy link
Contributor

Actually I intend to do it with an integer (rather than a flag) that tells the maximum connections count.
I'll do it also for plugs with the same interface.

Default values will be -1 for plugs (infinite connections) and 1 for sockets (only 1 connection), so that it doesn't change the behavior for the current code.

Does it sound oK for you ?

@LeGoffLoic
Copy link
Owner

Sounds good !

@p0las
Copy link

p0las commented Jun 28, 2018

that would be very cool! I use nodz to graph asset hierarchy. My solution is to create multiple plugs for "parent" every time a new connection is added. This makes the graphs ugly but solves the problem. I would love to be able to just connect multiple connections to a socket. Plugs can already to it so why not sockets?

@LeGoffLoic
Copy link
Owner

It was just how i designed it for a specific use case. But it should be fairly simple tu modify.

@p0las
Copy link

p0las commented Jun 28, 2018

a quick and dirty solution is to comment out a few lines in the SlotItem.connect method.

#        if len(self.connected_slots) > 0:
#            # Already connected.
#            self.connections[0]._remove()
#            self.connected_slots = list()

without that sockets are like plugs.

glm-ypinczon added a commit to glm-ypinczon/Nodz that referenced this issue Jul 5, 2018
…lickSignal

Added a signal_NodeRightClicked that is emitted when the user right click on a node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants