2012-12-18 18:02:20 +00:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
* \ingroup pythonintern
|
2012-12-18 18:02:20 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <Python.h>
|
|
|
|
|
2014-06-17 02:47:57 +10:00
|
|
|
#include "BLI_utildefines.h"
|
|
|
|
|
2012-12-18 18:02:20 +00:00
|
|
|
#include "bpy_app_build_options.h"
|
|
|
|
|
2013-01-04 04:43:49 +00:00
|
|
|
static PyTypeObject BlenderAppBuildOptionsType;
|
|
|
|
|
|
|
|
static PyStructSequence_Field app_builtopts_info_fields[] = {
|
Python i18n API. Many thanks to Campbell and Brecht for the reviews and suggestions!
This commit adds:
* A new bpy.app.translations module giving some info about locales/translation stuff (current active locale, all locales currently known by blender, all translation contexts currently defined, etc.).
* The ability for addons to feature translations, using the (un)register functions of above module.
* Also cleans up "translate py string when storing into RNA prop" by removing "PROP_TRANSLATE" string's subtype, and adding a PROP_STRING_PY_TRANSLATE flag instead (this way it is no more exposed to python...).
Addon translations work with py dictionaries: each addon features a dict {lang: {(context, message): translation, ...}, ...}, which is registered when the addon is enabled (and unregistered when disabled).
Then, when a key (context, message) is not found in regular mo catalog, a cache dict for current locale is built from all registered addon translations, and key is searched in it.
Note: currently addons writers have to do all the work by hand, will add something (probably extend "edit translation" addon) to automate messages extraction from addons soon(ish)! To get a look to expected behavior from addons, have a look at render_copy_settings/__init__.py and render_copy_settings/translations.py (rather stupid example currently, but...). Once we have a complete process, I'll also update relevant wiki pages.
2013-01-20 17:29:07 +00:00
|
|
|
/* names mostly follow CMake options, lowercase, after WITH_ */
|
2013-01-04 04:43:49 +00:00
|
|
|
{(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},
|
2013-01-05 22:24:05 +00:00
|
|
|
{(char *)"freestyle", NULL},
|
2013-01-04 04:43:49 +00:00
|
|
|
{(char *)"image_cineon", NULL},
|
|
|
|
{(char *)"image_dds", 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},
|
2015-02-18 12:07:48 +01:00
|
|
|
{(char *)"sdl_dynload", NULL},
|
2013-01-04 04:43:49 +00:00
|
|
|
{(char *)"jack", NULL},
|
|
|
|
{(char *)"libmv", NULL},
|
|
|
|
{(char *)"mod_fluid", NULL},
|
|
|
|
{(char *)"mod_oceansim", NULL},
|
|
|
|
{(char *)"mod_remesh", NULL},
|
|
|
|
{(char *)"mod_smoke", NULL},
|
|
|
|
{(char *)"collada", NULL},
|
|
|
|
{(char *)"opencolorio", NULL},
|
2013-04-28 16:52:51 +00:00
|
|
|
{(char *)"openmp", NULL},
|
Implementation of OpenVDB as a possible cache format for smoke
simulations.
This commits implements OpenVDB as an extra cache format in the Point
Cache system for smoke simulations. Compilation with the library is
turned off by default for now, and shall be enabled when the library is
present.
A documentation of its doings is available here: http://
wiki.blender.org/index.php/User:Kevindietrich/OpenVDBSmokeExport.
A guide to compile OpenVDB can be found here (Linux): http://
wiki.blender.org/index.php?title=Dev:Doc/Building_Blender/Linux/
Dependencies_From_Source#OpenVDB
Reviewers: sergey, lukastoenne, brecht, campbellbarton
Reviewed By: brecht, campbellbarton
Subscribers: galenb, Blendify, robocyte, Lapineige, bliblubli,
jtheninja, lukasstockner97, dingto, brecht
Differential Revision: https://developer.blender.org/D1721
2016-01-23 08:39:29 +01:00
|
|
|
{(char *)"openvdb", NULL},
|
Basic Alembic support
All in all, this patch adds an Alembic importer, an Alembic exporter,
and a new CacheFile data block which, for now, wraps around an Alembic
archive. This data block is made available through a new modifier ("Mesh
Sequence Cache") as well as a new constraint ("Transform Cache") to
somewhat properly support respectively geometric and transformation data
streaming from alembic caches.
A more in-depth documentation is to be found on the wiki, as well as a
guide to compile alembic: https://wiki.blender.org/index.php/
User:Kevindietrich/AlembicBasicIo.
Many thanks to everyone involved in this little project, and huge shout
out to "cgstrive" for the thorough testings with Maya, 3ds Max, Houdini
and Realflow as well as @fjuhec, @jensverwiebe and @jasperge for the
custom builds and compile fixes.
Reviewers: sergey, campbellbarton, mont29
Reviewed By: sergey, campbellbarton, mont29
Differential Revision: https://developer.blender.org/D2060
2016-08-06 06:20:37 +02:00
|
|
|
{(char *)"alembic", NULL},
|
2019-02-03 14:01:45 +11:00
|
|
|
{NULL},
|
2013-01-04 04:43:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static PyStructSequence_Desc app_builtopts_info_desc = {
|
|
|
|
(char *)"bpy.app.build_options", /* name */
|
Python i18n API. Many thanks to Campbell and Brecht for the reviews and suggestions!
This commit adds:
* A new bpy.app.translations module giving some info about locales/translation stuff (current active locale, all locales currently known by blender, all translation contexts currently defined, etc.).
* The ability for addons to feature translations, using the (un)register functions of above module.
* Also cleans up "translate py string when storing into RNA prop" by removing "PROP_TRANSLATE" string's subtype, and adding a PROP_STRING_PY_TRANSLATE flag instead (this way it is no more exposed to python...).
Addon translations work with py dictionaries: each addon features a dict {lang: {(context, message): translation, ...}, ...}, which is registered when the addon is enabled (and unregistered when disabled).
Then, when a key (context, message) is not found in regular mo catalog, a cache dict for current locale is built from all registered addon translations, and key is searched in it.
Note: currently addons writers have to do all the work by hand, will add something (probably extend "edit translation" addon) to automate messages extraction from addons soon(ish)! To get a look to expected behavior from addons, have a look at render_copy_settings/__init__.py and render_copy_settings/translations.py (rather stupid example currently, but...). Once we have a complete process, I'll also update relevant wiki pages.
2013-01-20 17:29:07 +00:00
|
|
|
(char *)"This module contains information about options blender is built with", /* doc */
|
2013-01-04 04:43:49 +00:00
|
|
|
app_builtopts_info_fields, /* fields */
|
2019-02-03 14:01:45 +11:00
|
|
|
ARRAY_SIZE(app_builtopts_info_fields) - 1,
|
2013-01-04 04:43:49 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static PyObject *make_builtopts_info(void)
|
2012-12-18 18:02:20 +00:00
|
|
|
{
|
2013-01-04 04:43:49 +00:00
|
|
|
PyObject *builtopts_info;
|
|
|
|
int pos = 0;
|
2012-12-18 18:02:20 +00:00
|
|
|
|
2013-01-04 04:43:49 +00:00
|
|
|
builtopts_info = PyStructSequence_New(&BlenderAppBuildOptionsType);
|
|
|
|
if (builtopts_info == NULL) {
|
|
|
|
return NULL;
|
|
|
|
}
|
2012-12-18 18:02:20 +00:00
|
|
|
|
2013-01-04 04:43:49 +00:00
|
|
|
#define SetObjIncref(item) \
|
|
|
|
PyStructSequence_SET_ITEM(builtopts_info, pos++, (Py_IncRef(item), item))
|
2012-12-18 18:02:20 +00:00
|
|
|
|
|
|
|
#ifdef WITH_BULLET
|
2013-01-04 04:43:49 +00:00
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
2012-12-18 18:02:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_AVI
|
2013-01-04 04:43:49 +00:00
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
2012-12-18 18:02:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_FFMPEG
|
2013-01-04 04:43:49 +00:00
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
2012-12-18 18:02:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_SNDFILE
|
2013-01-04 04:43:49 +00:00
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
2012-12-18 18:02:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_COMPOSITOR
|
2013-01-04 04:43:49 +00:00
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
2012-12-18 18:02:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_CYCLES
|
2013-01-04 04:43:49 +00:00
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
2012-12-18 18:02:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_CYCLES_OSL
|
2013-01-04 04:43:49 +00:00
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
2012-12-18 18:02:20 +00:00
|
|
|
#endif
|
|
|
|
|
2012-12-20 07:57:26 +00:00
|
|
|
#ifdef WITH_FREESTYLE
|
2013-01-05 22:24:05 +00:00
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
2012-12-20 07:57:26 +00:00
|
|
|
#endif
|
|
|
|
|
2012-12-18 18:02:20 +00:00
|
|
|
#ifdef WITH_CINEON
|
2013-01-04 04:43:49 +00:00
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
2012-12-18 18:02:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_DDS
|
2013-01-04 04:43:49 +00:00
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
2012-12-18 18:02:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_HDR
|
2013-01-04 04:43:49 +00:00
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
2012-12-18 18:02:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_OPENEXR
|
2013-01-04 04:43:49 +00:00
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
2012-12-18 18:02:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_OPENJPEG
|
2013-01-04 04:43:49 +00:00
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
2012-12-18 18:02:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_TIFF
|
2013-01-04 04:43:49 +00:00
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
2012-12-18 18:02:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_INPUT_NDOF
|
2013-01-04 04:43:49 +00:00
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_AUDASPACE
|
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
2012-12-18 18:02:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_INTERNATIONAL
|
2013-01-04 04:43:49 +00:00
|
|
|
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);
|
2012-12-18 18:02:20 +00:00
|
|
|
#endif
|
|
|
|
|
2015-02-18 12:07:48 +01:00
|
|
|
#ifdef WITH_SDL_DYNLOAD
|
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
|
|
|
#endif
|
|
|
|
|
2012-12-18 18:02:20 +00:00
|
|
|
#ifdef WITH_JACK
|
2013-01-04 04:43:49 +00:00
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
2012-12-18 18:02:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_LIBMV
|
2013-01-04 04:43:49 +00:00
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
2012-12-18 18:02:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_MOD_FLUID
|
2013-01-04 04:43:49 +00:00
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
2012-12-18 18:02:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_OCEANSIM
|
2013-01-04 04:43:49 +00:00
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
2012-12-18 18:02:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_MOD_REMESH
|
2013-01-04 04:43:49 +00:00
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
2012-12-18 18:02:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WITH_SMOKE
|
2013-01-04 04:43:49 +00:00
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
2012-12-18 18:02:20 +00:00
|
|
|
#endif
|
|
|
|
|
2013-01-04 04:43:49 +00:00
|
|
|
#ifdef WITH_COLLADA
|
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
2012-12-18 18:02:20 +00:00
|
|
|
#endif
|
|
|
|
|
2013-01-04 04:43:49 +00:00
|
|
|
#ifdef WITH_OCIO
|
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
2012-12-18 18:02:20 +00:00
|
|
|
#endif
|
|
|
|
|
2013-05-20 14:38:43 +00:00
|
|
|
#ifdef _OPENMP
|
2013-04-28 16:52:51 +00:00
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
|
|
|
#endif
|
|
|
|
|
Implementation of OpenVDB as a possible cache format for smoke
simulations.
This commits implements OpenVDB as an extra cache format in the Point
Cache system for smoke simulations. Compilation with the library is
turned off by default for now, and shall be enabled when the library is
present.
A documentation of its doings is available here: http://
wiki.blender.org/index.php/User:Kevindietrich/OpenVDBSmokeExport.
A guide to compile OpenVDB can be found here (Linux): http://
wiki.blender.org/index.php?title=Dev:Doc/Building_Blender/Linux/
Dependencies_From_Source#OpenVDB
Reviewers: sergey, lukastoenne, brecht, campbellbarton
Reviewed By: brecht, campbellbarton
Subscribers: galenb, Blendify, robocyte, Lapineige, bliblubli,
jtheninja, lukasstockner97, dingto, brecht
Differential Revision: https://developer.blender.org/D1721
2016-01-23 08:39:29 +01:00
|
|
|
#ifdef WITH_OPENVDB
|
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
|
|
|
#endif
|
|
|
|
|
Basic Alembic support
All in all, this patch adds an Alembic importer, an Alembic exporter,
and a new CacheFile data block which, for now, wraps around an Alembic
archive. This data block is made available through a new modifier ("Mesh
Sequence Cache") as well as a new constraint ("Transform Cache") to
somewhat properly support respectively geometric and transformation data
streaming from alembic caches.
A more in-depth documentation is to be found on the wiki, as well as a
guide to compile alembic: https://wiki.blender.org/index.php/
User:Kevindietrich/AlembicBasicIo.
Many thanks to everyone involved in this little project, and huge shout
out to "cgstrive" for the thorough testings with Maya, 3ds Max, Houdini
and Realflow as well as @fjuhec, @jensverwiebe and @jasperge for the
custom builds and compile fixes.
Reviewers: sergey, campbellbarton, mont29
Reviewed By: sergey, campbellbarton, mont29
Differential Revision: https://developer.blender.org/D2060
2016-08-06 06:20:37 +02:00
|
|
|
#ifdef WITH_ALEMBIC
|
|
|
|
SetObjIncref(Py_True);
|
|
|
|
#else
|
|
|
|
SetObjIncref(Py_False);
|
|
|
|
#endif
|
|
|
|
|
2013-01-04 04:43:49 +00:00
|
|
|
#undef SetObjIncref
|
2012-12-18 18:02:20 +00:00
|
|
|
|
2013-01-04 04:43:49 +00:00
|
|
|
return builtopts_info;
|
2012-12-18 18:02:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
PyObject *BPY_app_build_options_struct(void)
|
|
|
|
{
|
|
|
|
PyObject *ret;
|
|
|
|
|
2013-01-04 04:43:49 +00:00
|
|
|
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] */
|
2012-12-18 18:02:20 +00:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|