Page MenuHome

Fix T87536: Incorrect socket types in reroute nodes.
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Sep 30 2021, 7:19 PM.

Details

Summary

This refactors and fixes the code that propagates socket types through reroute nodes.
In my tests it is faster than the previous code. The difference becomes larger the more reroute nodes there are, because the old code had O(n^2) runtime.

Diff Detail

Repository
rB Blender

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Sep 30 2021, 7:19 PM
Jacques Lucke (JacquesLucke) created this revision.
source/blender/nodes/intern/node_common.cc
340

I see this check in two other places in the code, but is it actually expected? It seems like the tree would be corrupt at that point.

368

Is this loop just for sockets that lead to disconnected reroutes like the following?


Otherwise I would think starting at an output socket would propagate the type.

source/blender/nodes/intern/node_common.cc
340

Probably. I'm not 100% sure how links are handled that are currently being dragged. Would just leave it in for now, because the old code checked for it as well.

368

Yes. First it propagates types from left to right. Then it tries to propagate types from right to left, but only affects reroutes that didn't get a type assigned before.

This revision is now accepted and ready to land.Sep 30 2021, 8:13 PM