Skip to content
Snippets Groups Projects
Commit ae739a61 authored by Omar Emara's avatar Omar Emara Committed by Omar Emara
Browse files

Fix #114530: Cryptomatte node not link drag searchable

The Cryptomatte node is not searchable in the link drag search operator.
That's because it still uses socket templates, which are no longer
supported for search since f5e6d4e4.

This patch fixes that by using the declare method instead of socket
templates.

Pull Request: https://projects.blender.org/blender/blender/pulls/114537
parent 05c56603
No related branches found
No related tags found
No related merge requests found
......@@ -228,9 +228,6 @@ CryptomatteSession *ntreeCompositCryptomatteSession(const Scene *scene, bNode *n
namespace blender::nodes::node_composite_cryptomatte_cc {
static bNodeSocketTemplate cmp_node_cryptomatte_in[] = {
{SOCK_RGBA, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f}, {-1, ""}};
static bNodeSocketTemplate cmp_node_cryptomatte_out[] = {
{SOCK_RGBA, N_("Image")},
{SOCK_FLOAT, N_("Matte")},
......@@ -238,6 +235,14 @@ static bNodeSocketTemplate cmp_node_cryptomatte_out[] = {
{-1, ""},
};
static void cmp_node_cryptomatte_declare(NodeDeclarationBuilder &b)
{
b.add_input<decl::Color>("Image").default_value({0.0f, 0.0f, 0.0f, 1.0f});
b.add_output<decl::Color>("Image");
b.add_output<decl::Float>("Matte");
b.add_output<decl::Color>("Pick");
}
static void node_init_cryptomatte(bNodeTree * /*ntree*/, bNode *node)
{
NodeCryptomatte *user = MEM_cnew<NodeCryptomatte>(__func__);
......@@ -334,8 +339,7 @@ void register_node_type_cmp_cryptomatte()
static bNodeType ntype;
cmp_node_type_base(&ntype, CMP_NODE_CRYPTOMATTE, "Cryptomatte", NODE_CLASS_MATTE);
blender::bke::node_type_socket_templates(
&ntype, file_ns::cmp_node_cryptomatte_in, file_ns::cmp_node_cryptomatte_out);
ntype.declare = file_ns::cmp_node_cryptomatte_declare;
blender::bke::node_type_size(&ntype, 240, 100, 700);
ntype.initfunc = file_ns::node_init_cryptomatte;
ntype.initfunc_api = file_ns::node_init_api_cryptomatte;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment