2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2007 Blender Foundation.
19 * All rights reserved.
21 * The Original Code is: all of this file.
23 * Contributor(s): Lukas Toenne
25 * ***** END GPL LICENSE BLOCK *****
28 /** \file NOD_socket.h
33 #ifndef __NOD_SOCKET_H__
34 #define __NOD_SOCKET_H__
36 #include "DNA_listBase.h"
38 #include "BLI_utildefines.h"
42 #include "RNA_types.h"
48 void node_socket_type_init(struct bNodeSocketType *types[]);
50 void *node_socket_make_default_value(int type);
51 void node_socket_free_default_value(int type, void *default_value);
52 void node_socket_init_default_value(int type, void *default_value);
53 void node_socket_copy_default_value(int type, void *to_default_value, void *from_default_value);
54 void node_socket_convert_default_value(int to_type, void *to_default_value, int from_type, void *from_default_value);
56 void node_socket_set_default_value_int(void *default_value, PropertySubType subtype, int value, int min, int max);
57 void node_socket_set_default_value_float(void *default_value, PropertySubType subtype, float value, float min, float max);
58 void node_socket_set_default_value_boolean(void *default_value, char value);
59 void node_socket_set_default_value_vector(void *default_value, PropertySubType subtype, float x, float y, float z, float min, float max);
60 void node_socket_set_default_value_rgba(void *default_value, float r, float g, float b, float a);
61 void node_socket_set_default_value_shader(void *default_value);
62 void node_socket_set_default_value_mesh(void *default_value);
64 struct bNodeSocket *node_add_input_from_template(struct bNodeTree *ntree, struct bNode *node, struct bNodeSocketTemplate *stemp);
65 struct bNodeSocket *node_add_output_from_template(struct bNodeTree *ntree, struct bNode *node, struct bNodeSocketTemplate *stemp);
67 void node_verify_socket_templates(struct bNodeTree *ntree, struct bNode *node);
70 /* Socket Converters */
72 #define SOCK_VECTOR_X 1
73 #define SOCK_VECTOR_Y 2
74 #define SOCK_VECTOR_Z 3
81 #define SOCK_MESH_VERT_CO 1
82 #define SOCK_MESH_VERT_NO 2