Blender V5.0
node_function_util.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#include <optional>
6
8#include "node_util.hh"
9
11
12static bool fn_node_poll_default(const blender::bke::bNodeType * /*ntype*/,
13 const bNodeTree *ntree,
14 const char **r_disabled_hint)
15{
16 /* Function nodes are only supported in simulation node trees so far. */
17 if (!STREQ(ntree->idname, "GeometryNodeTree")) {
18 *r_disabled_hint = RPT_("Not a geometry node tree");
19 return false;
20 }
21 return true;
22}
23
25 std::string idname,
26 const std::optional<int16_t> legacy_type)
27{
28 blender::bke::node_type_base(*ntype, idname, legacy_type);
32}
#define STREQ(a, b)
#define RPT_(msgid)
void node_type_base(bNodeType &ntype, std::string idname, std::optional< int16_t > legacy_type=std::nullopt)
Definition node.cc:5099
void search_link_ops_for_basic_node(GatherLinkSearchOpParams &params)
void fn_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
static bool fn_node_poll_default(const blender::bke::bNodeType *, const bNodeTree *ntree, const char **r_disabled_hint)
bool node_insert_link_default(blender::bke::NodeInsertLinkParams &)
Definition node_util.cc:266
char idname[64]
Defines a node type.
Definition BKE_node.hh:238
bool(* insert_link)(NodeInsertLinkParams &params)
Definition BKE_node.hh:333
bool(* poll)(const bNodeType *ntype, const bNodeTree *nodetree, const char **r_disabled_hint)
Definition BKE_node.hh:321
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
Definition BKE_node.hh:378