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:
authorAaron Carlisle <Blendify>2021-12-06 19:59:26 +0300
committerAaron Carlisle <carlisle.b3d@gmail.com>2021-12-06 19:59:52 +0300
commit0bd3cad04edf4bf9b9d3b1353f955534aa5e6740 (patch)
tree1ab5bd8afd56508e8672b6448dd8462e1941fb40 /source/blender/nodes/NOD_socket_declarations.hh
parentf72cc47d8edf849af98e196f721022bacf86a5e7 (diff)
Nodes: Add Shader Socket to new decleration API
This commit adds the shader socket type to the new socket builder api. As a test, this commit also converts the Add Shader node to the new API Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D13485
Diffstat (limited to 'source/blender/nodes/NOD_socket_declarations.hh')
-rw-r--r--source/blender/nodes/NOD_socket_declarations.hh15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/nodes/NOD_socket_declarations.hh b/source/blender/nodes/NOD_socket_declarations.hh
index 7cb32a37ae2..7284accd1ec 100644
--- a/source/blender/nodes/NOD_socket_declarations.hh
+++ b/source/blender/nodes/NOD_socket_declarations.hh
@@ -212,6 +212,21 @@ class Image : public IDSocketDeclaration {
Image();
};
+class ShaderBuilder;
+
+class Shader : public SocketDeclaration {
+ private:
+ friend ShaderBuilder;
+
+ public:
+ using Builder = ShaderBuilder;
+
+ bNodeSocket &build(bNodeTree &ntree, bNode &node, eNodeSocketInOut in_out) const override;
+ bool matches(const bNodeSocket &socket) const override;
+};
+
+class ShaderBuilder : public SocketDeclarationBuilder<Shader> {};
+
/* -------------------------------------------------------------------- */
/** \name #FloatBuilder Inline Methods
* \{ */