4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * Contributor(s): Blender Foundation (2008).
22 * ***** END GPL LICENSE BLOCK *****
27 #include "RNA_define.h"
28 #include "RNA_types.h"
30 #include "rna_internal.h"
32 #include "DNA_ipo_types.h"
36 void *rna_Ipo_ipocurves_get(CollectionPropertyIterator *iter)
38 ListBaseIterator *internal= iter->internal;
40 return ((Base*)internal->link)->object;
45 void rna_def_ipodriver(BlenderRNA *brna)
49 static EnumPropertyItem prop_type_items[] = {
50 {IPO_DRIVER_TYPE_NORMAL, "NORMAL", "Normal", ""},
51 {IPO_DRIVER_TYPE_PYTHON, "SCRIPTED", "Scripted", ""},
52 {0, NULL, NULL, NULL}};
54 srna= RNA_def_struct(brna, "IpoDriver", NULL, "Ipo Driver");
57 prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
58 RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
59 RNA_def_property_enum_items(prop, prop_type_items);
60 RNA_def_property_ui_text(prop, "Type", "Ipo Driver types.");
63 prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
64 RNA_def_property_string_sdna(prop, NULL, "name");
65 RNA_def_property_ui_text(prop, "Name", "Bone name or scripting expression.");
69 prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
70 RNA_def_property_struct_type(prop, "Object");
71 RNA_def_property_pointer_sdna(prop, NULL, "ob");
72 RNA_def_property_ui_text(prop, "Driver Object", "Object that controls this Ipo Driver.");
76 void rna_def_ipocurve(BlenderRNA *brna)
81 srna= RNA_def_struct(brna, "IpoCurve", NULL, "Ipo Curve");
85 prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
86 RNA_def_property_float_sdna(prop, NULL, "curval");
87 RNA_def_property_ui_text(prop, "Value", "Value of this Ipo Curve at the current frame.");
91 prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
92 RNA_def_property_struct_type(prop, "IpoDriver");
93 RNA_def_property_pointer_sdna(prop, NULL, "driver");
94 RNA_def_property_ui_text(prop, "Ipo Driver", "");
97 void rna_def_ipo(BlenderRNA *brna)
102 srna= RNA_def_struct(brna, "Ipo", "ID", "Ipo");
106 prop= RNA_def_property(srna, "show_key", PROP_BOOLEAN, PROP_NONE);
107 RNA_def_property_boolean_sdna(prop, NULL, "showkey", 0);
108 RNA_def_property_ui_text(prop, "Show Keys", "Show Ipo Keys.");
110 prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
111 RNA_def_property_boolean_sdna(prop, NULL, "muteipo", 0);
112 RNA_def_property_ui_text(prop, "Mute", "Mute this Ipo block.");
116 prop= RNA_def_property(srna, "curves", PROP_COLLECTION, PROP_NONE);
117 RNA_def_property_collection_sdna(prop, NULL, "curve", NULL);
118 RNA_def_property_struct_type(prop, "IpoCurve");
119 RNA_def_property_ui_text(prop, "Curves", "");
120 RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Ipo_ipocurves_get", 0, 0, 0, 0);
124 void RNA_def_ipo(BlenderRNA *brna)
127 rna_def_ipocurve(brna);
128 rna_def_ipodriver(brna);