diff options
author | Hans Goudey <h.goudey@me.com> | 2022-09-06 20:11:04 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-09-06 20:14:04 +0300 |
commit | 545fb528d5e10be13e098aae2a7c921243ca380f (patch) | |
tree | 723a0cef443fd1d59dcbe69f84a8cbb8d473c73e /source/blender/blenkernel/BKE_node_runtime.hh | |
parent | 1d24586a900daa4ea24bce8acc3708237b3c2a87 (diff) |
Cleanup: Avoid using runtime node flag, use topology cache
It's easier to keep track of state in these algorithms if it's stored in
a central place like a set. Plus, using flags requires clearing them
beforehand. For the selected linked operators, using the topology
cache means we don't have to iterate over all links.
Diffstat (limited to 'source/blender/blenkernel/BKE_node_runtime.hh')
-rw-r--r-- | source/blender/blenkernel/BKE_node_runtime.hh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_node_runtime.hh b/source/blender/blenkernel/BKE_node_runtime.hh index 4c13f73848c..49a6953d0a3 100644 --- a/source/blender/blenkernel/BKE_node_runtime.hh +++ b/source/blender/blenkernel/BKE_node_runtime.hh @@ -481,6 +481,12 @@ inline blender::Span<const bNodeSocket *> bNodeSocket::directly_linked_sockets() return this->runtime->directly_linked_sockets; } +inline blender::Span<bNodeSocket *> bNodeSocket::directly_linked_sockets() +{ + BLI_assert(blender::bke::node_tree_runtime::topology_cache_is_available(*this)); + return this->runtime->directly_linked_sockets; +} + inline bool bNodeSocket::is_directly_linked() const { return !this->directly_linked_links().is_empty(); |