2022-02-11 09:07:11 +11:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2020-04-20 15:27:12 +02:00
|
|
|
|
2020-07-07 18:23:33 +02:00
|
|
|
#include "node_function_util.hh"
|
2020-04-20 15:27:12 +02:00
|
|
|
#include "node_util.h"
|
|
|
|
|
|
2021-12-15 09:51:57 -06:00
|
|
|
#include "NOD_socket_search_link.hh"
|
|
|
|
|
|
2022-12-28 20:15:41 -05:00
|
|
|
static bool fn_node_poll_default(const bNodeType * /*ntype*/,
|
|
|
|
|
const bNodeTree *ntree,
|
2021-04-12 18:43:23 +02:00
|
|
|
const char **r_disabled_hint)
|
2020-04-20 15:27:12 +02:00
|
|
|
{
|
|
|
|
|
/* Function nodes are only supported in simulation node trees so far. */
|
2021-04-12 18:43:23 +02:00
|
|
|
if (!STREQ(ntree->idname, "GeometryNodeTree")) {
|
2021-12-01 21:55:04 -05:00
|
|
|
*r_disabled_hint = TIP_("Not a geometry node tree");
|
2021-04-12 18:43:23 +02:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
2020-04-20 15:27:12 +02:00
|
|
|
}
|
|
|
|
|
|
2022-01-03 19:32:33 -05:00
|
|
|
void fn_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
|
2020-04-20 15:27:12 +02:00
|
|
|
{
|
2022-01-03 19:32:33 -05:00
|
|
|
node_type_base(ntype, type, name, nclass);
|
2020-04-20 15:27:12 +02:00
|
|
|
ntype->poll = fn_node_poll_default;
|
2020-12-02 16:31:06 +01:00
|
|
|
ntype->insert_link = node_insert_link_default;
|
2021-12-15 09:51:57 -06:00
|
|
|
ntype->gather_link_search_ops = blender::nodes::search_link_ops_for_basic_node;
|
2020-04-20 15:27:12 +02:00
|
|
|
}
|