Blender  V3.3
node_composite_common.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2006 Blender Foundation. All rights reserved. */
3 
8 #include "DNA_node_types.h"
9 
10 #include "NOD_common.h"
11 #include "node_common.h"
12 #include "node_composite_util.hh"
13 
14 #include "BKE_node.h"
15 
16 #include "RNA_access.h"
17 
19 {
20  static bNodeType ntype;
21 
22  /* NOTE: Cannot use sh_node_type_base for node group, because it would map the node type
23  * to the shared NODE_GROUP integer type id. */
24  node_type_base_custom(&ntype, "CompositorNodeGroup", "Group", NODE_CLASS_GROUP);
25  ntype.type = NODE_GROUP;
29  ntype.rna_ext.srna = RNA_struct_find("CompositorNodeGroup");
30  BLI_assert(ntype.rna_ext.srna != nullptr);
32 
33  node_type_size(&ntype, 140, 60, 400);
36 
37  nodeRegisterType(&ntype);
38 }
39 
41 {
42  /* These methods can be overridden but need a default implementation otherwise. */
43  if (ntype->poll == nullptr) {
44  ntype->poll = cmp_node_poll_default;
45  }
46  if (ntype->insert_link == nullptr) {
48  }
49 }
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_cmp_group()
void register_node_type_cmp_custom_group(bNodeType *ntype)
bool cmp_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