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 <carlisle.b3d@gmail.com>2021-12-07 02:51:19 +0300
committerAaron Carlisle <carlisle.b3d@gmail.com>2021-12-07 02:52:08 +0300
commit97e3a2d935ba9b21b127eda7ca104d4bcf4e48bd (patch)
tree586cc0aad98acad4e1452ff4917a7ef56ce72fcb /source/blender/nodes/shader/nodes/node_shader_holdout.cc
parentb1696702cdb74c2b6d7c8c3f9d204f108607a8ab (diff)
Shader Nodes: Migrate shader category to new node socket declaration API
No functional changes, tests passed and I double checked the nodes by hand.
Diffstat (limited to 'source/blender/nodes/shader/nodes/node_shader_holdout.cc')
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_holdout.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_holdout.cc b/source/blender/nodes/shader/nodes/node_shader_holdout.cc
index a0e8124d9dd..02bfda39d78 100644
--- a/source/blender/nodes/shader/nodes/node_shader_holdout.cc
+++ b/source/blender/nodes/shader/nodes/node_shader_holdout.cc
@@ -23,14 +23,10 @@
namespace blender::nodes::node_shader_holdout_cc {
-static bNodeSocketTemplate sh_node_holdout_in[] = {
- {-1, ""},
-};
-
-static bNodeSocketTemplate sh_node_holdout_out[] = {
- {SOCK_SHADER, N_("Holdout")},
- {-1, ""},
-};
+static void node_declare(NodeDeclarationBuilder &b)
+{
+ b.add_output<decl::Shader>(N_("Holdout"));
+}
static int gpu_shader_rgb(GPUMaterial *mat,
bNode *node,
@@ -51,7 +47,7 @@ void register_node_type_sh_holdout()
static bNodeType ntype;
sh_node_type_base(&ntype, SH_NODE_HOLDOUT, "Holdout", NODE_CLASS_SHADER, 0);
- node_type_socket_templates(&ntype, file_ns::sh_node_holdout_in, file_ns::sh_node_holdout_out);
+ ntype.declare = file_ns::node_declare;
node_type_init(&ntype, nullptr);
node_type_storage(&ntype, "", nullptr, nullptr);
node_type_gpu(&ntype, file_ns::gpu_shader_rgb);