[Bf-blender-cvs] [8910033f572] geometry-nodes: Nodes: add utility methods

Jacques Lucke noreply at git.blender.org
Fri Oct 23 15:14:11 CEST 2020


Commit: 8910033f5720c36e3a702382307deb40af892ee3
Author: Jacques Lucke
Date:   Fri Oct 23 15:05:01 2020 +0200
Branches: geometry-nodes
https://developer.blender.org/rB8910033f5720c36e3a702382307deb40af892ee3

Nodes: add utility methods

===================================================================

M	source/blender/nodes/NOD_derived_node_tree.hh
M	source/blender/nodes/NOD_node_tree_ref.hh

===================================================================

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_;



More information about the Bf-blender-cvs mailing list