Welcome to mirror list, hosted at ThFree Co, Russian Federation.

bpy_app_build_options.c « intern « python « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 501e09dd6adadcc6d4eb92cbb73144b222850738 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
/*
 * ***** BEGIN GPL LICENSE BLOCK *****
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * Contributor(s): Sergey Sharybin
 *
 * ***** END GPL LICENSE BLOCK *****
 */

/** \file blender/python/intern/bpy_app_build_options.c
 *  \ingroup pythonintern
 */

#include <Python.h>

#include "BLI_utildefines.h"

#include "bpy_app_build_options.h"

static PyTypeObject BlenderAppBuildOptionsType;

static PyStructSequence_Field app_builtopts_info_fields[] = {
	/* names mostly follow CMake options, lowercase, after WITH_ */
	{(char *)"bullet", NULL},
	{(char *)"codec_avi", NULL},
	{(char *)"codec_ffmpeg", NULL},
	{(char *)"codec_sndfile", NULL},
	{(char *)"compositor", NULL},
	{(char *)"cycles", NULL},
	{(char *)"cycles_osl", NULL},
	{(char *)"freestyle", NULL},
	{(char *)"gameengine", NULL},
	{(char *)"image_cineon", NULL},
	{(char *)"image_dds", NULL},
	{(char *)"image_frameserver", NULL},
	{(char *)"image_hdr", NULL},
	{(char *)"image_openexr", NULL},
	{(char *)"image_openjpeg", NULL},
	{(char *)"image_tiff", NULL},
	{(char *)"input_ndof", NULL},
	{(char *)"audaspace", NULL},
	{(char *)"international", NULL},
	{(char *)"openal", NULL},
	{(char *)"sdl", NULL},
	{(char *)"sdl_dynload", NULL},
	{(char *)"jack", NULL},
	{(char *)"libmv", NULL},
	{(char *)"mod_boolean", NULL},
	{(char *)"mod_fluid", NULL},
	{(char *)"mod_oceansim", NULL},
	{(char *)"mod_remesh", NULL},
	{(char *)"mod_smoke", NULL},
	{(char *)"collada", NULL},
	{(char *)"opencolorio", NULL},
	{(char *)"player", NULL},
	{(char *)"openmp", NULL},
	{(char *)"openvdb", NULL},
	{(char *)"alembic", NULL},
	{NULL}
};


static PyStructSequence_Desc app_builtopts_info_desc = {
	(char *)"bpy.app.build_options",     /* name */
	(char *)"This module contains information about options blender is built with",    /* doc */
	app_builtopts_info_fields,    /* fields */
	ARRAY_SIZE(app_builtopts_info_fields) - 1
};

static PyObject *make_builtopts_info(void)
{
	PyObject *builtopts_info;
	int pos = 0;

	builtopts_info = PyStructSequence_New(&BlenderAppBuildOptionsType);
	if (builtopts_info == NULL) {
		return NULL;
	}

#define SetObjIncref(item) \
	PyStructSequence_SET_ITEM(builtopts_info, pos++, (Py_IncRef(item), item))

#ifdef WITH_BULLET
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_AVI
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_FFMPEG
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_SNDFILE
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_COMPOSITOR
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_CYCLES
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_CYCLES_OSL
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_FREESTYLE
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_GAMEENGINE
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_CINEON
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_DDS
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_FRAMESERVER
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_HDR
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_OPENEXR
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_OPENJPEG
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_TIFF
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_INPUT_NDOF
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_AUDASPACE
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_INTERNATIONAL
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_OPENAL
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_SDL
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_SDL_DYNLOAD
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_JACK
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_LIBMV
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_MOD_BOOLEAN
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_MOD_FLUID
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_OCEANSIM
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_MOD_REMESH
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_SMOKE
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_COLLADA
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_OCIO
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_PLAYER
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef _OPENMP
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_OPENVDB
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#ifdef WITH_ALEMBIC
	SetObjIncref(Py_True);
#else
	SetObjIncref(Py_False);
#endif

#undef SetObjIncref

	return builtopts_info;
}

PyObject *BPY_app_build_options_struct(void)
{
	PyObject *ret;

	PyStructSequence_InitType(&BlenderAppBuildOptionsType, &app_builtopts_info_desc);

	ret = make_builtopts_info();

	/* prevent user from creating new instances */
	BlenderAppBuildOptionsType.tp_init = NULL;
	BlenderAppBuildOptionsType.tp_new = NULL;
	BlenderAppBuildOptionsType.tp_hash = (hashfunc)_Py_HashPointer; /* without this we can't do set(sys.modules) [#29635] */

	return ret;
}