python api for ID property access by Joseph Eager, copied from blender 2.4x.
[blender.git] / source / blender / makesrna / intern / rna_actuator.c
1 /**
2  * $Id$
3  *
4  * ***** BEGIN GPL LICENSE BLOCK *****
5  *
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.
10  *
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.
15  *
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.
19  *
20  * Contributor(s): Blender Foundation (2008).
21  *
22  * ***** END GPL LICENSE BLOCK *****
23  */
24
25 #include <stdlib.h>
26
27 #include "RNA_define.h"
28 #include "RNA_types.h"
29
30 #include "rna_internal.h"
31
32 #include "DNA_actuator_types.h"
33
34 #ifdef RNA_RUNTIME
35
36 #else
37
38 void RNA_def_actuator(BlenderRNA *brna)
39 {
40         StructRNA *srna;
41         PropertyRNA *prop;
42
43         static EnumPropertyItem actuator_type_items[] ={
44                 {ACT_OBJECT, "OBJECT", 0, "Object", ""},
45                 {ACT_IPO, "IPO", 0, "IPO", ""},
46                 {ACT_CAMERA, "CAMERA", 0, "Camera", ""},
47                 {ACT_SOUND, "SOUND", 0, "Sound", ""},
48                 {ACT_PROPERTY, "PROPERTY", 0, "Property", ""},
49                 {ACT_CONSTRAINT, "CONSTRAINT", 0, "Constraint", ""},
50                 {ACT_EDIT_OBJECT, "EDIT_OBJECT", 0, "Edit Object", ""},
51                 {ACT_SCENE, "SCENE", 0, "Scene", ""},
52                 {ACT_RANDOM, "RANDOM", 0, "Random", ""},
53                 {ACT_MESSAGE, "MESSAGE", 0, "Message", ""},
54                 {ACT_ACTION, "ACTION", 0, "Action", ""},
55                 {ACT_GAME, "GAME", 0, "Game", ""},
56                 {ACT_VISIBILITY, "VISIBILITY", 0, "Visibility", ""},
57                 {ACT_2DFILTER, "FILTER_2D", 0, "2D Filter", ""},
58                 {ACT_PARENT, "PARENT", 0, "Parent", ""},
59                 {ACT_SHAPEACTION, "SHAPE_ACTION", 0, "Shape Action", ""},
60                 {ACT_STATE, "STATE", 0, "State", ""},
61                 {ACT_ARMATURE, "ARMATURE", 0, "Armature", ""},
62                 {0, NULL, 0, NULL, NULL}};
63
64         srna= RNA_def_struct(brna, "Actuator", NULL);
65         RNA_def_struct_ui_text(srna, "Actuator", "Game engine logic brick to apply actions in the game engine.");
66         
67         RNA_def_struct_sdna(srna, "bActuator");
68
69         prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
70         RNA_def_property_ui_text(prop, "Name", "");
71
72         /* type is not editable, would need to do proper data free/alloc */
73         prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
74         RNA_def_property_clear_flag(prop, PROP_EDITABLE);
75         RNA_def_property_enum_items(prop, actuator_type_items);
76         RNA_def_property_ui_text(prop, "Type", "");
77
78 }
79
80 #endif
81