Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-03-20 00:33:43 +0300
committerJacques Lucke <jacques@blender.org>2021-03-20 00:33:43 +0300
commit087f8a78f80220f0265ac9de73ce175fd537d13f (patch)
tree27e19a82807ce79ea072cf595cd24e4b1ecdbce4
parent2dd055b2d4582b8a32bcea0efc937e128809ff27 (diff)
Nodes: expose tree name and whether a node is a frame in node tree ref
-rw-r--r--source/blender/nodes/NOD_node_tree_ref.hh12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/nodes/NOD_node_tree_ref.hh b/source/blender/nodes/NOD_node_tree_ref.hh
index 9302f14c3a4..1ac281028df 100644
--- a/source/blender/nodes/NOD_node_tree_ref.hh
+++ b/source/blender/nodes/NOD_node_tree_ref.hh
@@ -177,6 +177,7 @@ class NodeRef : NonCopyable, NonMovable {
bool is_group_input_node() const;
bool is_group_output_node() const;
bool is_muted() const;
+ bool is_frame() const;
void *storage() const;
template<typename T> T *storage() const;
@@ -242,6 +243,7 @@ class NodeTreeRef : NonCopyable, NonMovable {
bool has_link_cycles() const;
bNodeTree *btree() const;
+ StringRefNull name() const;
std::string to_dot() const;
@@ -529,6 +531,11 @@ inline bool NodeRef::is_group_output_node() const
return bnode_->type == NODE_GROUP_OUTPUT;
}
+inline bool NodeRef::is_frame() const
+{
+ return bnode_->type == NODE_FRAME;
+}
+
inline bool NodeRef::is_muted() const
{
return (bnode_->flag & NODE_MUTED) != 0;
@@ -632,4 +639,9 @@ inline bNodeTree *NodeTreeRef::btree() const
return btree_;
}
+inline StringRefNull NodeTreeRef::name() const
+{
+ return btree_->id.name + 2;
+}
+
} // namespace blender::nodes