~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/python/api2_2x/Types.c

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* 
2
 
 *
 
2
 * $Id: Types.c,v 1.21 2005/05/22 17:40:00 stiv Exp $
3
3
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
4
4
 *
5
5
 * This program is free software; you can redistribute it and/or
31
31
 
32
32
#include "Types.h"
33
33
 
34
 
char M_Types_doc[] =
35
 
"The Blender Types module\n\n\
 
34
char M_Types_doc[] = "The Blender Types module\n\n\
36
35
This module is a dictionary of all Blender Python types";
37
36
 
38
 
struct PyMethodDef Null_methods[] = {{NULL, NULL}};
39
 
 
40
 
void types_InitAll(void)
 
37
struct PyMethodDef Null_methods[] = { {NULL, NULL, 0, NULL} };
 
38
 
 
39
 
 
40
 
 
41
/* The internal types (lowercase first letter, like constant_Type) are only
 
42
 * set when some object initializes them.  But unless we do it early, we get
 
43
 * some easy and unpredictable (varies with platform, even distro) ways to
 
44
 * crash Blender.  Some modules also need this early up, so let's generalize
 
45
 * and init all our pytypes here. 
 
46
 */
 
47
 
 
48
void types_InitAll( void )
41
49
{
42
 
 /* The internal types (lowercase first letter, like constant_Type) are only
43
 
        * set when some object initializes them.  But unless we do it early, we get
44
 
        * some easy and unpredictable (varies with platform, even distro) ways to
45
 
        * crash Blender.  Some modules also need this early up, so let's generalize
46
 
        * and init all our pytypes here. */
47
 
 
48
50
        Action_Type.ob_type = &PyType_Type;
49
51
        Armature_Type.ob_type = &PyType_Type;
50
52
        BezTriple_Type.ob_type = &PyType_Type;
52
54
        Build_Type.ob_type = &PyType_Type;
53
55
        Button_Type.ob_type = &PyType_Type;
54
56
        Camera_Type.ob_type = &PyType_Type;
 
57
        CurNurb_Type.ob_type = &PyType_Type;
55
58
        Curve_Type.ob_type = &PyType_Type;
56
59
        Effect_Type.ob_type = &PyType_Type;
57
60
        Image_Type.ob_type = &PyType_Type;
71
74
        RenderData_Type.ob_type = &PyType_Type;
72
75
        Scene_Type.ob_type = &PyType_Type;
73
76
        Text_Type.ob_type = &PyType_Type;
 
77
        Text3d_Type.ob_type = &PyType_Type;
74
78
        Texture_Type.ob_type = &PyType_Type;
75
79
        Wave_Type.ob_type = &PyType_Type;
76
80
        World_Type.ob_type = &PyType_Type;
81
85
        quaternion_Type.ob_type = &PyType_Type;
82
86
        rgbTuple_Type.ob_type = &PyType_Type;
83
87
        vector_Type.ob_type = &PyType_Type;
 
88
        property_Type.ob_type = &PyType_Type;
84
89
}
85
90
 
86
91
/*****************************************************************************/
87
 
/* Function:                                             Types_Init                                                                                                                                                                      */
 
92
/* Function:     Types_Init                                             */
88
93
/*****************************************************************************/
89
 
PyObject *Types_Init (void)
 
94
PyObject *Types_Init( void )
90
95
{
91
 
        PyObject        *submodule, *dict;
92
 
 
93
 
        submodule = Py_InitModule3 ("Blender.Types", Null_methods, M_Types_doc);
94
 
 
95
 
        dict = PyModule_GetDict(submodule);
 
96
        PyObject *submodule, *dict;
 
97
 
 
98
        submodule =
 
99
                Py_InitModule3( "Blender.Types", Null_methods, M_Types_doc );
 
100
 
 
101
        dict = PyModule_GetDict( submodule );
96
102
 
97
103
        /* The Blender Object Type */
98
104
 
99
 
        PyDict_SetItemString(dict, "ObjectType",         (PyObject *)&Object_Type);
 
105
        PyDict_SetItemString( dict, "ObjectType",
 
106
                              ( PyObject * ) & Object_Type );
100
107
 
101
108
        /* Blender Object Data Types */
102
109
 
103
 
        PyDict_SetItemString(dict, "SceneType",         (PyObject *)&Scene_Type);
104
 
        PyDict_SetItemString(dict, "RenderDataType", (PyObject *)&RenderData_Type);
105
 
 
106
 
        PyDict_SetItemString(dict, "NMeshType",          (PyObject *)&NMesh_Type);
107
 
        PyDict_SetItemString(dict, "NMFaceType",         (PyObject *)&NMFace_Type);
108
 
        PyDict_SetItemString(dict, "NMVertType",         (PyObject *)&NMVert_Type);
109
 
        PyDict_SetItemString(dict, "NMColType",          (PyObject *)&NMCol_Type);
110
 
 
111
 
        PyDict_SetItemString(dict, "ArmatureType", (PyObject *)&Armature_Type);
112
 
        PyDict_SetItemString(dict, "BoneType",           (PyObject *)&Bone_Type);
113
 
 
114
 
        PyDict_SetItemString(dict, "CurveType",          (PyObject *)&Curve_Type);
115
 
        PyDict_SetItemString(dict, "IpoType",                    (PyObject *)&Ipo_Type);
116
 
        PyDict_SetItemString(dict, "MetaballType", (PyObject *)&Metaball_Type);
117
 
 
118
 
        PyDict_SetItemString(dict, "CameraType",         (PyObject *)&Camera_Type);
119
 
        PyDict_SetItemString(dict, "ImageType",          (PyObject *)&Image_Type);
120
 
        PyDict_SetItemString(dict, "LampType",           (PyObject *)&Lamp_Type);
121
 
        PyDict_SetItemString(dict, "TextType",           (PyObject *)&Text_Type);
122
 
        PyDict_SetItemString(dict, "MaterialType", (PyObject *)&Material_Type);
123
 
 
124
 
        PyDict_SetItemString(dict, "ButtonType",         (PyObject *)&Button_Type);
125
 
 
126
 
        PyDict_SetItemString(dict, "LatticeType",  (PyObject *)&Lattice_Type);
127
 
 
128
 
        PyDict_SetItemString(dict, "TextureType",  (PyObject *)&Texture_Type);
129
 
        PyDict_SetItemString(dict, "MTexType",           (PyObject *)&MTex_Type);
 
110
        PyDict_SetItemString( dict, "SceneType", ( PyObject * ) & Scene_Type );
 
111
        PyDict_SetItemString( dict, "RenderDataType",
 
112
                              ( PyObject * ) & RenderData_Type );
 
113
 
 
114
        PyDict_SetItemString( dict, "NMeshType", ( PyObject * ) & NMesh_Type );
 
115
        PyDict_SetItemString( dict, "NMFaceType",
 
116
                              ( PyObject * ) & NMFace_Type );
 
117
        PyDict_SetItemString( dict, "NMVertType",
 
118
                              ( PyObject * ) & NMVert_Type );
 
119
        PyDict_SetItemString( dict, "NMColType", ( PyObject * ) & NMCol_Type );
 
120
 
 
121
        PyDict_SetItemString( dict, "ArmatureType",
 
122
                              ( PyObject * ) & Armature_Type );
 
123
        PyDict_SetItemString( dict, "BoneType", ( PyObject * ) & Bone_Type );
 
124
 
 
125
        PyDict_SetItemString( dict, "CurNurb_Type",
 
126
                              ( PyObject * ) & CurNurb_Type );
 
127
        PyDict_SetItemString( dict, "CurveType", ( PyObject * ) & Curve_Type );
 
128
 
 
129
        PyDict_SetItemString( dict, "IpoType", ( PyObject * ) & Ipo_Type );
 
130
        PyDict_SetItemString( dict, "MetaballType",
 
131
                              ( PyObject * ) & Metaball_Type );
 
132
 
 
133
        PyDict_SetItemString( dict, "CameraType",
 
134
                              ( PyObject * ) & Camera_Type );
 
135
        PyDict_SetItemString( dict, "ImageType", ( PyObject * ) & Image_Type );
 
136
        PyDict_SetItemString( dict, "LampType", ( PyObject * ) & Lamp_Type );
 
137
        PyDict_SetItemString( dict, "TextType", ( PyObject * ) & Text_Type );
 
138
        PyDict_SetItemString( dict, "Text3dType", ( PyObject * ) & Text3d_Type );
 
139
        PyDict_SetItemString( dict, "MaterialType",
 
140
                              ( PyObject * ) & Material_Type );
 
141
 
 
142
        PyDict_SetItemString( dict, "ButtonType",
 
143
                              ( PyObject * ) & Button_Type );
 
144
 
 
145
        PyDict_SetItemString( dict, "LatticeType",
 
146
                              ( PyObject * ) & Lattice_Type );
 
147
 
 
148
        PyDict_SetItemString( dict, "TextureType",
 
149
                              ( PyObject * ) & Texture_Type );
 
150
        PyDict_SetItemString( dict, "MTexType", ( PyObject * ) & MTex_Type );
130
151
 
131
152
        /* External helper Types available to the main ones above */
132
153
 
133
 
        PyDict_SetItemString(dict, "vectorType",         (PyObject *)&vector_Type);
134
 
        PyDict_SetItemString(dict, "bufferType",         (PyObject *)&buffer_Type);
135
 
        PyDict_SetItemString(dict, "constantType", (PyObject *)&constant_Type);
136
 
        PyDict_SetItemString(dict, "rgbTupleType", (PyObject *)&rgbTuple_Type);
137
 
        PyDict_SetItemString(dict, "matrix_Type",  (PyObject *)&matrix_Type);
138
 
        PyDict_SetItemString(dict, "eulerType",  (PyObject *)&euler_Type);
139
 
        PyDict_SetItemString(dict, "quaternionType",    (PyObject *)&quaternion_Type);
140
 
        PyDict_SetItemString(dict, "BezTripleType", (PyObject *)&BezTriple_Type);
141
 
        PyDict_SetItemString(dict, "ActionType", (PyObject *)&Action_Type);
 
154
        PyDict_SetItemString( dict, "vectorType",
 
155
                              ( PyObject * ) & vector_Type );
 
156
        PyDict_SetItemString( dict, "bufferType",
 
157
                              ( PyObject * ) & buffer_Type );
 
158
        PyDict_SetItemString( dict, "constantType",
 
159
                              ( PyObject * ) & constant_Type );
 
160
        PyDict_SetItemString( dict, "rgbTupleType",
 
161
                              ( PyObject * ) & rgbTuple_Type );
 
162
        PyDict_SetItemString( dict, "matrix_Type",
 
163
                              ( PyObject * ) & matrix_Type );
 
164
        PyDict_SetItemString( dict, "eulerType", ( PyObject * ) & euler_Type );
 
165
        PyDict_SetItemString( dict, "quaternionType",
 
166
                              ( PyObject * ) & quaternion_Type );
 
167
        PyDict_SetItemString( dict, "BezTripleType",
 
168
                              ( PyObject * ) & BezTriple_Type );
 
169
        PyDict_SetItemString( dict, "ActionType",
 
170
                              ( PyObject * ) & Action_Type );
 
171
        PyDict_SetItemString( dict, "propertyType",
 
172
                              ( PyObject * ) & property_Type );
142
173
 
143
174
        return submodule;
144
175
}