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.
Details
Details
- Reviewers
Hans Goudey (HooglyBoogly) - Maniphest Tasks
- T87536: Reroute points change types randomly
- Commits
- rBaf0b7925db51: Fix T87536: incorrect socket types in reroute nodes
Diff Detail
Diff Detail
- Repository
- rB Blender
Event Timeline
| 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. | |
