Blender  V3.3
node_function_util.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #include "node_function_util.hh"
4 #include "node_util.h"
5 
7 
8 static bool fn_node_poll_default(bNodeType *UNUSED(ntype),
10  const char **r_disabled_hint)
11 {
12  /* Function nodes are only supported in simulation node trees so far. */
13  if (!STREQ(ntree->idname, "GeometryNodeTree")) {
14  *r_disabled_hint = TIP_("Not a geometry node tree");
15  return false;
16  }
17  return true;
18 }
19 
20 void fn_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
21 {
22  node_type_base(ntype, type, name, nclass);
23  ntype->poll = fn_node_poll_default;
26 }
void node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass)
Definition: node.cc:4277
#define UNUSED(x)
#define STREQ(a, b)
#define TIP_(msgid)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
bNodeTree * ntree
void search_link_ops_for_basic_node(GatherLinkSearchOpParams &params)
static bool fn_node_poll_default(bNodeType *UNUSED(ntype), bNodeTree *ntree, const char **r_disabled_hint)
void fn_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
void node_insert_link_default(bNodeTree *ntree, bNode *node, bNodeLink *link)
Definition: node_util.c:326
char idname[64]
Defines a node type.
Definition: BKE_node.h:226
bool(* poll)(struct bNodeType *ntype, struct bNodeTree *nodetree, const char **r_disabled_hint)
Definition: BKE_node.h:292
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
Definition: BKE_node.h:335
void(* insert_link)(struct bNodeTree *ntree, struct bNode *node, struct bNodeLink *link)
Definition: BKE_node.h:301