Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/intern/bpy_app.c
| Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | |||||
| #include "bpy_driver.h" | #include "bpy_driver.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BKE_appdir.h" | #include "BKE_appdir.h" | ||||
| #include "BKE_blender.h" | #include "BKE_blender.h" | ||||
| #include "BKE_global.h" | #include "BKE_global.h" | ||||
| #include "DNA_ID.h" | |||||
| #include "UI_interface_icons.h" | |||||
| #include "../generic/py_capi_utils.h" | #include "../generic/py_capi_utils.h" | ||||
| #include "../generic/python_utildefines.h" | #include "../generic/python_utildefines.h" | ||||
| #ifdef BUILD_DATE | #ifdef BUILD_DATE | ||||
| extern char build_date[]; | extern char build_date[]; | ||||
| extern char build_time[]; | extern char build_time[]; | ||||
| extern unsigned long build_commit_timestamp; | extern unsigned long build_commit_timestamp; | ||||
| extern char build_commit_date[]; | extern char build_commit_date[]; | ||||
| ▲ Show 20 Lines • Show All 232 Lines • ▼ Show 20 Lines | if (bpy_pydriver_create_dict() != 0) { | ||||
| PyErr_SetString(PyExc_RuntimeError, "bpy.app.driver_namespace failed to create dictionary"); | PyErr_SetString(PyExc_RuntimeError, "bpy.app.driver_namespace failed to create dictionary"); | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| } | } | ||||
| return Py_INCREF_RET(bpy_pydriver_Dict); | return Py_INCREF_RET(bpy_pydriver_Dict); | ||||
| } | } | ||||
| PyDoc_STRVAR(bpy_app_preview_render_size_doc, | |||||
| "Reference size for icon/preview renders (read-only)" | |||||
| ); | |||||
| static PyObject *bpy_app_preview_render_size_get(PyObject *UNUSED(self), void *closure) | |||||
| { | |||||
| return PyLong_FromLong((long)UI_preview_render_size(GET_INT_FROM_POINTER(closure))); | |||||
| } | |||||
| static PyObject *bpy_app_autoexec_fail_message_get(PyObject *UNUSED(self), void *UNUSED(closure)) | static PyObject *bpy_app_autoexec_fail_message_get(PyObject *UNUSED(self), void *UNUSED(closure)) | ||||
| { | { | ||||
| return PyC_UnicodeFromByte(G.autoexec_fail); | return PyC_UnicodeFromByte(G.autoexec_fail); | ||||
| } | } | ||||
| static PyGetSetDef bpy_app_getsets[] = { | static PyGetSetDef bpy_app_getsets[] = { | ||||
| {(char *)"debug", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG}, | {(char *)"debug", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG}, | ||||
| {(char *)"debug_ffmpeg", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_FFMPEG}, | {(char *)"debug_ffmpeg", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_FFMPEG}, | ||||
| {(char *)"debug_freestyle", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_FREESTYLE}, | {(char *)"debug_freestyle", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_FREESTYLE}, | ||||
| {(char *)"debug_python", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_PYTHON}, | {(char *)"debug_python", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_PYTHON}, | ||||
| {(char *)"debug_events", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_EVENTS}, | {(char *)"debug_events", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_EVENTS}, | ||||
| {(char *)"debug_handlers", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_HANDLERS}, | {(char *)"debug_handlers", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_HANDLERS}, | ||||
| {(char *)"debug_wm", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_WM}, | {(char *)"debug_wm", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_WM}, | ||||
| {(char *)"debug_depsgraph", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_DEPSGRAPH}, | {(char *)"debug_depsgraph", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_DEPSGRAPH}, | ||||
| {(char *)"debug_simdata", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_SIMDATA}, | {(char *)"debug_simdata", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_SIMDATA}, | ||||
| {(char *)"debug_gpumem", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_GPU_MEM}, | {(char *)"debug_gpumem", bpy_app_debug_get, bpy_app_debug_set, (char *)bpy_app_debug_doc, (void *)G_DEBUG_GPU_MEM}, | ||||
| {(char *)"binary_path_python", bpy_app_binary_path_python_get, NULL, (char *)bpy_app_binary_path_python_doc, NULL}, | {(char *)"binary_path_python", bpy_app_binary_path_python_get, NULL, (char *)bpy_app_binary_path_python_doc, NULL}, | ||||
| {(char *)"debug_value", bpy_app_debug_value_get, bpy_app_debug_value_set, (char *)bpy_app_debug_value_doc, NULL}, | {(char *)"debug_value", bpy_app_debug_value_get, bpy_app_debug_value_set, (char *)bpy_app_debug_value_doc, NULL}, | ||||
| {(char *)"tempdir", bpy_app_tempdir_get, NULL, (char *)bpy_app_tempdir_doc, NULL}, | {(char *)"tempdir", bpy_app_tempdir_get, NULL, (char *)bpy_app_tempdir_doc, NULL}, | ||||
| {(char *)"driver_namespace", bpy_app_driver_dict_get, NULL, (char *)bpy_app_driver_dict_doc, NULL}, | {(char *)"driver_namespace", bpy_app_driver_dict_get, NULL, (char *)bpy_app_driver_dict_doc, NULL}, | ||||
| {(char *)"render_icon_size", bpy_app_preview_render_size_get, NULL, (char *)bpy_app_preview_render_size_doc, (void *)ICON_SIZE_ICON}, | |||||
| {(char *)"render_preview_size", bpy_app_preview_render_size_get, NULL, (char *)bpy_app_preview_render_size_doc, (void *)ICON_SIZE_PREVIEW}, | |||||
| /* security */ | /* security */ | ||||
| {(char *)"autoexec_fail", bpy_app_global_flag_get, NULL, NULL, (void *)G_SCRIPT_AUTOEXEC_FAIL}, | {(char *)"autoexec_fail", bpy_app_global_flag_get, NULL, NULL, (void *)G_SCRIPT_AUTOEXEC_FAIL}, | ||||
| {(char *)"autoexec_fail_quiet", bpy_app_global_flag_get, NULL, NULL, (void *)G_SCRIPT_AUTOEXEC_FAIL_QUIET}, | {(char *)"autoexec_fail_quiet", bpy_app_global_flag_get, NULL, NULL, (void *)G_SCRIPT_AUTOEXEC_FAIL_QUIET}, | ||||
| {(char *)"autoexec_fail_message", bpy_app_autoexec_fail_message_get, NULL, NULL, NULL}, | {(char *)"autoexec_fail_message", bpy_app_autoexec_fail_message_get, NULL, NULL, NULL}, | ||||
| {NULL, NULL, NULL, NULL, NULL} | {NULL, NULL, NULL, NULL, NULL} | ||||
| }; | }; | ||||
| static void py_struct_seq_getset_init(void) | static void py_struct_seq_getset_init(void) | ||||
| Show All 29 Lines | |||||