Age | Commit message (Collapse) | Author |
|
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
|
|
Changed in Python 3.5, match Python's internal name.
|
|
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.
|
|
Check the thread-state before accessing PyEval_GetFrame, since this is
a crash handler, the state of the Python interpreter isn't known.
|
|
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.
|
|
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
|
|
These kinds of leaks are relatively harmless, it reduces the number of
un-freed data reported by valgrind on exit.
|
|
- 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
|
|
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
|
|
Report when the PYTHONPATH is expected to be used to help debug Python
initialization issues (see T98131).
|
|
|
|
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
|
|
Also some descriptive text into doc-strings.
|
|
Ref T92709
|
|
- 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
|
|
|
|
|
|
Line endings are already added.
|
|
Many callers expanded a PointerRNA argument,
so add a version of these functions that takes a PointerRNA.
|
|
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.
|
|
This would have made T88033 more straightforward to track down.
|
|
|
|
Also use doxy style function reference `#` prefix chars when
referencing identifiers.
|
|
|
|
|
|
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
|
|
Includes fixes to misspelled function names.
Ref D11280
|
|
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
|
|
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.
|
|
|
|
Regression from cafd6b519c5f5c4b67d0dfe3d453cd4223b38716.
D10494 by @ysano with edits.
|
|
Replace deprecated _PyUnicode_AsString{AndSize} usage.
T83626 still needs to be resolved before 3.10 is usable.
|
|
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
|
|
|
|
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
|
|
Without this, sys.executable may be set to Blender's
executable instead.
|
|
|
|
`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.
|
|
|
|
This reverts commit 04c5471ceefb41c9e49bf7c86f07e9e7b8426bb3.
This causes Blender not to start on some systems.
|
|
|
|
`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`.
|
|
Corrects incorrect usages of the word 'loose' when 'lose' was required.
Differential Revision: https://developer.blender.org/D9243
Reviewed by Campbell Barton
|
|
Matching BPY_context_set.
|
|
The context was stored both in __py_context & bpy_context_module.
This avoids duplicate functions to update them too.
|