Blender  V2.59
node_util.c
Go to the documentation of this file.
00001 /*
00002  * $Id: node_util.c 35623 2011-03-19 10:26:15Z blendix $
00003  *
00004  * ***** BEGIN GPL LICENSE BLOCK *****
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version. 
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  *
00020  * The Original Code is Copyright (C) 2007 Blender Foundation.
00021  * All rights reserved.
00022  *
00023  * The Original Code is: all of this file.
00024  *
00025  * Contributor(s): Nathan Letwory.
00026  *
00027  * ***** END GPL LICENSE BLOCK *****
00028  */
00029 
00035 #include "CMP_util.h"
00036 #include "SHD_util.h"
00037 
00038 #include "RNA_access.h"
00039 #include "RNA_enum_types.h"
00040 
00041 void node_free_curves(bNode *node)
00042 {
00043         curvemapping_free(node->storage);
00044 }
00045 
00046 void node_free_standard_storage(bNode *node)
00047 {
00048         MEM_freeN(node->storage);
00049 }
00050 
00051 void node_copy_curves(bNode *orig_node, bNode *new_node)
00052 {
00053         new_node->storage= curvemapping_copy(orig_node->storage);
00054 }
00055 
00056 void node_copy_standard_storage(bNode *orig_node, bNode *new_node)
00057 {
00058         new_node->storage= MEM_dupallocN(orig_node->storage);
00059 }
00060 
00061 const char *node_blend_label(bNode *node)
00062 {
00063         const char *name;
00064         RNA_enum_name(ramp_blend_items, node->custom1, &name);
00065         return name;
00066 }
00067 
00068 const char *node_math_label(bNode *node)
00069 {
00070         const char *name;
00071         RNA_enum_name(node_math_items, node->custom1, &name);
00072         return name;
00073 }
00074 
00075 const char *node_vect_math_label(bNode *node)
00076 {
00077         const char *name;
00078         RNA_enum_name(node_vec_math_items, node->custom1, &name);
00079         return name;
00080 }
00081 
00082 const char *node_filter_label(bNode *node)
00083 {
00084         const char *name;
00085         RNA_enum_name(node_filter_items, node->custom1, &name);
00086         return name;
00087 }