Blender  V3.3
node_geo_common.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #include "BKE_node.h"
4 
5 #include "NOD_geometry.h"
6 
7 #include "NOD_common.h"
8 #include "node_common.h"
9 #include "node_geometry_util.hh"
10 
12 {
13  static bNodeType ntype;
14 
15  node_type_base_custom(&ntype, "GeometryNodeGroup", "Group", NODE_CLASS_GROUP);
16  ntype.type = NODE_GROUP;
20  ntype.rna_ext.srna = RNA_struct_find("GeometryNodeGroup");
21  BLI_assert(ntype.rna_ext.srna != nullptr);
23 
24  node_type_size(&ntype, 140, 60, 400);
27 
28  nodeRegisterType(&ntype);
29 }
30 
32 {
33  /* These methods can be overridden but need a default implementation otherwise. */
34  if (ntype->poll == nullptr) {
35  ntype->poll = geo_node_poll_default;
36  }
37  if (ntype->insert_link == nullptr) {
39  }
40 }
void node_type_base_custom(struct bNodeType *ntype, const char *idname, const char *name, short nclass)
Definition: node.cc:4311
void node_type_size(struct bNodeType *ntype, int width, int minwidth, int maxwidth)
Definition: node.cc:4396
void node_type_group_update(struct bNodeType *ntype, void(*group_update_func)(struct bNodeTree *ntree, struct bNode *node))
Definition: node.cc:4449
#define NODE_CLASS_GROUP
Definition: BKE_node.h:350
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1357
#define BLI_assert(a)
Definition: BLI_assert.h:46
NODE_GROUP
void node_group_update(struct bNodeTree *ntree, struct bNode *node)
Definition: node_common.cc:213
bool node_group_poll_instance(bNode *node, bNodeTree *nodetree, const char **disabled_hint)
Definition: node_common.cc:71
void node_group_label(const bNodeTree *UNUSED(ntree), const bNode *node, char *label, int maxlen)
Definition: node_common.cc:66
void register_node_type_geo_group()
void register_node_type_geo_custom_group(bNodeType *ntype)
bool geo_node_poll_default(bNodeType *UNUSED(ntype), bNodeTree *ntree, const char **r_disabled_hint)
void node_insert_link_default(bNodeTree *ntree, bNode *node, bNodeLink *link)
Definition: node_util.c:326
void RNA_struct_blender_type_set(StructRNA *srna, void *blender_type)
Definition: rna_access.c:902
StructRNA * RNA_struct_find(const char *identifier)
Definition: rna_access.c:581
StructRNA * srna
Definition: RNA_types.h:766
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
ExtensionRNA rna_ext
Definition: BKE_node.h:341
int type
Definition: BKE_node.h:228
void(* insert_link)(struct bNodeTree *ntree, struct bNode *node, struct bNodeLink *link)
Definition: BKE_node.h:301
void(* labelfunc)(const struct bNodeTree *ntree, const struct bNode *node, char *label, int maxlen)
Definition: BKE_node.h:256
bool(* poll_instance)(struct bNode *node, struct bNodeTree *nodetree, const char **r_disabled_hint)
Definition: BKE_node.h:296