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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-11-08Cleanup: PyMethodDef formattingCampbell Barton
Missed these changes in [0]. Also replace designated initializers in some C code, as it's not used often and would need to be removed when converting to C++. [0] e555ede626dade2c9b6449ec7dcdda22b2585fd4
2022-09-08Cleanup: correct PyModuleDef.m_slots referenceCampbell Barton
Changed in Python 3.5, match Python's internal name.
2022-09-08Python: ensure the runtime version is compatible WITH_PYTHON_MODULECampbell Barton
When Blender is built as a Python module, exit early if the major and minor versions don't match. Without this, the error message can be cryptic/unhelpful.
2022-08-19Fix crash accessing PyEval_GetFrame from Python's crash handlerCampbell Barton
Check the thread-state before accessing PyEval_GetFrame, since this is a crash handler, the state of the Python interpreter isn't known.
2022-07-16PyAPI: re-enable the "bgl" module for headless buildsCampbell Barton
Instead of removing the `bgl` module, set all it's functions to stubs so importing `bgl` or any of it's members doesn't raise an error. This avoids problems for scripts that import bgl but don't call it's functions when running in background mode.
2022-07-15Fix T99706: Crash rendering with headless buildsCampbell Barton
When rendering with headless builds, show an error instead of crashing. Previously GPU_backend_init was called indirectly from DRW_opengl_context_create, a new function is now called from the window manager (GPU_backend_init_once), so it's possible to check if the GPU has a back-end. This also disables the `bgl` Python module when building WITH_HEADLESS. Reviewed By: fclem Ref D15463
2022-07-07Python: clear Py-driver variables on exitCampbell Barton
These kinds of leaks are relatively harmless, it reduces the number of un-freed data reported by valgrind on exit.
2022-07-05Python: support v3.11 (beta) with changes to PyFrameObject & opcodesCampbell Barton
- Use API calls to access frame-data as PyFrameObject is now opaque. - Update opcodes allowed for safe driver evaluation. **Details** Some opcodes have been added for safe-driver evaluation. Python 3.11 removes many opcodes - the number of accepted opcodes in Blender's listing dropped from 65 to 43) however some new opcodes also needed to be added. As this relates to security details about newly added opcodes have been noted below (see [0] for full documentation). Newly added opcodes: - CACHE: Used to control caching instructions. - RESUME: A no-op. Performs internal checks. - BINARY_OP: Implements the binary and in-place operators, replacing specific binary operations. - CALL, PRECALL, KW_NAMES: Used for calling functions, replacing some existing opcodes. - POP_JUMP_{FORWARD/BACKWARD}_IF_{TRUE/FALSE/NONE/NOT_NONE}. Manipulate the byte-code counter. - SWAP, PUSH_NULL. Stack manipulation. Resolves T99277. [0]: https://docs.python.org/3.11/library/dis.html
2022-05-20CMake: fix AUDASPACE disabling WITH_PYTHON for BlenderCampbell Barton
When AUDASPACE couldn't find NUMPY, it would disable WITH_PYTHON for the rest of Blender. Now setting the value globally is only done for standalone AUDASPACE builds. Now it's possible to build Blender with AUDASPACE & PYTHON but without NUMPY. While this isn't an especially important configuration to support, having Python mysteriously disabled is a hassle to troubleshoot. NOTE: extern/audaspace/CMakeLists.txt has become out sync with the original [0], it seems this is being maintained in our repository. [0]: https://github.com/neXyon/audaspace/blob/master/CMakeLists.txt
2022-05-18Python: log the status of '--python-use-system-env' on initializationCampbell Barton
Report when the PYTHONPATH is expected to be used to help debug Python initialization issues (see T98131).
2022-05-17Cleanup: use term 'filepath' for full file pathsCampbell Barton
2022-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2022-02-09Cleanup: make file headers more consistentCampbell Barton
Also some descriptive text into doc-strings.
2021-12-10Cleanup: move public doc-strings into headers for 'python/intern'Campbell Barton
Ref T92709
2021-12-07Cleanup: move public doc-strings into headers for 'blenkernel'Campbell Barton
- Added space below non doc-string comments to make it clear these aren't comments for the symbols directly below them. - Use doxy sections for some headers. - Minor improvements to doc-strings. Ref T92709
2021-12-02Cleanup: move public doc-strings into headers for 'python'Campbell Barton
2021-09-23Cleanup: spelling in commentsCampbell Barton
2021-09-09Cleanup: remove newlines from logging textCampbell Barton
Line endings are already added.
2021-08-31Cleanup: add CTX_data_pointer_set_ptr & CTX_data_list_add_ptrCampbell Barton
Many callers expanded a PointerRNA argument, so add a version of these functions that takes a PointerRNA.
2021-08-13PyAPI: remove the .py extension requirement for startup registrationCampbell Barton
This was left over from when these scripts were loaded as modules, where their names needed to be compatible with Pythons module naming. Version patch existing files so text with register enabled without a `.py` extension wont start executing on startup. Resolves T89532.
2021-08-11PyAPI: report unreleased ID's with WITH_PYTHON_SAFETY enabledCampbell Barton
This would have made T88033 more straightforward to track down.
2021-08-09Cleanup: spelling in commentsCampbell Barton
2021-07-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
2021-06-24Cleanup: update clang-format so PyObject_HEAD indents properlyCampbell Barton
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-06-22Cleanup: Spelling MistakesLeon Zandman
This patch fixes many minor spelling mistakes, all in comments or console output. Mostly contractions like can't, won't, don't, its/it's, etc. Differential Revision: https://developer.blender.org/D11663 Reviewed by Harley Acheson
2021-05-21Cleanup: spellingLeon Zandman
Includes fixes to misspelled function names. Ref D11280
2021-04-20PyAPI: support Operator.poll functions 'disabled' hintCampbell Barton
Python scripts can now define the reason it's poll function fails using: `Operator.poll_message_set(message, ...)` This supports both regular text as well as delaying message creation using a callback which should be used in situations where constructing detailed messages is too much overhead for a poll function. Ref D11001
2021-03-16Fix T86332: Error using lambda in annotations in Python 3.10Campbell Barton
Callbacks used in `bpy.props` didn't hold a references to the functions they used. While this has been the case since early 2.5x it didn't cause any problems as long as the class held a reference. With Python 3.10 or when using `from __future__ import annotations`, the annotations are no longer owned by the class once evaluated. Resolve this by holding a reference in the module, which now supports traverse & clear callbacks so the objects are visible to Python's garbage collector. Also refactor storage of Python data, moving from an array into a struct.
2021-03-10Cleanup: unused warning building as a Python moduleCampbell Barton
2021-02-22Fix missing NULL check on macOS when system-python isn't foundCampbell Barton
Regression from cafd6b519c5f5c4b67d0dfe3d453cd4223b38716. D10494 by @ysano with edits.
2021-02-13Fix T85573: Building with Python 3.10a5 failsCampbell Barton
Replace deprecated _PyUnicode_AsString{AndSize} usage. T83626 still needs to be resolved before 3.10 is usable.
2021-02-12PyAPI: Use PyPreConfig & PyConfig for Python initializationCampbell Barton
Use Python 3.8's API for setting the initial configuration. This replaces a mix of our logic and direct calls to the Python API and has no user visible changes. Using the Python API makes the logic easier to follow and provides utilities such as `PyConfig_SetBytesArgv` that wasn't available in previous releases. Note that this uses Python's utf8/wchar_t conversions, which used to cause problems (see T31506). Since `Py_UTF8Mode` was set, the systems locale isn't used for decoding, allowing us to use Python's utility functions that call `Py_DecodeLocale` internally. Ref D10382
2021-01-28Merge branch 'blender-v2.92-release'Campbell Barton
2021-01-28Fix T82675: Crash on exit when Blender is built as a Python moduleCampbell Barton
2021-01-28PyAPI: use PYTHONUTF8/Py_UTF8Mode on all platformsCampbell Barton
System encoding issues have been a paint-point for us with Python 3, since Blender always uses UTF-8 which might not be the case for the OS. While the Py_SetStandardStreamEncoding was already set to utf-8, the file-system could still have an incompatible encoding. See PEP-540 for details.
2021-01-09Cleanup: use bool arguments & variablesCampbell Barton
2021-01-07PyAPI: don't raise & clear exceptions when setting context membersCampbell Barton
BPY_context_dict_clear_members_array used PyDict_DelItemString which raised & cleared the exception when the key didn't exist. Even though setting/clearing the exception is supported, it's worth avoiding where possible as it adds some overhead as well as overwriting the previous error which can free PyObject's which are unrelated to the code being executed. Possible fix for T82552, crashing on Windows when setting the exception.
2020-11-02Cleanup: use logging for "Found bundled Python" messageCampbell Barton
This was added when Python was initially bundled so any problems finding Python could be investigated. Move this to use logging so we can show this information when needed.
2020-11-01Merge branch 'blender-v2.91-release'Campbell Barton
2020-11-01PyAPI: set sys.executable to None when Python can't be foundCampbell Barton
Without this, sys.executable may be set to Blender's executable instead.
2020-10-29Merge branch 'blender-v2.91-release'Campbell Barton
2020-10-29PyAPI: point sys.executable to the Python binaryCampbell Barton
`sys.executable` is documented to be a Python interpreter or None. This was set to Blender's executable which caused the multiprocessing module to spawn new instances of Blender instead of Python on WIN32. See issue described in D7815. Deprecate 'bpy.app.binary_path_python' & warn when using. Blender's executable remains accessible via `bpy.app.binary_path`. Modified 04c5471ceefb4, setting `sys.executable` instead of using Py_SetProgramName, which is needed for a bundled Python installation.
2020-10-28Merge branch 'blender-v2.91-release'Campbell Barton
2020-10-28Revert "PyAPI: point sys.executable to the Python binary"Campbell Barton
This reverts commit 04c5471ceefb41c9e49bf7c86f07e9e7b8426bb3. This causes Blender not to start on some systems.
2020-10-28Cleanup: update old comment for why we can't use PySys_SetArgvCampbell Barton
2020-10-28PyAPI: point sys.executable to the Python binaryCampbell Barton
`sys.executable` is documented to be a Python interpreter or None. This was set to Blender's executable which caused the multiprocessing module to spawn new instances of Blender instead of Python on WIN32. See issue described in D7815. Deprecate 'bpy.app.binary_path_python' & warn when using. Blender's executable remains accessible via `bpy.app.binary_path`.
2020-10-19Spelling: Loose Versus LoseHarley Acheson
Corrects incorrect usages of the word 'loose' when 'lose' was required. Differential Revision: https://developer.blender.org/D9243 Reviewed by Campbell Barton
2020-10-15Cleanup: rename BPy_GetContext -> BPY_context_getCampbell Barton
Matching BPY_context_set.
2020-10-15Cleanup: remove duplicate context variable (__py_context)Campbell Barton
The context was stored both in __py_context & bpy_context_module. This avoids duplicate functions to update them too.