diff options
author | Jacques Lucke <jacques@blender.org> | 2020-10-23 16:05:01 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-10-23 16:05:01 +0300 |
commit | 8910033f5720c36e3a702382307deb40af892ee3 (patch) | |
tree | ec592e7887036e2249d83507a75fe15502598574 | |
parent | 2a4c6c612a2ee0e642b8f5ce1dd671e427a85b0a (diff) |
Nodes: add utility methods
-rw-r--r-- | source/blender/nodes/NOD_derived_node_tree.hh | 24 | ||||
-rw-r--r-- | source/blender/nodes/NOD_node_tree_ref.hh | 6 |
2 files changed, 30 insertions, 0 deletions
diff --git a/source/blender/nodes/NOD_derived_node_tree.hh b/source/blender/nodes/NOD_derived_node_tree.hh index 9c71ae79cf2..1a9f223cf6c 100644 --- a/source/blender/nodes/NOD_derived_node_tree.hh +++ b/source/blender/nodes/NOD_derived_node_tree.hh @@ -65,6 +65,8 @@ class DSocket : NonCopyable, NonMovable { PointerRNA *rna() const; StringRefNull idname() const; StringRefNull name() const; + StringRefNull identifier() const; + bNodeSocketType *typeinfo() const; const SocketRef &socket_ref() const; bNodeSocket *bsocket() const; @@ -147,6 +149,8 @@ class DNode : NonCopyable, NonMovable { PointerRNA *rna() const; StringRefNull idname() const; StringRefNull name() const; + bNode *bnode() const; + bNodeType *typeinfo() const; private: void destruct_with_sockets(); @@ -288,6 +292,16 @@ inline StringRefNull DSocket::name() const return socket_ref_->name(); } +inline StringRefNull DSocket::identifier() const +{ + return socket_ref_->identifier(); +} + +inline bNodeSocketType *DSocket::typeinfo() const +{ + return socket_ref_->bsocket()->typeinfo; +} + inline const SocketRef &DSocket::socket_ref() const { return *socket_ref_; @@ -445,6 +459,16 @@ inline StringRefNull DNode::name() const return node_ref_->name(); } +inline bNode *DNode::bnode() const +{ + return node_ref_->bnode(); +} + +inline bNodeType *DNode::typeinfo() const +{ + return node_ref_->bnode()->typeinfo; +} + /* -------------------------------------------------------------------- * DParentNode inline methods. */ diff --git a/source/blender/nodes/NOD_node_tree_ref.hh b/source/blender/nodes/NOD_node_tree_ref.hh index 3b085248a39..c3fc95d98e4 100644 --- a/source/blender/nodes/NOD_node_tree_ref.hh +++ b/source/blender/nodes/NOD_node_tree_ref.hh @@ -101,6 +101,7 @@ class SocketRef : NonCopyable, NonMovable { StringRefNull idname() const; StringRefNull name() const; + StringRefNull identifier() const; bNodeSocket *bsocket() const; bNode *bnode() const; @@ -272,6 +273,11 @@ inline StringRefNull SocketRef::name() const return bsocket_->name; } +inline StringRefNull SocketRef::identifier() const +{ + return bsocket_->identifier; +} + inline bNodeSocket *SocketRef::bsocket() const { return bsocket_; |