diff options
author | Aaron Carlisle <carlisle.b3d@gmail.com> | 2021-12-08 05:05:13 +0300 |
---|---|---|
committer | Aaron Carlisle <carlisle.b3d@gmail.com> | 2021-12-08 05:05:13 +0300 |
commit | 333dc7b5c4ee44986294c6b5683fa4813454279b (patch) | |
tree | e2341a03b9310207833517a7e970d9e94d37bac4 /source/blender/nodes/intern | |
parent | 0d8c479225d754ba376e442d56ffa935956427cf (diff) |
Nodes: Add Shader Socket to new decleration API
This commit adds the shader socket type to the new socket builder api.
Re commits part of rB0bd3cad04edf4bf9b9d3b1353f955534aa5e6740
Diffstat (limited to 'source/blender/nodes/intern')
-rw-r--r-- | source/blender/nodes/intern/node_socket_declarations.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/nodes/intern/node_socket_declarations.cc b/source/blender/nodes/intern/node_socket_declarations.cc index ed5691ebf7f..1795cc339e7 100644 --- a/source/blender/nodes/intern/node_socket_declarations.cc +++ b/source/blender/nodes/intern/node_socket_declarations.cc @@ -376,4 +376,29 @@ GeometryBuilder &GeometryBuilder::only_instances(bool value) /** \} */ +/* -------------------------------------------------------------------- */ +/** \name #Shader + * \{ */ + +bNodeSocket &Shader::build(bNodeTree &ntree, bNode &node, eNodeSocketInOut in_out) const +{ + bNodeSocket &socket = *nodeAddSocket( + &ntree, &node, in_out, "NodeSocketShader", identifier_.c_str(), name_.c_str()); + this->set_common_flags(socket); + return socket; +} + +bool Shader::matches(const bNodeSocket &socket) const +{ + if (!this->matches_common_data(socket)) { + return false; + } + if (socket.type != SOCK_SHADER) { + return false; + } + return true; +} + +/** \} */ + } // namespace blender::nodes::decl |