Page MenuHome

Nodes: Fix drag link from output to already linked Multi-Input Socket
ClosedPublic

Authored by Fabian Schempp (fabian_schempp) on Mar 10 2021, 10:09 PM.

Diff Detail

Repository
rB Blender

Event Timeline

Fabian Schempp (fabian_schempp) requested review of this revision.Mar 10 2021, 10:09 PM
Fabian Schempp (fabian_schempp) created this revision.
source/blender/editors/space_node/node_draw.cc
1763

Can you just use the contains method?

Hans Goudey (HooglyBoogly) added inline comments.
source/blender/editors/space_node/node_draw.cc
1751

Why not use a set? Then you just add the relevant links and use the resulting size.

Fabian Schempp (fabian_schempp) marked an inline comment as done.
  • Changes based on review by Hans Goudey and Jacques Lucke.

I'd go a bit further here. I suggest:

  1. Removing the incrementation of socket->total_inputs
  2. Using add instead of contains when counting temporary links
  3. Set total_inputs to visited_from_sockets.size() at the end of each loop.
  • Fixed unneeded whitespace change.
  • Change based on Review by Hans Goudey.

I'd go a bit further here. I suggest:

  1. Removing the incrementation of socket->total_inputs
  2. Using add instead of contains when counting temporary links
  3. Set total_inputs to visited_from_sockets.size() at the end of each loop.

beautiful.

Jacques Lucke (JacquesLucke) added inline comments.
source/blender/editors/space_node/node_relationships.c
897

I guess you can add a break here?

This revision is now accepted and ready to land.Mar 11 2021, 11:38 AM

Also, don't forget to add some explanation / background in the commit message.

Fabian Schempp (fabian_schempp) marked an inline comment as done.Mar 11 2021, 6:08 PM