Blender  V2.93
node_composite_common.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2006 Blender Foundation.
17  * All rights reserved.
18  * Juho Vepsäläinen
19  */
20 
25 #include "DNA_node_types.h"
26 
27 #include "NOD_common.h"
28 #include "node_common.h"
29 #include "node_composite_util.h"
30 
31 #include "BKE_node.h"
32 
33 #include "RNA_access.h"
34 
36 {
37  static bNodeType ntype;
38 
39  /* NB: cannot use sh_node_type_base for node group, because it would map the node type
40  * to the shared NODE_GROUP integer type id.
41  */
43  &ntype, "CompositorNodeGroup", "Group", NODE_CLASS_GROUP, NODE_CONST_OUTPUT);
44  ntype.type = NODE_GROUP;
49  ntype.rna_ext.srna = RNA_struct_find("CompositorNodeGroup");
50  BLI_assert(ntype.rna_ext.srna != NULL);
52 
54  node_type_size(&ntype, 140, 60, 400);
57 
58  nodeRegisterType(&ntype);
59 }
60 
62 {
63  /* These methods can be overridden but need a default implementation otherwise. */
64  if (ntype->poll == NULL) {
65  ntype->poll = cmp_node_poll_default;
66  }
67  if (ntype->insert_link == NULL) {
69  }
70  if (ntype->update_internal_links == NULL) {
72  }
73 }
void node_type_size(struct bNodeType *ntype, int width, int minwidth, int maxwidth)
Definition: node.cc:4565
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs)
Definition: node.cc:4527
void node_type_base_custom(struct bNodeType *ntype, const char *idname, const char *name, short nclass, short flag)
Definition: node.cc:4478
void node_type_group_update(struct bNodeType *ntype, void(*group_update_func)(struct bNodeTree *ntree, struct bNode *node))
Definition: node.cc:4629
#define NODE_CLASS_GROUP
Definition: BKE_node.h:339
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1298
void node_type_label(struct bNodeType *ntype, void(*labelfunc)(struct bNodeTree *ntree, struct bNode *, char *label, int maxlen))
#define BLI_assert(a)
Definition: BLI_assert.h:58
#define NODE_CONST_OUTPUT
NODE_GROUP
void node_group_update(struct bNodeTree *ntree, struct bNode *node)
Definition: node_common.c:187
bool node_group_poll_instance(bNode *node, bNodeTree *nodetree, const char **disabled_hint)
Definition: node_common.c:82
void node_group_label(bNodeTree *UNUSED(ntree), bNode *node, char *label, int maxlen)
Definition: node_common.c:77
void register_node_type_cmp_group(void)
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:305
void node_update_internal_links_default(bNodeTree *ntree, bNode *node)
Definition: node_util.c:503
void RNA_struct_blender_type_set(StructRNA *srna, void *blender_type)
Definition: rna_access.c:1044
StructRNA * RNA_struct_find(const char *identifier)
Definition: rna_access.c:718
StructRNA * srna
Definition: RNA_types.h:681
Defines a node type.
Definition: BKE_node.h:221
bool(* poll)(struct bNodeType *ntype, struct bNodeTree *nodetree, const char **r_disabled_hint)
Definition: BKE_node.h:301
void(* update_internal_links)(struct bNodeTree *, struct bNode *node)
Definition: BKE_node.h:312
ExtensionRNA rna_ext
Definition: BKE_node.h:330
int type
Definition: BKE_node.h:225
void(* insert_link)(struct bNodeTree *ntree, struct bNode *node, struct bNodeLink *link)
Definition: BKE_node.h:310
bool(* poll_instance)(struct bNode *node, struct bNodeTree *nodetree, const char **r_disabled_hint)
Definition: BKE_node.h:305