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  */
19 
20 /** \file
21  * \ingroup nodes
22  */
23 
24 #include "node_composite_util.h"
25 
cmp_node_poll_default(bNodeType * UNUSED (ntype),bNodeTree * ntree)26 bool cmp_node_poll_default(bNodeType *UNUSED(ntype), bNodeTree *ntree)
27 {
28   return STREQ(ntree->idname, "CompositorNodeTree");
29 }
30 
cmp_node_update_default(bNodeTree * UNUSED (ntree),bNode * node)31 void cmp_node_update_default(bNodeTree *UNUSED(ntree), bNode *node)
32 {
33   bNodeSocket *sock;
34   for (sock = node->outputs.first; sock; sock = sock->next) {
35     if (sock->cache) {
36       // free_compbuf(sock->cache);
37       // sock->cache = NULL;
38     }
39   }
40   node->need_exec = 1;
41 }
42 
cmp_node_type_base(bNodeType * ntype,int type,const char * name,short nclass,short flag)43 void cmp_node_type_base(bNodeType *ntype, int type, const char *name, short nclass, short flag)
44 {
45   node_type_base(ntype, type, name, nclass, flag);
46 
47   ntype->poll = cmp_node_poll_default;
48   ntype->updatefunc = cmp_node_update_default;
49   ntype->insert_link = node_insert_link_default;
50   ntype->update_internal_links = node_update_internal_links_default;
51 }
52