diff options
author | Jacques Lucke <jacques@blender.org> | 2021-12-24 14:34:04 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-12-24 14:34:04 +0300 |
commit | ba4b7b43195c17436beaba95956087be4fb746a9 (patch) | |
tree | a644a2dac2129ca06b878721f677dd21fb192a76 /source/blender/nodes/NOD_node_tree_ref.hh | |
parent | c0db8a9a3beed8cae7f4f138f46a9efcaff7b054 (diff) |
Fix T94162: incorrect handling when there are multiple group outputs
Typically a node group should only have a single Group Output node.
However, currently Blender already supports having multiple group outputs,
one of which is active. This wasn't handled correctly by geometry nodes.
Differential Revision: https://developer.blender.org/D13611
Diffstat (limited to 'source/blender/nodes/NOD_node_tree_ref.hh')
-rw-r--r-- | source/blender/nodes/NOD_node_tree_ref.hh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/nodes/NOD_node_tree_ref.hh b/source/blender/nodes/NOD_node_tree_ref.hh index 65789069231..ebbec20a139 100644 --- a/source/blender/nodes/NOD_node_tree_ref.hh +++ b/source/blender/nodes/NOD_node_tree_ref.hh @@ -262,6 +262,7 @@ class NodeTreeRef : NonCopyable, NonMovable { Vector<LinkRef *> links_; MultiValueMap<const bNodeType *, NodeRef *> nodes_by_type_; Vector<std::unique_ptr<SocketIndexByIdentifierMap>> owned_identifier_maps_; + const NodeRef *group_output_node_ = nullptr; public: NodeTreeRef(bNodeTree *btree); @@ -280,6 +281,11 @@ class NodeTreeRef : NonCopyable, NonMovable { const NodeRef *find_node(const bNode &bnode) const; /** + * This is the active group output node if there are multiple. + */ + const NodeRef *group_output_node() const; + + /** * \return True when there is a link cycle. Unavailable sockets are ignored. */ bool has_link_cycles() const; @@ -759,6 +765,11 @@ inline Span<const LinkRef *> NodeTreeRef::links() const return links_; } +inline const NodeRef *NodeTreeRef::group_output_node() const +{ + return group_output_node_; +} + inline bNodeTree *NodeTreeRef::btree() const { return btree_; |